[Mesa-dev] [PATCH 12/27] i965: Bring back always Y-tiled on SKL+

Ben Widawsky benjamin.widawsky at intel.com
Thu Dec 1 22:09:53 UTC 2016


From: Ben Widawsky <ben at bwidawsk.net>

commit 6a0d036483caf87d43ebe2edd1905873446c9589
Author: Ben Widawsky <ben at bwidawsk.net>
Date:   Thu Apr 21 20:14:58 2016 -0700

    i965: Always use Y-tiled buffers on SKL+

Aside from the benchmark gains that were initially posted, I was able to
collect memory bandwidth data running kmscube (19x12 display).

bwidawsk at norris2:~/intel-gfx/kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube none
Read bandwidth: 603.37 MiB/s
Write bandwidth: 619.20 MiB/s
bwidawsk at norris2:~/intel-gfx/kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube ytile
Read bandwidth: 572.56 MiB/s
Write bandwidth: 556.95 MiB/s

v2: Use new modifier mechanism, and expose new DRIimage version

Signed-off-by: Ben Widawsky <benjamin.widawsky at intel.com>
---
 src/mesa/drivers/dri/i965/intel_screen.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index afe3189..d81524f 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -559,6 +559,14 @@ __intel_create_image(__DRIscreen *dri_screen,
    for (int i = 0; i < count; i++) {
       switch (modifiers[i]) {
       case I915_FORMAT_MOD_Y_TILED:
+         /* Kernel provides no way to query support for this. Assume GEN check
+          * is enough :/
+          */
+         if (screen->devinfo.gen < 9) {
+            _mesa_warning(NULL, "Invalid Y-tiling parameter\n");
+            continue;
+         }
+
          image->modifier = I915_FORMAT_MOD_Y_TILED;
          break;
       }
@@ -573,6 +581,11 @@ __intel_create_image(__DRIscreen *dri_screen,
    if (use & __DRI_IMAGE_USE_LINEAR)
       tiling = I915_TILING_NONE;
 
+   if (image->modifier == I915_FORMAT_MOD_Y_TILED) {
+      assert(tiling != I915_TILING_NONE);
+      tiling = I915_TILING_Y;
+   }
+
    cpp = _mesa_get_format_bytes(image->format);
    image->bo = drm_intel_bo_alloc_tiled(screen->bufmgr, "image",
                                         width, height, cpp, &tiling,
@@ -584,6 +597,7 @@ __intel_create_image(__DRIscreen *dri_screen,
    image->width = width;
    image->height = height;
    image->pitch = pitch;
+   image->tile_y = tiling == I915_TILING_Y;
 
    return image;
 }
@@ -901,7 +915,7 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
 }
 
 static const __DRIimageExtension intelImageExtension = {
-    .base = { __DRI_IMAGE, 13 },
+    .base = { __DRI_IMAGE, 14 },
 
     .createImageFromName                = intel_create_image_from_name,
     .createImageFromRenderbuffer        = intel_create_image_from_renderbuffer,
@@ -1776,7 +1790,13 @@ intelAllocateBuffer(__DRIscreen *dri_screen,
       return NULL;
 
    /* The front and back buffers are color buffers, which are X tiled. */
-   uint32_t tiling = I915_TILING_X;
+   uint32_t tiling;
+   if (screen->devinfo.gen >= 9) {
+      tiling = I915_TILING_Y;
+   } else {
+      tiling = I915_TILING_X;
+   }
+
    unsigned long pitch;
    int cpp = format / 8;
    intelBuffer->bo = drm_intel_bo_alloc_tiled(screen->bufmgr,
-- 
2.10.2



More information about the mesa-dev mailing list