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 36352f44f9.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2104>
This commit is contained in:
Daniel van Vugt 2021-11-24 16:16:40 +08:00 committed by Marge Bot
parent 7f720a40b4
commit acadf5b3f7

View File

@ -909,8 +909,7 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
cogl_object_unref (dumb_bitmap); cogl_object_unref (dumb_bitmap);
g_clear_object (&secondary_gpu_state->gbm.next_fb); g_set_object (&secondary_gpu_state->gbm.next_fb, buffer);
secondary_gpu_state->gbm.next_fb = buffer;
secondary_gpu_state->cpu.current_dumb_fb = buffer_dumb; secondary_gpu_state->cpu.current_dumb_fb = buffer_dumb;
} }