Re: [PATCH] drm: fix to radeon driver for HD 6450

From: Alex Deucher
Date: Sat Jan 26 2013 - 11:18:48 EST


On Fri, Jan 25, 2013 at 1:10 PM, Chris Staite <chris@xxxxxxxxxxxxxxxxxx> wrote:
> From: Christopher Staite <chris@xxxxxxxxxxxxxxxxxx>
>
> Fix commit 62444b7462a2b98bc78d68736c03a7c4e66ba7e2 for HD 6450. The stop and resume causes the screen to glitch and the X server to reboot constantly. Re-instating the UPDATE_LOCK fixes the issue in tests on the v3.6.11 stable, and the code has not been altered to fix this since.
>
> Signed-off-by: Christopher Staite <chris@xxxxxxxxxxxxxxxxxx>
>

Looks good. I've updated the patch to handle the DCE6 case and
improved the commit message. I'll go ahead and add it to my next
-fixes pull.

Thanks,

Alex

>
>
> --- drivers/gpu/drm/radeon/evergreen.c.org 2013-01-25 17:45:06.000000000 +0000
> +++ drivers/gpu/drm/radeon/evergreen.c 2013-01-25 17:48:14.000000000 +0000
> @@ -1320,7 +1320,9 @@ void evergreen_mc_stop(struct radeon_dev
> if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) {
> radeon_wait_for_vblank(rdev, i);
> tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
> + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
> WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
> + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
> }
> }
> /* wait for the next frame */
> @@ -1382,7 +1384,9 @@ void evergreen_mc_resume(struct radeon_d
> } else {
> tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
> tmp &= ~EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
> + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
> WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
> + WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
> }
> /* wait for the next frame */
> frame_count = radeon_get_vblank_counter(rdev, i);
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
From 253307c1ca7ccf0ba9dec18c129e0030e05d6ebb Mon Sep 17 00:00:00 2001
From: Christopher Staite <chris@xxxxxxxxxxxxxxxxxx>
Date: Sat, 26 Jan 2013 11:10:58 -0500
Subject: [PATCH] drm/radeon: fix MC blackout on evergreen+

Force the crtc mem requests on/off immediately rather
than waiting for the double buffered updates to kick in.
Seems we miss the update in certain conditions. Also
handle the DCE6 case.

Signed-off-by: Christopher Staite <chris@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
---
drivers/gpu/drm/radeon/evergreen.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 4d0e60a..112da9b 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -1313,14 +1313,18 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) {
radeon_wait_for_vblank(rdev, i);
tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
}
} else {
tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) {
radeon_wait_for_vblank(rdev, i);
tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
}
}
/* wait for the next frame */
@@ -1378,11 +1382,15 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s
if (ASIC_IS_DCE6(rdev)) {
tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]);
tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
} else {
tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
tmp &= ~EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
+ WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
}
/* wait for the next frame */
frame_count = radeon_get_vblank_counter(rdev, i);
--
1.7.7.5