summaryrefslogtreecommitdiff
path: root/hw/xwayland/xwayland-glamor.c
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-03-28 14:12:53 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2023-04-03 11:46:15 +0200
commita4c700231dfbd20a7d48b64ff64e8cc40a6c22bc (patch)
tree72d67075f27438e2d37c33433ce6ea89f7bfb101 /hw/xwayland/xwayland-glamor.c
parent79ab129fdf28c4ef3468f078e46e920120c878b4 (diff)
xwayland: Check for implicit scanout availability
With implicit modifiers, DRM_FORMAT_MOD_INVALID is an allowed modifier, to indicate that the server can support the format. When looking for a scanout capable tranche with implicit modifiers, we ought to check for the availability of a tranche with an invalid modifier for the given format. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Diffstat (limited to 'hw/xwayland/xwayland-glamor.c')
-rw-r--r--hw/xwayland/xwayland-glamor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index db1434ffb..af227bb03 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -747,8 +747,16 @@ xwl_window_dmabuf_feedback_done(void *data,
struct zwp_linux_dmabuf_feedback_v1 *dmabuf_feedback)
{
struct xwl_window *xwl_window = data;
+ uint32_t format = wl_drm_format_for_depth(xwl_window->window->drawable.depth);
xwl_dmabuf_feedback_done(&xwl_window->feedback, dmabuf_feedback);
+
+ xwl_window->has_implicit_scanout_support =
+ xwl_feedback_is_modifier_supported(&xwl_window->feedback, format,
+ DRM_FORMAT_MOD_INVALID, TRUE);
+ DebugF("XWAYLAND: Window 0x%x can%s get implicit scanout support\n",
+ xwl_window->window->drawable.id,
+ xwl_window->has_implicit_scanout_support ? "" : "not");
}
static void