summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDor Askayo <dor.askayo@gmail.com>2022-07-12 17:24:51 +0300
committerRobert Mader <robert.mader@collabora.com>2022-08-02 17:46:46 +0200
commit91ac40448f231155ff91f40b5333a32fe3b9d884 (patch)
tree6e3236250f038f09c3447a684f723081b0bbca25
parent501a2ffe750a80485deb36d47ac0f7d9d9ca0ea3 (diff)
downloadmutter-91ac40448f231155ff91f40b5333a32fe3b9d884.tar.gz
wayland/dma-buf: Don't require modifiers support for scanout tranche
When building the list of formats to be sent as part of the scanout tranche, avoid requiring modifier support by the DRM driver for formats relying on implicit modifiers (DRM_FORMAT_MOD_INVALID). Specifically, the previous check required the DRM driver to have advertised some modifier support for the given format in its IN_FORMATS KMS plane property, regardless of modifier it was. If it hadn't, the format was left out of the list of formats to be sent in the scanout tranche. When no formats remained to be sent in the scanout tranche, the tranche simply wasn't sent. This resulted in the scanout tranche never being sent for GPUs where modifiers aren't supported. In those cases, no formats are advertised using the IN_FORMATS property, and thus the list of formats to be sent in the scanout tranche remained empty. Since Mesa doesn't use scanout-compatible buffers for native Wayland clients unless specifically requested to do so using the "scanout" tranche flag, it effectively means that direct scanout of native Wayland clients wasn't supported for GPUs without modifiers support. Sending a tranche with formats paired with the implicit modifier (DRM_FORMAT_MOD_INVALID) is both allowed by the protocol and is already done by default for GPUs with modifiers support, unless the experimental support for explicit modifiers is enabled in Mutter. So instead of requiring modifiers to be supported for each format being evaluated for the scanout tranche, when processing formats which rely on implicit modifiers, only check if the format in question is supported by the DRM driver for scanout on the primary plane. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2510> (cherry picked from commit f037c9df661098cb3190eceafc94d8811c3ecd95)
-rw-r--r--src/wayland/meta-wayland-dma-buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 77d37dfb9..9b708abd3 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -1024,7 +1024,7 @@ ensure_scanout_tranche (MetaWaylandDmaBufSurfaceFeedback *surface_feedback,
if (format.drm_modifier != DRM_FORMAT_MOD_INVALID)
continue;
- if (!meta_crtc_kms_get_modifiers (crtc_kms, format.drm_format))
+ if (!meta_crtc_kms_supports_format (crtc_kms, format.drm_format))
continue;
g_array_append_val (formats, format);