Accepting request 1107964 from GNOME:Factory

OBS-URL: https://build.opensuse.org/request/show/1107964
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mutter?expand=0&rev=209
This commit is contained in:
Ana Guerrero 2023-08-30 08:18:52 +00:00 committed by Git OBS Bridge
commit 309c7c02c3
4 changed files with 48 additions and 125 deletions

View File

@ -0,0 +1,37 @@
From afd7d5ad1b5587eb2c4dd978f0e577d9640354be Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 29 Aug 2023 11:21:50 +0200
Subject: [PATCH] backends: Check that buffer age is available when checking
damage history
This used to be the case before the refactor at commit 43cee4b6b6,
use_clipped_redraw would be unset before the larger check if has_buffer_age
was set, but clutter_damage_history_is_age_valid() was FALSE. This got
replaced by a check just on the latter, which will also be FALSE if
has_buffer_age is not present.
We have other means to achieve clipped redraws, so this slight change
culled all of them.
Fixes: 43cee4b6b6 ("stage-impl: Do clipped redraws when drawing offscreen")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2771
---
src/backends/meta-stage-impl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backends/meta-stage-impl.c b/src/backends/meta-stage-impl.c
index 26a7531296b..af88451d331 100644
--- a/src/backends/meta-stage-impl.c
+++ b/src/backends/meta-stage-impl.c
@@ -475,7 +475,7 @@ should_use_clipped_redraw (gboolean is_full_redraw,
if (COGL_IS_OFFSCREEN (framebuffer))
return TRUE;
- if (!buffer_has_valid_damage_history)
+ if (has_buffer_age && !buffer_has_valid_damage_history)
{
meta_topic (META_DEBUG_BACKEND,
"Invalid back buffer age: forcing full redraw");
--
GitLab

View File

@ -1,123 +0,0 @@
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,12 @@
-------------------------------------------------------------------
Tue Aug 29 09:50:53 UTC 2023 - Alynx Zhou <alynx.zhou@suse.com>
- Add mutter-fix-clipped-redraw.patch: Previous refactor forget
to check has_buffer_age, which leads into force full redraw and
causes redraw issue with xterm on qemu. This patch fixes it.
(bsc#1210744, glgo#GNOME/mutter!3221)
- Drop mutter-revert-window_draw_issues.patch: Proper fix is added.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Aug 22 09:24:36 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org> Tue Aug 22 09:24:36 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -36,8 +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 # PATCH-FIX-UPSTREAM mutter-fix-clipped-redraw.patch bsc#1210744 glgo#GNOME/mutter!3221 alynx.zhou@suse.com -- Fix clipped redraw issue on qemu
Patch4: mutter-revert-window_draw_issues.patch Patch4: mutter-fix-clipped-redraw.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.