zink: handle modifier nplanes queries correctly for planar formats
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 17 Jan 2023 19:45:48 +0000 (14:45 -0500)
committerEric Engestrom <eric@engestrom.ch>
Thu, 26 Jan 2023 15:40:32 +0000 (15:40 +0000)
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>
(cherry picked from commit 6ff334e54a2d3455a9c532b146b2fb77a757af02)

.pick_status.json
src/gallium/drivers/zink/zink_screen.c

index 6de3c56..dc70a22 100644 (file)
         "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
     },
index 3c4308c..452f48d 100644 (file)
@@ -2102,7 +2102,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