summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel van Vugt <daniel.van.vugt@canonical.com>2021-11-24 16:16:40 +0800
committerRobert Mader <robert.mader@posteo.de>2021-11-26 16:04:45 +0000
commit24837a9663a928f5540fae0b4864fbbdabde2411 (patch)
tree560a86e41a1a29e4de3d5d467e47237887567379
parentf70b7a85dd2afe4d7ed76c69febff12b78d02566 (diff)
downloadmutter-24837a9663a928f5540fae0b4864fbbdabde2411.tar.gz
onscreen/native: Increase buffer ref count in copy_shared_framebuffer_cpu
It was dropping to zero after the first frame because it hadn't been incremented high enough. So the second frame would crash with: ``` #0 g_type_check_instance_cast #1 META_DRM_BUFFER #2 copy_shared_framebuffer_cpu ``` That's the CPU-copy path (fallback-fallback) that probably no one is using but it does work after this fix. Exactly the same issue as was fixed in `copy_shared_framebuffer_primary_gpu` by 36352f44f9547ea1. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2104> (cherry picked from commit acadf5b3f7a30aa6744d1936762d65e367db730a)
-rw-r--r--src/backends/native/meta-onscreen-native.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c
index 02cd5da2e..f244c7fc1 100644
--- a/src/backends/native/meta-onscreen-native.c
+++ b/src/backends/native/meta-onscreen-native.c
@@ -857,8 +857,7 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
cogl_object_unref (dumb_bitmap);
- g_clear_object (&secondary_gpu_state->gbm.next_fb);
- secondary_gpu_state->gbm.next_fb = buffer;
+ g_set_object (&secondary_gpu_state->gbm.next_fb, buffer);
secondary_gpu_state->cpu.current_dumb_fb = buffer_dumb;
}