Mesa (master): intel: Use tiling for dri2AllocateBuffer implementation

Kristian Høgsberg krh at kemper.freedesktop.org
Tue Apr 26 10:28:33 PDT 2011


Module: Mesa
Branch: master
Commit: 5dfba09d49ccec2655e4d22ef6f46b9c67862bc9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5dfba09d49ccec2655e4d22ef6f46b9c67862bc9

Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Mon Apr 25 09:53:22 2011 -0400

intel: Use tiling for dri2AllocateBuffer implementation

---

 src/mesa/drivers/dri/intel/intel_screen.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index bfbfec5..7de0d12 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -672,12 +672,21 @@ intelAllocateBuffer(__DRIscreen *screen,
 {
    struct intel_buffer *intelBuffer;
    struct intel_screen *intelScreen = screen->private;
+   uint32_t tiling;
 
    intelBuffer = CALLOC(sizeof *intelBuffer);
    if (intelBuffer == NULL)
       return NULL;
 
-   intelBuffer->region = intel_region_alloc(intelScreen, I915_TILING_NONE,
+   if ((attachment == __DRI_BUFFER_DEPTH ||
+	attachment == __DRI_BUFFER_STENCIL ||
+	attachment == __DRI_BUFFER_DEPTH_STENCIL) &&
+       intelScreen->gen >= 4)
+      tiling = I915_TILING_Y;
+   else
+      tiling = I915_TILING_X;
+
+   intelBuffer->region = intel_region_alloc(intelScreen, tiling,
 					    format / 8, width, height, GL_TRUE);
    
    if (intelBuffer->region == NULL) {



More information about the mesa-commit mailing list