Mesa (main): zink: fix dmabuf plane layout struct scoping

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jun 4 01:26:46 UTC 2022


Module: Mesa
Branch: main
Commit: c57fa8b390414f93ca24b027c708c5f854eafcf2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c57fa8b390414f93ca24b027c708c5f854eafcf2

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jun  1 14:12:16 2022 -0400

zink: fix dmabuf plane layout struct scoping

this struct needs to exist for all the scopes it's used in

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16822>

---

 src/gallium/drivers/zink/zink_resource.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index b144ab49d4f..aef7e727486 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -624,6 +624,13 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
       VkExternalMemoryImageCreateInfo emici;
       VkImageDrmFormatModifierExplicitCreateInfoEXT idfmeci;
       VkImageDrmFormatModifierListCreateInfoEXT idfmlci;
+      VkSubresourceLayout plane_layout = {
+         .offset = whandle ? whandle->offset : 0,
+         .size = 0,
+         .rowPitch = whandle ? whandle->stride : 0,
+         .arrayPitch = 0,
+         .depthPitch = 0,
+      };
       if (!success)
          goto fail1;
 
@@ -643,13 +650,6 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
             idfmeci.drmFormatModifier = mod;
 
             idfmeci.drmFormatModifierPlaneCount = 1;
-            VkSubresourceLayout plane_layout = {
-               .offset = whandle->offset,
-               .size = 0,
-               .rowPitch = whandle->stride,
-               .arrayPitch = 0,
-               .depthPitch = 0,
-            };
             idfmeci.pPlaneLayouts = &plane_layout;
 
             ici.pNext = &idfmeci;



More information about the mesa-commit mailing list