[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.6 / 0031-drm-radeon-Set-DESKTOP_HEIGHT-register-to-the-frameb.patch
1 From 97f2f58ea0382e2e2df0dacc5bba99190cd10846 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
3 Date: Wed, 1 Feb 2012 12:09:55 +0100
4 Subject: [PATCH 31/87] drm/radeon: Set DESKTOP_HEIGHT register to the
5 framebuffer (not mode) height.
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 commit 1b61925061660009f5b8047f93c5297e04541273 upstream.
12 The value of this register is transferred to the V_COUNTER register at the
13 beginning of vertical blank. V_COUNTER is the reference for VLINE waits and
14 goes from VIEWPORT_Y_START to VIEWPORT_Y_START+VIEWPORT_HEIGHT during scanout,
15 so if VIEWPORT_Y_START is not 0, V_COUNTER actually went backwards at the
16 beginning of vertical blank, and VLINE waits excluding the whole scanout area
17 could never finish (possibly only if VIEWPORT_Y_START is larger than the length
18 of vertical blank in scanlines). Setting DESKTOP_HEIGHT to the framebuffer
19 height should prevent this for any kind of VLINE wait.
21 Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45329 .
23 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
24 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
25 Signed-off-by: Dave Airlie <airlied@redhat.com>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 ---
28 drivers/gpu/drm/radeon/atombios_crtc.c | 4 ++--
29 1 files changed, 2 insertions(+), 2 deletions(-)
31 diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
32 index 2b97262..b30081f 100644
33 --- a/drivers/gpu/drm/radeon/atombios_crtc.c
34 +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
35 @@ -1189,7 +1189,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
36 WREG32(EVERGREEN_GRPH_ENABLE + radeon_crtc->crtc_offset, 1);
38 WREG32(EVERGREEN_DESKTOP_HEIGHT + radeon_crtc->crtc_offset,
39 - crtc->mode.vdisplay);
40 + target_fb->height);
41 x &= ~3;
42 y &= ~1;
43 WREG32(EVERGREEN_VIEWPORT_START + radeon_crtc->crtc_offset,
44 @@ -1358,7 +1358,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
45 WREG32(AVIVO_D1GRPH_ENABLE + radeon_crtc->crtc_offset, 1);
47 WREG32(AVIVO_D1MODE_DESKTOP_HEIGHT + radeon_crtc->crtc_offset,
48 - crtc->mode.vdisplay);
49 + target_fb->height);
50 x &= ~3;
51 y &= ~1;
52 WREG32(AVIVO_D1MODE_VIEWPORT_START + radeon_crtc->crtc_offset,
53 --
54 1.7.7.4