aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-08-19 11:15:43 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-08-30 16:31:01 -0400
commit290d24576ccf1aa0373d2185cedfe262d0d4952a (patch)
treea813201864119a4d235568a5537658167b167c9c /drivers/gpu
parent0b31e02363b0db4e7931561bc6c141436e729d9f (diff)
drm/radeon: update line buffer allocation for dce6
We need to allocate line buffer to each display when setting up the watermarks. Failure to do so can lead to a blank screen. This fixes blank screen problems on dce6 asics. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=64850 Based on an initial fix from: Jay Cornwall <jay.cornwall@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/si.c23
-rw-r--r--drivers/gpu/drm/radeon/sid.h4
2 files changed, 23 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 0b4e979b2cbf..89393ed593fa 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -1711,7 +1711,8 @@ static u32 dce6_line_buffer_adjust(struct radeon_device *rdev,
1711 struct drm_display_mode *mode, 1711 struct drm_display_mode *mode,
1712 struct drm_display_mode *other_mode) 1712 struct drm_display_mode *other_mode)
1713{ 1713{
1714 u32 tmp; 1714 u32 tmp, buffer_alloc, i;
1715 u32 pipe_offset = radeon_crtc->crtc_id * 0x20;
1715 /* 1716 /*
1716 * Line Buffer Setup 1717 * Line Buffer Setup
1717 * There are 3 line buffers, each one shared by 2 display controllers. 1718 * There are 3 line buffers, each one shared by 2 display controllers.
@@ -1726,16 +1727,30 @@ static u32 dce6_line_buffer_adjust(struct radeon_device *rdev,
1726 * non-linked crtcs for maximum line buffer allocation. 1727 * non-linked crtcs for maximum line buffer allocation.
1727 */ 1728 */
1728 if (radeon_crtc->base.enabled && mode) { 1729 if (radeon_crtc->base.enabled && mode) {
1729 if (other_mode) 1730 if (other_mode) {
1730 tmp = 0; /* 1/2 */ 1731 tmp = 0; /* 1/2 */
1731 else 1732 buffer_alloc = 1;
1733 } else {
1732 tmp = 2; /* whole */ 1734 tmp = 2; /* whole */
1733 } else 1735 buffer_alloc = 2;
1736 }
1737 } else {
1734 tmp = 0; 1738 tmp = 0;
1739 buffer_alloc = 0;
1740 }
1735 1741
1736 WREG32(DC_LB_MEMORY_SPLIT + radeon_crtc->crtc_offset, 1742 WREG32(DC_LB_MEMORY_SPLIT + radeon_crtc->crtc_offset,
1737 DC_LB_MEMORY_CONFIG(tmp)); 1743 DC_LB_MEMORY_CONFIG(tmp));
1738 1744
1745 WREG32(PIPE0_DMIF_BUFFER_CONTROL + pipe_offset,
1746 DMIF_BUFFERS_ALLOCATED(buffer_alloc));
1747 for (i = 0; i < rdev->usec_timeout; i++) {
1748 if (RREG32(PIPE0_DMIF_BUFFER_CONTROL + pipe_offset) &
1749 DMIF_BUFFERS_ALLOCATED_COMPLETED)
1750 break;
1751 udelay(1);
1752 }
1753
1739 if (radeon_crtc->base.enabled && mode) { 1754 if (radeon_crtc->base.enabled && mode) {
1740 switch (tmp) { 1755 switch (tmp) {
1741 case 0: 1756 case 0:
diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h
index 91dae16fddc4..52d2ab6b67a0 100644
--- a/drivers/gpu/drm/radeon/sid.h
+++ b/drivers/gpu/drm/radeon/sid.h
@@ -282,6 +282,10 @@
282 282
283#define DMIF_ADDR_CALC 0xC00 283#define DMIF_ADDR_CALC 0xC00
284 284
285#define PIPE0_DMIF_BUFFER_CONTROL 0x0ca0
286# define DMIF_BUFFERS_ALLOCATED(x) ((x) << 0)
287# define DMIF_BUFFERS_ALLOCATED_COMPLETED (1 << 4)
288
285#define SRBM_STATUS 0xE50 289#define SRBM_STATUS 0xE50
286#define GRBM_RQ_PENDING (1 << 5) 290#define GRBM_RQ_PENDING (1 << 5)
287#define VMC_BUSY (1 << 8) 291#define VMC_BUSY (1 << 8)