compositor/native: Allow scanout for offscreen rotated views

If a stage view uses an offscreen framebuffer exclusively for
rotation and a Wayland client provides pre-rotated buffers,
we should try to use scanout.
This saves us one copy more than scanout in the onscreen case,
i.e. two fullscreen copies in total.

Offscreen rotation is notably used for all 90/270 degree rotations
at the moment, as using display hardware for them is apparently
more complex than for x-/y-flips and can even have detrimental
effects on power consumption.

This can be tested with `weston-simple-egl`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2468>
This commit is contained in:
Robert Mader 2022-08-02 20:00:55 +02:00 committed by Marge Bot
parent b071a8366d
commit 3c79eb56b9

View File

@ -98,10 +98,13 @@ find_scanout_candidate (MetaCompositorView *compositor_view,
if (!META_IS_CRTC_KMS (crtc)) if (!META_IS_CRTC_KMS (crtc))
return FALSE; return FALSE;
framebuffer = clutter_stage_view_get_framebuffer (stage_view); framebuffer = clutter_stage_view_get_onscreen (stage_view);
if (!COGL_IS_ONSCREEN (framebuffer)) if (!COGL_IS_ONSCREEN (framebuffer))
return FALSE; return FALSE;
if (clutter_stage_view_has_shadowfb (stage_view))
return FALSE;
window_actor = meta_compositor_view_get_top_window_actor (compositor_view); window_actor = meta_compositor_view_get_top_window_actor (compositor_view);
if (!window_actor) if (!window_actor)
return FALSE; return FALSE;