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

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Jan 17 14:43:51 2023 -0500

zink: store drm format as internal_format for imported resources

internal_format is the "real" format of a resource, and the "real" format
of imported resources is the external-facing format, not the pipe format

this ensures the correct format is available for internal ops, such as nplanes 
queries

Fixes: 2e2775c11b0 ("zink: fix PIPE_RESOURCE_PARAM_NPLANES with format 
modifier")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>
(cherry picked from commit 072e29a22e2cd3c738a3bee463f6aebd40159966)

---

 .pick_status.json                        | 2 +-
 src/gallium/drivers/zink/zink_resource.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 1b15c943a39..217410e8473 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1075,7 +1075,7 @@
         "description": "zink: store drm format as internal_format for imported 
resources",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "2e2775c11b0d17472afd53b1398a3af7d9086a75"
     },
diff --git a/src/gallium/drivers/zink/zink_resource.c 
b/src/gallium/drivers/zink/zink_resource.c
index a5b52930c3a..c0d7dcef2da 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -1541,6 +1541,7 @@ zink_resource_from_handle(struct pipe_screen *pscreen,
          res->valid = true;
       else
          tc_buffer_disable_cpu_storage(pres);
+      res->internal_format = whandle->format;
    }
    return pres;
 #else

Reply via email to