[Mesa-dev] [PATCH 13/32] i965: Handle X tiled modifier

Ben Widawsky ben at bwidawsk.net
Tue Jan 3 02:37:04 UTC 2017


This doesn't really "do" anything because the default tiling for the
winsys buffer is X tiled. We do however want the X tiled modifier to
work correctly from the API perspective, which would imply that if you
set this modifier, and later do a get_modifier, you get back at least X
tiled.

Cc: Kristian Høgsberg <krh at bitplanet.net>
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Acked-by: Daniel Stone <daniels at collabora.com>
---
 src/mesa/drivers/dri/i965/intel_screen.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index b867c28cae..2e0c992255 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -566,8 +566,13 @@ __intel_create_image(__DRIscreen *dri_screen,
    if (image == NULL)
       return NULL;
 
+   /* Prioritize the modifiers based on what we think will work best. */
    for (int i = 0; i < count; i++) {
       switch (modifiers[i]) {
+      case I915_FORMAT_MOD_X_TILED:
+         if (!image->modifier)
+            image->modifier = I915_FORMAT_MOD_X_TILED;
+         break;
       case I915_FORMAT_MOD_Y_TILED:
          image->modifier = I915_FORMAT_MOD_Y_TILED;
          break;
@@ -621,6 +626,9 @@ intel_create_image_with_modifiers(__DRIscreen *dri_screen,
    /* This compacts the actual modifiers to the ones we know how to handle */
    for (int i = 0; i < count; i++) {
       switch (modifiers[i]) {
+      case I915_FORMAT_MOD_X_TILED:
+         local_mods[local_count++] = I915_FORMAT_MOD_X_TILED;
+         break;
       case I915_FORMAT_MOD_Y_TILED:
          local_mods[local_count++] = I915_FORMAT_MOD_Y_TILED;
          break;
-- 
2.11.0



More information about the mesa-dev mailing list