[PATCH] radeon: r200 depth buffers are always tiled

Dave Airlie airlied at gmail.com
Mon Dec 5 10:46:42 PST 2011


From: Dave Airlie <airlied at redhat.com>

When we do the allocations we need to make sure the always tiled
nature is taken into account.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/radeon.h      |    1 +
 src/radeon_dri2.c |    8 ++++++++
 src/radeon_exa.c  |    3 +++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/radeon.h b/src/radeon.h
index 34f6f53..91c7b62 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -1667,6 +1667,7 @@ static __inline__ int radeon_timedout(const struct timeval *endtime)
 enum {
     RADEON_CREATE_PIXMAP_TILING_MACRO = 0x10000000,
     RADEON_CREATE_PIXMAP_TILING_MICRO = 0x20000000,
+    RADEON_CREATE_PIXMAP_DEPTH = 0x40000000, /* for r200 */
 };
 
 #endif /* _RADEON_H_ */
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 8789d73..9fd3658 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -121,6 +121,8 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
 		    flags = RADEON_CREATE_PIXMAP_TILING_MICRO;
 		else
 		    flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
+		if (IS_R200_3D)
+		    flags |= RADEON_CREATE_PIXMAP_DEPTH;
 		break;
 	    case DRI2BufferDepthStencil:
 		if (info->ChipFamily >= CHIP_FAMILY_R600) {
@@ -132,6 +134,8 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
 			need_enlarge = 1;
 		} else
 		    flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
+		if (IS_R200_3D)
+		    flags |= RADEON_CREATE_PIXMAP_DEPTH;
 		break;
 	    case DRI2BufferBackLeft:
 	    case DRI2BufferBackRight:
@@ -271,6 +275,8 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
 		flags = RADEON_CREATE_PIXMAP_TILING_MICRO;
 	    else
 		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
+	    if (IS_R200_3D)
+		flags |= RADEON_CREATE_PIXMAP_DEPTH;
 	    break;
 	case DRI2BufferDepthStencil:
 	    /* macro is the preferred setting, but the 2D detiling for software
@@ -282,6 +288,8 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
 		    need_enlarge = 1;
 	    } else
 		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
+	    if (IS_R200_3D)
+		flags |= RADEON_CREATE_PIXMAP_DEPTH;
 	    break;
 	case DRI2BufferBackLeft:
 	case DRI2BufferBackRight:
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index f3daec0..95646ab 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -473,6 +473,9 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height,
     	    if (usage_hint & RADEON_CREATE_PIXMAP_TILING_MICRO)
                 tiling |= RADEON_TILING_MICRO;
 	}
+	if ((usage_hint & RADEON_CREATE_PIXMAP_DEPTH) && IS_R200_3D)
+ 	   	tiling |= RADEON_TILING_MACRO | RADEON_TILING_MICRO;
+		
     }
 
     /* Small pixmaps must not be macrotiled on R300, hw cannot sample them
-- 
1.7.6.4



More information about the xorg-driver-ati mailing list