[Mesa-dev] [PATCH 21/34] i965: Support all known modifiers

Ben Widawsky ben at bwidawsk.net
Tue Jan 24 06:21:44 UTC 2017


This patch adds support for handling X tiled modifier. This isn't
particularly useful but it makes our code complete.

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 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 8c46a62529..451c5ccf4e 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -604,21 +604,24 @@ create_image_with_modifier(struct intel_screen *screen,
                              __DRIimage *image, uint64_t modifier,
                              int width, int height, int cpp)
 {
-   uint32_t tiling = I915_TILING_X;
+   uint32_t requested_tiling = 0, tiling = I915_TILING_X;
    unsigned long pitch;
 
    switch (modifier) {
    case I915_FORMAT_MOD_Y_TILED:
-      tiling = I915_TILING_Y;
+      requested_tiling = tiling = I915_TILING_Y;
       break;
    case I915_FORMAT_MOD_X_TILED:
       assert(tiling == I915_TILING_X);
+      requested_tiling = tiling = I915_TILING_X;
       break;
    case DRM_FORMAT_MOD_LINEAR:
-      tiling = I915_TILING_NONE;
+      requested_tiling = tiling = I915_TILING_NONE;
       break;
    case DRM_FORMAT_MOD_INVALID:
+      break;
    default:
+      unreachable("Unknown modifier");
       break;
    }
 
@@ -628,7 +631,7 @@ create_image_with_modifier(struct intel_screen *screen,
    if (image->bo == NULL)
       return false;
 
-   if (tiling != I915_TILING_Y) {
+   if (tiling != requested_tiling) {
       drm_intel_bo_unreference(image->bo);
       return false;
    }
-- 
2.11.0



More information about the mesa-dev mailing list