summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-03-28 14:18:36 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2023-04-03 11:46:15 +0200
commit79ab129fdf28c4ef3468f078e46e920120c878b4 (patch)
treee73e7ec6f58b414eeb55c936b35ac412cf714e10
parent1a0cc25d488dee3c5972d9f0828d5eadfcdbe713 (diff)
downloadxserver-79ab129fdf28c4ef3468f078e46e920120c878b4.tar.gz
xwayland: Check for scanout support in tranches
The helper function xwl_feedback_is_modifier_supported() walks all the formats of a feeedback tranche and checks for format/modifier support availability. Add scanout support to that so that a caller can easily restrict the tranches to those which support scanout. This is preparation work for the implicit scanout support, no functional change. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
-rw-r--r--hw/xwayland/xwayland-glamor.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index 1552834a7..db1434ffb 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -124,11 +124,15 @@ xwl_glamor_is_modifier_supported_in_formats(struct xwl_format *formats, int num_
static Bool
xwl_feedback_is_modifier_supported(struct xwl_dmabuf_feedback *xwl_feedback,
- uint32_t format, uint64_t modifier)
+ uint32_t format, uint64_t modifier,
+ int supports_scanout)
{
for (int i = 0; i < xwl_feedback->dev_formats_len; i++) {
struct xwl_device_formats *dev_formats = &xwl_feedback->dev_formats[i];
+ if (supports_scanout && !dev_formats->supports_scanout)
+ continue;
+
if (xwl_glamor_is_modifier_supported_in_formats(dev_formats->formats,
dev_formats->num_formats,
format, modifier))
@@ -157,11 +161,11 @@ xwl_glamor_is_modifier_supported(struct xwl_screen *xwl_screen,
format, modifier);
}
- if (xwl_feedback_is_modifier_supported(&xwl_screen->default_feedback, format, modifier))
+ if (xwl_feedback_is_modifier_supported(&xwl_screen->default_feedback, format, modifier, FALSE))
return TRUE;
xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) {
- if (xwl_feedback_is_modifier_supported(&xwl_window->feedback, format, modifier))
+ if (xwl_feedback_is_modifier_supported(&xwl_window->feedback, format, modifier, FALSE))
return TRUE;
}