Mesa (staging/19.2): iris: Report correct number of planes for planar images
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Sep 4 23:32:18 UTC 2019
Module: Mesa
Branch: staging/19.2
Commit: 45b22fb873c032524508755a682ba32b6bc07e71
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=45b22fb873c032524508755a682ba32b6bc07e71
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Aug 28 12:52:23 2019 -0700
iris: Report correct number of planes for planar images
We were only handling the modifiers case and not counting the number of
planes in actual planar images.
Fixes Piglit's ext_image_dma_buf_import-export.
Fixes: fc12fd05f56 ("iris: Implement pipe_screen::resource_get_param")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111509
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
(cherry picked from commit f8887909c6683986990474b61afd6d4335a69e41)
---
src/gallium/drivers/iris/iris_resource.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index a8d0291862e..341375822d4 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1040,7 +1040,14 @@ iris_resource_get_param(struct pipe_screen *screen,
switch (param) {
case PIPE_RESOURCE_PARAM_NPLANES:
- *value = mod_with_aux ? 2 : 1;
+ if (mod_with_aux) {
+ *value = 2;
+ } else {
+ unsigned count = 0;
+ for (struct pipe_resource *cur = resource; cur; cur = cur->next)
+ count++;
+ *value = count;
+ }
return true;
case PIPE_RESOURCE_PARAM_STRIDE:
*value = wants_aux ? res->aux.surf.row_pitch_B : res->surf.row_pitch_B;
More information about the mesa-commit
mailing list