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>
This commit is contained in:
Olivier Fourdan 2023-03-28 14:12:53 +02:00
parent 79ab129fdf
commit a4c700231d
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -119,6 +119,8 @@ struct xwl_window {
#endif
struct xwayland_surface_v1 *xwayland_surface;
struct xwl_dmabuf_feedback feedback;
/* If TRUE, the window buffer format supports scanout with implicit modifier */
Bool has_implicit_scanout_support;
};
struct xwl_window *xwl_window_get(WindowPtr window);