[PATCH 2/2] DRI2/r[345]xx: 16 bit depth buffers use square micro tiling.

Michel Dänzer michel at daenzer.net
Thu Jan 10 08:04:04 PST 2013


From: Michel Dänzer <michel.daenzer at amd.com>

Fixes piglit sanity.tests (with 3D drivers which allocate depth buffers from
the X server).

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

Tested on RV350.

 src/drmmode_display.c |  4 +++-
 src/radeon.h          |  1 +
 src/radeon_dri2.c     | 10 ++++++++--
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index aade98f..e4757ad 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1205,7 +1205,9 @@ int drmmode_get_height_align(ScrnInfoPtr scrn, uint32_t tiling)
 		else
 			height_align = 8;
 	} else {
-		if (tiling)
+		if (tiling & RADEON_TILING_MICRO_SQUARE)
+			height_align =  32;
+		else if (tiling)
 			height_align = 16;
 		else
 			height_align = 1;
diff --git a/src/radeon.h b/src/radeon.h
index ad50d5d..f986347 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -775,6 +775,7 @@ enum {
     RADEON_CREATE_PIXMAP_TILING_MICRO = 0x20000000,
     RADEON_CREATE_PIXMAP_DEPTH = 0x40000000, /* for r200 */
     RADEON_CREATE_PIXMAP_SZBUFFER = 0x80000000, /* for eg */
+    RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE = 0x8000000,
 };
 
 
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 36a44e4..443d908 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -221,7 +221,9 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 		}
 		if (info->ChipFamily >= CHIP_FAMILY_CEDAR)
 		    flags |= RADEON_CREATE_PIXMAP_SZBUFFER;
-	    } else
+	    } else if (cpp == 2 && info->ChipFamily >= CHIP_FAMILY_R300)
+		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE;
+	    else
 		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
 	    if (IS_R200_3D || info->ChipFamily == CHIP_FAMILY_RV200 || info->ChipFamily == CHIP_FAMILY_RADEON)
 		flags |= RADEON_CREATE_PIXMAP_DEPTH;
@@ -238,7 +240,9 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 		}
 		if (info->ChipFamily >= CHIP_FAMILY_CEDAR)
 		    flags |= RADEON_CREATE_PIXMAP_SZBUFFER;
-	    } else
+	    } else if (cpp == 2 && info->ChipFamily >= CHIP_FAMILY_R300)
+		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE;
+	    else
 		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
 	    if (IS_R200_3D || info->ChipFamily == CHIP_FAMILY_RV200 || info->ChipFamily == CHIP_FAMILY_RADEON)
 		flags |= RADEON_CREATE_PIXMAP_DEPTH;
@@ -265,6 +269,8 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 
 	if (flags & RADEON_CREATE_PIXMAP_TILING_MICRO)
 	    tiling |= RADEON_TILING_MICRO;
+	if (flags & RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE)
+	    tiling |= RADEON_TILING_MICRO_SQUARE;
 	if (flags & RADEON_CREATE_PIXMAP_TILING_MACRO)
 	    tiling |= RADEON_TILING_MACRO;
 
-- 
1.8.1



More information about the xorg-driver-ati mailing list