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

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

zink: handle modifier nplanes queries correctly for planar formats

this just returns the number of planes in the base format as a default, which
matches the behavior of other drivers

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>

---

 src/gallium/drivers/zink/zink_screen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_screen.c 
b/src/gallium/drivers/zink/zink_screen.c
index a3332c48b34..8e1b01abf28 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -2149,7 +2149,7 @@ zink_get_dmabuf_modifier_planes(struct pipe_screen 
*pscreen, uint64_t modifier,
    for (unsigned i = 0; i < 
screen->modifier_props[format].drmFormatModifierCount; i++)
       if 
(screen->modifier_props[format].pDrmFormatModifierProperties[i].drmFormatModifier
 == modifier)
          return 
screen->modifier_props[format].pDrmFormatModifierProperties[i].drmFormatModifierPlaneCount;
-   return 0;
+   return util_format_get_num_planes(format);
 }
 
 static int

Reply via email to