Commit b1e3a6d1c4d0ac75ad8289bcfd69efcc9b1bc6e5
Committed by
Dave Airlie
1 parent
696d4df1db
Exists in
master
and in
7 other branches
drm/radeon: Clear surface registers at initialization time.
Some PowerMac firmwares set up a tiling surface at the beginning of VRAM which messes us up otherwise. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
Showing 1 changed file with 20 additions and 0 deletions Side-by-side Diff
drivers/gpu/drm/radeon/radeon_device.c
... | ... | @@ -35,6 +35,23 @@ |
35 | 35 | #include "atom.h" |
36 | 36 | |
37 | 37 | /* |
38 | + * Clear GPU surface registers. | |
39 | + */ | |
40 | +static void radeon_surface_init(struct radeon_device *rdev) | |
41 | +{ | |
42 | + /* FIXME: check this out */ | |
43 | + if (rdev->family < CHIP_R600) { | |
44 | + int i; | |
45 | + | |
46 | + for (i = 0; i < 8; i++) { | |
47 | + WREG32(RADEON_SURFACE0_INFO + | |
48 | + i * (RADEON_SURFACE1_INFO - RADEON_SURFACE0_INFO), | |
49 | + 0); | |
50 | + } | |
51 | + } | |
52 | +} | |
53 | + | |
54 | +/* | |
38 | 55 | * GPU scratch registers helpers function. |
39 | 56 | */ |
40 | 57 | static void radeon_scratch_init(struct radeon_device *rdev) |
... | ... | @@ -496,6 +513,9 @@ |
496 | 513 | radeon_errata(rdev); |
497 | 514 | /* Initialize scratch registers */ |
498 | 515 | radeon_scratch_init(rdev); |
516 | + /* Initialize surface registers */ | |
517 | + radeon_surface_init(rdev); | |
518 | + | |
499 | 519 | /* TODO: disable VGA need to use VGA request */ |
500 | 520 | /* BIOS*/ |
501 | 521 | if (!radeon_get_bios(rdev)) { |