From 34055e7822b6cf2cceb3fcbeebf9d09ae3e2900c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 17 Jan 2023 14:45:48 -0500 Subject: [PATCH] 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: (cherry picked from commit 6ff334e54a2d3455a9c532b146b2fb77a757af02) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_screen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ad0e4c0ab01..3c3c8c6e7a7 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -211,7 +211,7 @@ "description": "zink: handle modifier nplanes queries correctly for planar formats", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 4f3002a422c..3a9399bb105 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -2104,7 +2104,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