Mesa (staging/22.0): iris: Return a 64B stride for clear color plane

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 2 18:17:34 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: a1089e9fea2501b575e0fbf591398edd94184c4a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a1089e9fea2501b575e0fbf591398edd94184c4a

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Thu Apr 28 08:01:19 2022 -0700

iris: Return a 64B stride for clear color plane

Although modifiers which use a clear color plane specify that the
plane's pitch should be ignored, some kernels have been found to require
64-byte alignment.

Cc: mesa-stable
Fixes: db475c81b7c ("iris: Return non-zero stride for clear color plane")
Reported-by: Dongwon Kim <dongwon.kim at intel.com>
Suggested-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>
(cherry picked from commit 2bc8c61fd00b2877319f54afeaba3d606fd8532c)

---

 .pick_status.json                        | 2 +-
 src/gallium/drivers/iris/iris_resource.c | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index d87d5ab75f0..21a1e67dcd7 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1260,7 +1260,7 @@
         "description": "iris: Return a 64B stride for clear color plane",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": "db475c81b7cdde9d967b0216e6f12d17e0adae83"
     },
     {
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 4a420ba7b26..0a74bc4c213 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1605,14 +1605,18 @@ iris_resource_get_param(struct pipe_screen *pscreen,
       }
       return true;
    case PIPE_RESOURCE_PARAM_STRIDE:
-      *value = wants_cc ? 1 :
+      *value = wants_cc ? 64 :
                wants_aux ? res->aux.surf.row_pitch_B : res->surf.row_pitch_B;
 
       /* Mesa's implementation of eglCreateImage rejects strides of zero (see
        * dri2_check_dma_buf_attribs). Ensure we return a non-zero stride as
        * this value may be queried from GBM and passed into EGL.
+       *
+       * Also, although modifiers which use a clear color plane specify that
+       * the plane's pitch should be ignored, some kernels have been found to
+       * require 64-byte alignment.
        */
-      assert(*value);
+      assert(*value != 0 && *value % 64 == 0);
 
       return true;
    case PIPE_RESOURCE_PARAM_OFFSET:



More information about the mesa-commit mailing list