diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/si.c')
-rw-r--r-- | drivers/gpu/drm/radeon/si.c | 23 |
1 files changed, 19 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: |