[PATCH 2/2] drm/radeon/kms/blit: workaround for a possible hardware bug

Ilija Hadzic ihadzic at research.bell-labs.com
Wed Feb 1 08:42:39 PST 2012


If a blit copy operation specifies a rectangle whose one dimension
is 16384 (max allowed by these chips), the chip will silently
drop all commands. Fixed by reducing the maximum dimension by
one rectangle unit size. In the mainline kernel, the problem is
exposed only when buffers are very large (1G), but it's still
a problem. The problem *could* be exposed for smaller buffers
if anyone modifies the algorithm for rectangle construction
in r600_blit_create_rect() (the reason why someone would modify
that algorithm is to tune the performance of buffer moves).

Signed-off-by: Ilija Hadzic <ihadzic at research.bell-labs.com>
---
 drivers/gpu/drm/radeon/evergreen_blit_kms.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
index 4e83fdc..24abdf4 100644
--- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c
+++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
@@ -631,7 +631,8 @@ int evergreen_blit_init(struct radeon_device *rdev)
 	if (rdev->family >= CHIP_CAYMAN)
 		rdev->r600_blit.ring_size_per_loop += 9; /* additional DWs for surface sync */
 
-	rdev->r600_blit.max_dim = 16384;
+	/* Evergreen/NI bug: max dimension 16384 is broken for blit copy */
+	rdev->r600_blit.max_dim = 16384 - RECT_UNIT_H;
 
 	/* pin copy shader into vram if already initialized */
 	if (rdev->r600_blit.shader_obj)
-- 
1.7.7



More information about the dri-devel mailing list