summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2022-04-28 08:01:19 -0700
committerMarge Bot <emma+marge@anholt.net>2022-04-28 20:02:14 +0000
commit2bc8c61fd00b2877319f54afeaba3d606fd8532c (patch)
tree292802b8b1a6a5b7451bb8f846af2fd21a60d5a7
parenta1277311195b5ebced72803d6235d547b15c9418 (diff)
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@intel.com> Suggested-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>
-rw-r--r--src/gallium/drivers/iris/iris_resource.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index b5a80c62fa4..ed974a8b021 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1625,14 +1625,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: