- Add mutter-revert-window_draw_issues.patch: Revert commit

43cee4b6:  Do clipped redraws when drawing offscreen
  (boo#1210744, glgo#GNOME/mutter#2771).

OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=459
This commit is contained in:
Dominique Leuenberger 2023-08-22 09:39:38 +00:00 committed by Git OBS Bridge
parent d9c8908f27
commit de898bce41
3 changed files with 133 additions and 0 deletions

View File

@ -0,0 +1,123 @@
From ae1432062ad1dc209dbd2cb8fc1e835d447d226f Mon Sep 17 00:00:00 2001
From: Domninique Leuenberger <dimstar@opensuse.org>
Date: Tue, 22 Aug 2023 05:31:14 -0400
Subject: [PATCH] Revert "stage-impl: Do clipped redraws when drawing
offscreen"
This reverts commit 43cee4b6b6bef88e74ef877439aa5696c95612b7.
---
src/backends/meta-stage-impl.c | 72 ++++++++++------------------------
1 file changed, 21 insertions(+), 51 deletions(-)
diff --git a/src/backends/meta-stage-impl.c b/src/backends/meta-stage-impl.c
index db94c7e4..31e07d96 100644
--- a/src/backends/meta-stage-impl.c
+++ b/src/backends/meta-stage-impl.c
@@ -454,46 +454,6 @@ transform_swap_region_to_onscreen (ClutterStageView *stage_view,
return transformed_region;
}
-static gboolean
-should_use_clipped_redraw (gboolean is_full_redraw,
- gboolean has_buffer_age,
- gboolean buffer_has_valid_damage_history,
- ClutterDrawDebugFlag paint_debug_flags,
- CoglFramebuffer *framebuffer,
- ClutterStageWindow *stage_window)
-{
- gboolean can_blit_sub_buffer;
- gboolean can_use_clipped_redraw;
- gboolean is_warmed_up;
-
- if (is_full_redraw)
- return FALSE;
-
- if (paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)
- return FALSE;
-
- if (COGL_IS_OFFSCREEN (framebuffer))
- return TRUE;
-
- if (!buffer_has_valid_damage_history)
- {
- meta_topic (META_DEBUG_BACKEND,
- "Invalid back buffer age: forcing full redraw");
- return FALSE;
- }
-
- can_blit_sub_buffer =
- cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
- can_use_clipped_redraw =
- _clutter_stage_window_can_clip_redraws (stage_window) &&
- (can_blit_sub_buffer || has_buffer_age);
- /* Some drivers struggle to get going and produce some junk
- * frames when starting up... */
- is_warmed_up =
- cogl_onscreen_get_frame_counter (COGL_ONSCREEN (framebuffer)) > 3;
- return is_warmed_up && can_use_clipped_redraw;
-}
-
static void
meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
ClutterStageView *stage_view,
@@ -505,8 +465,8 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (stage_view);
cairo_rectangle_int_t view_rect;
gboolean is_full_redraw;
- gboolean use_clipped_redraw;
- gboolean buffer_has_valid_damage_history = FALSE;
+ gboolean use_clipped_redraw = TRUE;
+ gboolean can_blit_sub_buffer;
gboolean has_buffer_age;
gboolean swap_with_damage;
cairo_region_t *redraw_clip;
@@ -524,6 +484,10 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
fb_width = cogl_framebuffer_get_width (fb);
fb_height = cogl_framebuffer_get_height (fb);
+ can_blit_sub_buffer =
+ COGL_IS_ONSCREEN (onscreen) &&
+ cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
+
has_buffer_age =
COGL_IS_ONSCREEN (onscreen) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
@@ -541,20 +505,26 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
if (has_buffer_age)
{
buffer_age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (onscreen));
- buffer_has_valid_damage_history =
- clutter_damage_history_is_age_valid (damage_history,
- buffer_age);
+ if (!clutter_damage_history_is_age_valid (damage_history, buffer_age))
+ {
+ meta_topic (META_DEBUG_BACKEND,
+ "Invalid back buffer(age=%d): forcing full redraw",
+ buffer_age);
+ use_clipped_redraw = FALSE;
+ }
}
meta_get_clutter_debug_flags (NULL, &paint_debug_flags, NULL);
use_clipped_redraw =
- should_use_clipped_redraw (is_full_redraw,
- has_buffer_age,
- buffer_has_valid_damage_history,
- paint_debug_flags,
- onscreen,
- stage_window);
+ use_clipped_redraw &&
+ !(paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS) &&
+ _clutter_stage_window_can_clip_redraws (stage_window) &&
+ (can_blit_sub_buffer || has_buffer_age) &&
+ !is_full_redraw &&
+ /* some drivers struggle to get going and produce some junk
+ * frames when starting up... */
+ cogl_onscreen_get_frame_counter (COGL_ONSCREEN (onscreen)) > 3;
if (use_clipped_redraw)
{
--
2.41.0

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Aug 22 09:24:36 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>
- Add mutter-revert-window_draw_issues.patch: Revert commit
43cee4b6: Do clipped redraws when drawing offscreen
(boo#1210744, glgo#GNOME/mutter#2771).
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Aug 17 09:36:34 UTC 2023 - Yifan Jiang <yfjiang@suse.com> Thu Aug 17 09:36:34 UTC 2023 - Yifan Jiang <yfjiang@suse.com>

View File

@ -36,6 +36,8 @@ Patch1: mutter-disable-cvt-s390x.patch
Patch2: mutter-window-actor-Special-case-shaped-Java-windows.patch Patch2: mutter-window-actor-Special-case-shaped-Java-windows.patch
# PATCH-FIX-UPSTREAM mutter-crash-meta_context_terminate.patch bsc#1199382 glgo#GNOME/mutter#2267 xwang@suse.com -- Fix SIGSEGV in meta_context_terminate # PATCH-FIX-UPSTREAM mutter-crash-meta_context_terminate.patch bsc#1199382 glgo#GNOME/mutter#2267 xwang@suse.com -- Fix SIGSEGV in meta_context_terminate
Patch3: mutter-crash-meta_context_terminate.patch Patch3: mutter-crash-meta_context_terminate.patch
# PATCH-FIX-UPSTREAM Add mutter-revert-window_draw_issues.patch 1210744 glgo#GNOME/mutter#2771 -- Revert commit 43cee4b6: Do clipped redraws when drawing offscreen
Patch4: mutter-revert-window_draw_issues.patch
## SLE-only patches start at 1000 ## SLE-only patches start at 1000
# PATCH-FEATURE-SLE mutter-SLE-bell.patch FATE#316042 bnc#889218 idonmez@suse.com -- make audible bell work out of the box. # PATCH-FEATURE-SLE mutter-SLE-bell.patch FATE#316042 bnc#889218 idonmez@suse.com -- make audible bell work out of the box.
@ -146,6 +148,7 @@ applications that want to make use of the mutter library.
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1
%endif %endif
# SLE-only patches and translations. # SLE-only patches and translations.
%if 0%{?sle_version} %if 0%{?sle_version}