diff options
author | Dave Airlie <airlied@linux.ie> | 2009-09-18 00:16:38 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-18 02:13:11 -0400 |
commit | 698443d9ec1a33eff65b27b9514e06998bf57eb3 (patch) | |
tree | c7fed660677470060168d8ab91b67bd6eeae5c4d /drivers/gpu | |
parent | 5e6dde7ec2e72f49ff749204efc03a59478d7d34 (diff) |
drm/radeon/kms: disable VGA rendering engine before taking over VRAM
Before we use any of VRAM, we need to disable the VGA rendering
engine, this render text mode into a graphical framebuffer
for scanout, however it does this on vblank, and can end up
overwriting the GART table and r600 shader objects.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/avivod.h | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rs600.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 4 |
4 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/avivod.h b/drivers/gpu/drm/radeon/avivod.h index d4e6e6e4a938..e2b92c445bab 100644 --- a/drivers/gpu/drm/radeon/avivod.h +++ b/drivers/gpu/drm/radeon/avivod.h | |||
@@ -57,4 +57,13 @@ | |||
57 | #define VGA_RENDER_CONTROL 0x0300 | 57 | #define VGA_RENDER_CONTROL 0x0300 |
58 | #define VGA_VSTATUS_CNTL_MASK 0x00030000 | 58 | #define VGA_VSTATUS_CNTL_MASK 0x00030000 |
59 | 59 | ||
60 | /* AVIVO disable VGA rendering */ | ||
61 | static inline void radeon_avivo_vga_render_disable(struct radeon_device *rdev) | ||
62 | { | ||
63 | u32 vga_render; | ||
64 | vga_render = RREG32(VGA_RENDER_CONTROL); | ||
65 | vga_render &= ~VGA_VSTATUS_CNTL_MASK; | ||
66 | WREG32(VGA_RENDER_CONTROL, vga_render); | ||
67 | } | ||
68 | |||
60 | #endif | 69 | #endif |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 1e1cab5ef1e4..aafdb8edc11d 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -340,6 +340,10 @@ static void r600_mc_resume(struct radeon_device *rdev) | |||
340 | WREG32(D1VGA_CONTROL, d1vga_control); | 340 | WREG32(D1VGA_CONTROL, d1vga_control); |
341 | WREG32(D2VGA_CONTROL, d2vga_control); | 341 | WREG32(D2VGA_CONTROL, d2vga_control); |
342 | WREG32(VGA_RENDER_CONTROL, vga_render_control); | 342 | WREG32(VGA_RENDER_CONTROL, vga_render_control); |
343 | |||
344 | /* we need to own VRAM, so turn off the VGA renderer here | ||
345 | * to stop it overwriting our objects */ | ||
346 | radeon_avivo_vga_render_disable(rdev); | ||
343 | } | 347 | } |
344 | 348 | ||
345 | int r600_mc_init(struct radeon_device *rdev) | 349 | int r600_mc_init(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 6af0331cae08..0e791e26def3 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "drmP.h" | 28 | #include "drmP.h" |
29 | #include "radeon_reg.h" | 29 | #include "radeon_reg.h" |
30 | #include "radeon.h" | 30 | #include "radeon.h" |
31 | #include "avivod.h" | ||
31 | 32 | ||
32 | #include "rs600_reg_safe.h" | 33 | #include "rs600_reg_safe.h" |
33 | 34 | ||
@@ -197,6 +198,8 @@ void rs600_mc_disable_clients(struct radeon_device *rdev) | |||
197 | "programming pipes. Bad things might happen.\n"); | 198 | "programming pipes. Bad things might happen.\n"); |
198 | } | 199 | } |
199 | 200 | ||
201 | radeon_avivo_vga_render_disable(rdev); | ||
202 | |||
200 | tmp = RREG32(AVIVO_D1VGA_CONTROL); | 203 | tmp = RREG32(AVIVO_D1VGA_CONTROL); |
201 | WREG32(AVIVO_D1VGA_CONTROL, tmp & ~AVIVO_DVGA_CONTROL_MODE_ENABLE); | 204 | WREG32(AVIVO_D1VGA_CONTROL, tmp & ~AVIVO_DVGA_CONTROL_MODE_ENABLE); |
202 | tmp = RREG32(AVIVO_D2VGA_CONTROL); | 205 | tmp = RREG32(AVIVO_D2VGA_CONTROL); |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 8bab6b4f05d1..47427623a84c 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -229,6 +229,10 @@ static void rv770_mc_resume(struct radeon_device *rdev) | |||
229 | WREG32(D1VGA_CONTROL, d1vga_control); | 229 | WREG32(D1VGA_CONTROL, d1vga_control); |
230 | WREG32(D2VGA_CONTROL, d2vga_control); | 230 | WREG32(D2VGA_CONTROL, d2vga_control); |
231 | WREG32(VGA_RENDER_CONTROL, vga_render_control); | 231 | WREG32(VGA_RENDER_CONTROL, vga_render_control); |
232 | |||
233 | /* we need to own VRAM, so turn off the VGA renderer here | ||
234 | * to stop it overwriting our objects */ | ||
235 | radeon_avivo_vga_render_disable(rdev); | ||
232 | } | 236 | } |
233 | 237 | ||
234 | 238 | ||