Commit 698443d9 authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
parent 5e6dde7e
...@@ -57,4 +57,13 @@ ...@@ -57,4 +57,13 @@
#define VGA_RENDER_CONTROL 0x0300 #define VGA_RENDER_CONTROL 0x0300
#define VGA_VSTATUS_CNTL_MASK 0x00030000 #define VGA_VSTATUS_CNTL_MASK 0x00030000
/* AVIVO disable VGA rendering */
static inline void radeon_avivo_vga_render_disable(struct radeon_device *rdev)
{
u32 vga_render;
vga_render = RREG32(VGA_RENDER_CONTROL);
vga_render &= ~VGA_VSTATUS_CNTL_MASK;
WREG32(VGA_RENDER_CONTROL, vga_render);
}
#endif #endif
...@@ -340,6 +340,10 @@ static void r600_mc_resume(struct radeon_device *rdev) ...@@ -340,6 +340,10 @@ static void r600_mc_resume(struct radeon_device *rdev)
WREG32(D1VGA_CONTROL, d1vga_control); WREG32(D1VGA_CONTROL, d1vga_control);
WREG32(D2VGA_CONTROL, d2vga_control); WREG32(D2VGA_CONTROL, d2vga_control);
WREG32(VGA_RENDER_CONTROL, vga_render_control); WREG32(VGA_RENDER_CONTROL, vga_render_control);
/* we need to own VRAM, so turn off the VGA renderer here
* to stop it overwriting our objects */
radeon_avivo_vga_render_disable(rdev);
} }
int r600_mc_init(struct radeon_device *rdev) int r600_mc_init(struct radeon_device *rdev)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "drmP.h" #include "drmP.h"
#include "radeon_reg.h" #include "radeon_reg.h"
#include "radeon.h" #include "radeon.h"
#include "avivod.h"
#include "rs600_reg_safe.h" #include "rs600_reg_safe.h"
...@@ -197,6 +198,8 @@ void rs600_mc_disable_clients(struct radeon_device *rdev) ...@@ -197,6 +198,8 @@ void rs600_mc_disable_clients(struct radeon_device *rdev)
"programming pipes. Bad things might happen.\n"); "programming pipes. Bad things might happen.\n");
} }
radeon_avivo_vga_render_disable(rdev);
tmp = RREG32(AVIVO_D1VGA_CONTROL); tmp = RREG32(AVIVO_D1VGA_CONTROL);
WREG32(AVIVO_D1VGA_CONTROL, tmp & ~AVIVO_DVGA_CONTROL_MODE_ENABLE); WREG32(AVIVO_D1VGA_CONTROL, tmp & ~AVIVO_DVGA_CONTROL_MODE_ENABLE);
tmp = RREG32(AVIVO_D2VGA_CONTROL); tmp = RREG32(AVIVO_D2VGA_CONTROL);
......
...@@ -229,6 +229,10 @@ static void rv770_mc_resume(struct radeon_device *rdev) ...@@ -229,6 +229,10 @@ static void rv770_mc_resume(struct radeon_device *rdev)
WREG32(D1VGA_CONTROL, d1vga_control); WREG32(D1VGA_CONTROL, d1vga_control);
WREG32(D2VGA_CONTROL, d2vga_control); WREG32(D2VGA_CONTROL, d2vga_control);
WREG32(VGA_RENDER_CONTROL, vga_render_control); WREG32(VGA_RENDER_CONTROL, vga_render_control);
/* we need to own VRAM, so turn off the VGA renderer here
* to stop it overwriting our objects */
radeon_avivo_vga_render_disable(rdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment