mutter/src/backends/native
Jonas Ådahl 56ddaaa380 renderer/native: Make sure we're not destroying an active EGLSurface
When making a new surface/context pair current, mesa may want to flush
the old context. Make sure we don't try to flush any freed memory by
unmaking a surface/context pair current before freeing it.

Not doing this results in the following valgrind warnings:

==15986== Invalid read of size 8
==15986==    at 0x69A6D80: dri_flush_front_buffer (gbm_dri.c:92)
==15986==    by 0x1750D458: intel_flush_front (brw_context.c:251)
==15986==    by 0x1750D4BB: intel_glFlush (brw_context.c:296)
==15986==    by 0x1739D8DD: dri2_make_current (egl_dri2.c:1461)
==15986==    by 0x17393A3A: eglMakeCurrent (eglapi.c:869)
==15986==    by 0x54381FB: InternalMakeCurrentVendor (in /home/jonas/Dev/gnome/install/lib/libEGL.so.1.1.0)
==15986==    by 0x5438515: eglMakeCurrent (in /home/jonas/Dev/gnome/install/lib/libEGL.so.1.1.0)
==15986==    by 0x522A782: _cogl_winsys_egl_make_current (cogl-winsys-egl.c:303)
==15986==    by 0x49B64C8: meta_renderer_native_create_view (meta-renderer-native.c:3076)
==15986==    by 0x48D26E7: meta_renderer_create_view (meta-renderer.c:78)
==15986==    by 0x48D277A: meta_renderer_rebuild_views (meta-renderer.c:111)
==15986==    by 0x49BF46E: meta_stage_native_rebuild_views (meta-stage-native.c:142)
==15986==  Address 0x1b076600 is 0 bytes inside a block of size 48 free'd
==15986==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==15986==    by 0x49B59F3: meta_renderer_native_release_onscreen (meta-renderer-native.c:2651)
==15986==    by 0x5211441: _cogl_onscreen_free (cogl-onscreen.c:167)
==15986==    by 0x5210D81: _cogl_object_onscreen_indirect_free (cogl-onscreen.c:51)
==15986==    by 0x51D0066: _cogl_object_default_unref (cogl-object.c:103)
==15986==    by 0x520F989: _cogl_framebuffer_unref (cogl-framebuffer.c:1814)
==15986==    by 0x51D00B1: cogl_object_unref (cogl-object.c:115)
==15986==    by 0x536F3C7: clutter_stage_view_dispose (clutter-stage-view.c:304)
==15986==    by 0x4B7DAF2: g_object_unref (gobject.c:3309)
==15986==    by 0x4A9596C: g_list_foreach (glist.c:1013)
==15986==    by 0x4A9599A: g_list_free_full (glist.c:223)
==15986==    by 0x48D2737: meta_renderer_rebuild_views (meta-renderer.c:100)
==15986==  Block was alloc'd at
==15986==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==15986==    by 0x69A76B2: gbm_dri_surface_create (gbm_dri.c:1252)
==15986==    by 0x69A6BFE: gbm_surface_create (gbm.c:600)
==15986==    by 0x49B4E29: meta_renderer_native_create_surface_gbm (meta-renderer-native.c:2221)
==15986==    by 0x49B57DB: meta_onscreen_native_allocate (meta-renderer-native.c:2569)
==15986==    by 0x49B6423: meta_renderer_native_create_view (meta-renderer-native.c:3062)
==15986==    by 0x48D26E7: meta_renderer_create_view (meta-renderer.c:78)
==15986==    by 0x48D277A: meta_renderer_rebuild_views (meta-renderer.c:111)
==15986==    by 0x49BF46E: meta_stage_native_rebuild_views (meta-stage-native.c:142)
==15986==    by 0x49A75B5: meta_backend_native_update_screen_size (meta-backend-native.c:520)
==15986==    by 0x48B01BB: meta_backend_sync_screen_size (meta-backend.c:224)
==15986==    by 0x48B09B7: meta_backend_real_post_init (meta-backend.c:501)

https://gitlab.gnome.org/GNOME/mutter/merge_requests/622
2019-06-18 11:12:03 +02:00
..
dbus-utils.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
dbus-utils.h launcher: Replace mutter-launch with logind integration 2014-05-19 15:09:23 -04:00
gen-default-modes.py build: Don't hardcode the path of python3 2018-11-18 14:25:35 +08:00
meta-backend-native-private.h backends/native: Implement support for pointer barriers 2015-01-19 02:27:59 -08:00
meta-backend-native.c backends/native: Add rt-scheduler experimental key to set RT scheduling 2019-05-10 21:47:53 +00:00
meta-backend-native.h backends/native: Move KMS fd management to monitor manager 2017-10-05 16:18:43 -04:00
meta-barrier-native.c Use a consistent style for enum braces 2019-02-28 09:31:01 +01:00
meta-barrier-native.h Use G_DECLARE_DERIVABLE/FINAL_TYPE on some types 2018-12-21 19:48:50 +00:00
meta-clutter-backend-native.c Add some gtk-doc comments. 2019-01-06 21:57:16 +01:00
meta-clutter-backend-native.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-crtc-kms.c backends/native: Move underscan setting to MetaOutputKms 2019-04-02 09:38:45 +00:00
meta-crtc-kms.h backends/native: Move underscan setting to MetaOutputKms 2019-04-02 09:38:45 +00:00
meta-cursor-renderer-native.c cursor-renderer-native: Free MetaCursorNativePrivate struct 2019-05-27 17:14:25 -05:00
meta-cursor-renderer-native.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-drm-buffer-dumb.c drm-buffer: Make the "types" actual types 2019-05-21 14:55:38 +00:00
meta-drm-buffer-dumb.h drm-buffer: Make the "types" actual types 2019-05-21 14:55:38 +00:00
meta-drm-buffer-gbm.c drm-buffer: Make the "types" actual types 2019-05-21 14:55:38 +00:00
meta-drm-buffer-gbm.h drm-buffer: Make the "types" actual types 2019-05-21 14:55:38 +00:00
meta-drm-buffer.c drm-buffer: Make the "types" actual types 2019-05-21 14:55:38 +00:00
meta-drm-buffer.h drm-buffer: Make the "types" actual types 2019-05-21 14:55:38 +00:00
meta-gpu-kms.c monitor-manager: Clean up DPMS state tracking 2019-04-02 13:49:59 +00:00
meta-gpu-kms.h renderer/native: Retry page flip after one vsync if EBUSY 2019-02-25 15:48:29 +00:00
meta-input-settings-native.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-input-settings-native.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-launcher.c launcher: Explicitly look up object path for seat 2019-05-21 16:43:09 +02:00
meta-launcher.h backends/native: Move KMS fd management to monitor manager 2017-10-05 16:18:43 -04:00
meta-monitor-manager-kms.c monitor-manager: Clean up DPMS state tracking 2019-04-02 13:49:59 +00:00
meta-monitor-manager-kms.h backends/native: Move primary_gpu into MetaRendererNative 2019-01-13 10:30:44 +00:00
meta-output-kms.c backends/native: Move underscan setting to MetaOutputKms 2019-04-02 09:38:45 +00:00
meta-output-kms.h backends/native: Use the connector_id rather than winsys_id 2018-11-19 14:58:48 +00:00
meta-renderer-native-gles3.c renderer/native: remove meta_renderer_native_gles3_read_pixels 2018-11-19 22:53:13 +00:00
meta-renderer-native-gles3.h renderer/native: remove meta_renderer_native_gles3_read_pixels 2018-11-19 22:53:13 +00:00
meta-renderer-native.c renderer/native: Make sure we're not destroying an active EGLSurface 2019-06-18 11:12:03 +02:00
meta-renderer-native.h backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-stage-native.c clutter: Add API to get the resource scale of an actor 2019-03-01 17:46:49 +00:00
meta-stage-native.h backends/native: Stop supporting stage views being disabled 2017-10-05 18:08:09 -04:00