[mutter] compositor/native: Allow scanout for offscreen rotated views



commit 3c79eb56b9b7370dceff6c6fbad727256417fd3d
Author: Robert Mader <robert mader collabora com>
Date:   Tue Aug 2 20:00:55 2022 +0200

    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>

 src/compositor/meta-compositor-view-native.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/compositor/meta-compositor-view-native.c b/src/compositor/meta-compositor-view-native.c
index ccba0ef723..932d43a3b9 100644
--- a/src/compositor/meta-compositor-view-native.c
+++ b/src/compositor/meta-compositor-view-native.c
@@ -98,10 +98,13 @@ find_scanout_candidate (MetaCompositorView  *compositor_view,
   if (!META_IS_CRTC_KMS (crtc))
     return FALSE;
 
-  framebuffer = clutter_stage_view_get_framebuffer (stage_view);
+  framebuffer = clutter_stage_view_get_onscreen (stage_view);
   if (!COGL_IS_ONSCREEN (framebuffer))
     return FALSE;
 
+  if (clutter_stage_view_has_shadowfb (stage_view))
+    return FALSE;
+
   window_actor = meta_compositor_view_get_top_window_actor (compositor_view);
   if (!window_actor)
     return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]