[mutter] wayland/dma-buf: Don't require modifiers support for scanout tranche



commit f037c9df661098cb3190eceafc94d8811c3ecd95
Author: Dor Askayo <dor askayo gmail com>
Date:   Tue Jul 12 17:24:51 2022 +0300

    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>

 src/wayland/meta-wayland-dma-buf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 62a89b13e9..7af8a4b5c8 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -1020,7 +1020,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]