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>
This commit is contained in:
parent
1a0cc25d48
commit
79ab129fdf
|
@ -124,11 +124,15 @@ xwl_glamor_is_modifier_supported_in_formats(struct xwl_format *formats, int num_
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xwl_feedback_is_modifier_supported(struct xwl_dmabuf_feedback *xwl_feedback,
|
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++) {
|
for (int i = 0; i < xwl_feedback->dev_formats_len; i++) {
|
||||||
struct xwl_device_formats *dev_formats = &xwl_feedback->dev_formats[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,
|
if (xwl_glamor_is_modifier_supported_in_formats(dev_formats->formats,
|
||||||
dev_formats->num_formats,
|
dev_formats->num_formats,
|
||||||
format, modifier))
|
format, modifier))
|
||||||
|
@ -157,11 +161,11 @@ xwl_glamor_is_modifier_supported(struct xwl_screen *xwl_screen,
|
||||||
format, modifier);
|
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;
|
return TRUE;
|
||||||
|
|
||||||
xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) {
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue