aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-06-23 10:12:54 -0400
committerDave Airlie <airlied@linux.ie>2009-06-24 02:10:56 -0400
commitb1e3a6d1c4d0ac75ad8289bcfd69efcc9b1bc6e5 (patch)
tree0ab59565a3d511e61f71476f79ab9231d7d6fdf9 /drivers/gpu
parent696d4df1dbfe0b054e94c1990b49c1727ffc1ff0 (diff)
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 3f48a57531b5..f97563db4e59 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -35,6 +35,23 @@
35#include "atom.h" 35#include "atom.h"
36 36
37/* 37/*
38 * Clear GPU surface registers.
39 */
40static 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 * GPU scratch registers helpers function. 55 * GPU scratch registers helpers function.
39 */ 56 */
40static void radeon_scratch_init(struct radeon_device *rdev) 57static void radeon_scratch_init(struct radeon_device *rdev)
@@ -496,6 +513,9 @@ int radeon_device_init(struct radeon_device *rdev,
496 radeon_errata(rdev); 513 radeon_errata(rdev);
497 /* Initialize scratch registers */ 514 /* Initialize scratch registers */
498 radeon_scratch_init(rdev); 515 radeon_scratch_init(rdev);
516 /* Initialize surface registers */
517 radeon_surface_init(rdev);
518
499 /* TODO: disable VGA need to use VGA request */ 519 /* TODO: disable VGA need to use VGA request */
500 /* BIOS*/ 520 /* BIOS*/
501 if (!radeon_get_bios(rdev)) { 521 if (!radeon_get_bios(rdev)) {