diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-04-17 09:35:39 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-04-22 10:39:09 -0400 |
commit | e884fc640ccbdb6f94b9bdb57cfb8464b6688f4c (patch) | |
tree | 090414175b00344c145e5d3b4de4874e8c855441 | |
parent | 968c01664ccbe0e46c19a1af662c4c266a904203 (diff) |
drm/radeon: disable the crtcs in mc_stop (r5xx-r7xx) (v2)
Just disabling the mem requests should be enough, but
that doesn't seem to work correctly on efi systems.
v2: blank displays first, then disable.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/gpu/drm/radeon/r500_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv515.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r500_reg.h b/drivers/gpu/drm/radeon/r500_reg.h index b52420902124..1dd0d32993d5 100644 --- a/drivers/gpu/drm/radeon/r500_reg.h +++ b/drivers/gpu/drm/radeon/r500_reg.h | |||
@@ -360,6 +360,7 @@ | |||
360 | 360 | ||
361 | #define AVIVO_D1MODE_MASTER_UPDATE_LOCK 0x60e0 | 361 | #define AVIVO_D1MODE_MASTER_UPDATE_LOCK 0x60e0 |
362 | #define AVIVO_D1MODE_MASTER_UPDATE_MODE 0x60e4 | 362 | #define AVIVO_D1MODE_MASTER_UPDATE_MODE 0x60e4 |
363 | #define AVIVO_D1CRTC_UPDATE_LOCK 0x60e8 | ||
363 | 364 | ||
364 | /* master controls */ | 365 | /* master controls */ |
365 | #define AVIVO_DC_CRTC_MASTER_EN 0x60f8 | 366 | #define AVIVO_DC_CRTC_MASTER_EN 0x60f8 |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 6a1e5dd5b5ee..ffcba730c57c 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -303,8 +303,10 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save) | |||
303 | tmp = RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i]); | 303 | tmp = RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i]); |
304 | if (!(tmp & AVIVO_CRTC_DISP_READ_REQUEST_DISABLE)) { | 304 | if (!(tmp & AVIVO_CRTC_DISP_READ_REQUEST_DISABLE)) { |
305 | radeon_wait_for_vblank(rdev, i); | 305 | radeon_wait_for_vblank(rdev, i); |
306 | WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 1); | ||
306 | tmp |= AVIVO_CRTC_DISP_READ_REQUEST_DISABLE; | 307 | tmp |= AVIVO_CRTC_DISP_READ_REQUEST_DISABLE; |
307 | WREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i], tmp); | 308 | WREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i], tmp); |
309 | WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 0); | ||
308 | } | 310 | } |
309 | /* wait for the next frame */ | 311 | /* wait for the next frame */ |
310 | frame_count = radeon_get_vblank_counter(rdev, i); | 312 | frame_count = radeon_get_vblank_counter(rdev, i); |
@@ -313,6 +315,15 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save) | |||
313 | break; | 315 | break; |
314 | udelay(1); | 316 | udelay(1); |
315 | } | 317 | } |
318 | |||
319 | /* XXX this is a hack to avoid strange behavior with EFI on certain systems */ | ||
320 | WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 1); | ||
321 | tmp = RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i]); | ||
322 | tmp &= ~AVIVO_CRTC_EN; | ||
323 | WREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i], tmp); | ||
324 | WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 0); | ||
325 | save->crtc_enabled[i] = false; | ||
326 | /* ***** */ | ||
316 | } else { | 327 | } else { |
317 | save->crtc_enabled[i] = false; | 328 | save->crtc_enabled[i] = false; |
318 | } | 329 | } |