1
0
Fork 0
mutter-performance-source/src/backends
Pekka Paalanen 85e9784a22 renderer/native: fix next_fb_id race on CPU copy path
There was a race in setting next_fb_id when a secondary GPU was using
the CPU copy path. Losing this race caused the attempt to
drmModePageFlip () to FB ID 0 which is invalid and always fails. Failing
to flip causes Mutter to fall back to drmModeSetCrtc () permanently.

In meta_onscreen_native_swap_buffers_with_damage ():
- update_secondary_gpu_state_pre_swap_buffers ()
  - copy_shared_framebuffer_cpu () but only on the CPU copy path
    - secondary_gpu_state->gbm.next_fb_id is set
- wait_for_pending_flips ()
  - Waits for any remaining page flip events and executes and destroys
    the related page flip closures.
    - on_crtc_flipped ()
      - meta_onscreen_native_swap_drm_fb ()
        - swap_secondary_drm_fb ()
	  - secondary_gpu_state->gbm.next_fb_id = 0;
- meta_onscreen_native_flip_crtcs ()
  - meta_onscreen_native_flip_crtc ()
    - meta_gpu_kms_flip_crtc () gets called with fb_id = 0

This race was observed lost when running 'mutter --wayland' on a machine
with two outputs on Intel and one output on DisplayLink USB dock, and
wiggling around a weston-terminal window between the Intel and
DisplayLink outputs. It took from a second to a minute to trigger. For
testing with DisplayLink outputs Mutter also needed a patch to take the
DisplayLink output into use, as it would have otherwise been ignored
being a platform device rather than a PCI device.

Fix this race by first waiting for pending flips and only then
proceeding with the swap operations. This should be safe, because the
pending flips could have completed already before entering
meta_onscreen_native_swap_buffers_with_damage ().
2018-10-25 09:57:39 +00:00
..
native renderer/native: fix next_fb_id race on CPU copy path 2018-10-25 09:57:39 +00:00
x11 input-settings: detect trackball using udev ID_INPUT_TRACKBALL 2018-09-19 08:48:27 +00:00
edid-parse.c Remove trailing whitespace 2014-05-02 09:34:48 -04:00
edid.h edid: Remove unused declarations 2014-09-12 11:55:08 -06:00
gsm-inhibitor-flag.h idle-monitor: Take idle inhibition into account 2018-04-16 13:28:03 +02:00
meta-backend-private.h backend: Remove direct upower-glib usage 2018-07-18 10:17:37 +00:00
meta-backend.c Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-barrier-private.h Move out generic math parts out of the native barrier implementation 2016-02-16 19:02:48 +08:00
meta-barrier.c Stop using g_type_class_add_private() 2018-07-31 23:40:01 +02:00
meta-crtc.c backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-crtc.h backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-cursor-renderer.c cursor-renderer: Rename update_cursor function 2018-06-15 19:09:55 +00:00
meta-cursor-renderer.h Stop using MetaScreen where it is unnecessary 2018-07-06 19:47:16 +02:00
meta-cursor-sprite-xcursor.c cursor-renderer/native: Let the backend realize cursor sprite itself 2018-06-15 19:09:55 +00:00
meta-cursor-sprite-xcursor.h cursor-renderer: Fetch instead of pass Xcursor image when realizing 2018-06-15 19:09:52 +00:00
meta-cursor-tracker-private.h cursor-tracker: Split out XFIXES cursor code into cursor sprite type 2018-06-15 19:09:51 +00:00
meta-cursor-tracker.c Rename errors.[ch] to meta-x11-errors.[ch] 2018-07-06 19:47:17 +02:00
meta-cursor.c wayland: Add wl_surface backed cursor sprite implementation 2018-06-15 19:09:52 +00:00
meta-cursor.h wayland: Add wl_surface backed cursor sprite implementation 2018-06-15 19:09:52 +00:00
meta-dbus-session-watcher.c Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-dbus-session-watcher.h Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-display-config-shared.h Remove trailing whitespace 2014-05-02 09:34:48 -04:00
meta-dnd-private.h Fix XDND handling to work without GDK and MetaX11Display 2018-07-06 19:47:16 +02:00
meta-egl-ext.h egl: Add EGL_RESOURCE_BUSY_EXT error 2017-03-04 18:34:17 +08:00
meta-egl.c renderer/native: Force EGL config pixel format 2018-03-05 15:42:27 +00:00
meta-egl.h renderer/native: Force EGL config pixel format 2018-03-05 15:42:27 +00:00
meta-gles3-table.h backends: Add OpenGL ES 3 abstraction layer 2017-10-05 18:17:26 -04:00
meta-gles3.c backends: Add OpenGL ES 3 abstraction layer 2017-10-05 18:17:26 -04:00
meta-gles3.h backends: Add OpenGL ES 3 abstraction layer 2017-10-05 18:17:26 -04:00
meta-gpu.c backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-gpu.h backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-idle-monitor-dbus.c idle-monitor: Add ResetIdletime API, for testing purposes 2018-04-16 13:28:03 +02:00
meta-idle-monitor-dbus.h Start molding out a new src/backends/ dir 2014-03-31 22:11:00 -04:00
meta-idle-monitor-private.h idle-monitor: Take idle inhibition into account 2018-04-16 13:28:03 +02:00
meta-idle-monitor.c idle-monitor: Store either 1 or 0 in the inhibited gboolean 2018-08-14 15:14:05 +00:00
meta-input-settings-private.h input-settings: detect trackball using udev ID_INPUT_TRACKBALL 2018-09-19 08:48:27 +00:00
meta-input-settings.c input-settings: detect trackball using udev ID_INPUT_TRACKBALL 2018-09-19 08:48:27 +00:00
meta-logical-monitor.c Move monitor management API to MetaDisplay 2018-07-06 19:47:16 +02:00
meta-logical-monitor.h Move monitor management API to MetaDisplay 2018-07-06 19:47:16 +02:00
meta-monitor-config-manager.c monitor-manager: use MonitorsConfig to track switch_config 2018-10-08 15:53:45 +08:00
meta-monitor-config-manager.h monitor-manager: use MonitorsConfig to track switch_config 2018-10-08 15:53:45 +08:00
meta-monitor-config-migration.c monitor-config-migration: Discard if configured mode is missing 2017-10-04 09:45:02 -04:00
meta-monitor-config-migration.h Migrate old monitor configuration files to new system 2017-08-21 12:23:51 +08:00
meta-monitor-config-store.c monitor-config: Keep track of disabled monitors for stored configs 2017-10-02 15:34:24 -04:00
meta-monitor-config-store.h Migrate old monitor configuration files to new system 2017-08-21 12:23:51 +08:00
meta-monitor-manager-dummy.c backends: Move MetaOutput::crtc field into private struct 2018-06-28 13:42:15 +02:00
meta-monitor-manager-dummy.h backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-monitor-manager-private.h backend: Move lid-is-closed handling to MetaBackend 2018-07-18 10:17:36 +00:00
meta-monitor-manager.c monitor-manager: use MonitorsConfig to track switch_config 2018-10-08 15:53:45 +08:00
meta-monitor.c monitor: Use current monitor mode to check whether active 2018-07-31 13:37:03 +02:00
meta-monitor.h monitor-manager: Filter out low screen resolutions 2018-07-30 15:57:31 +02:00
meta-orientation-manager.c backends: Add a MetaOrientationManager class 2017-07-14 15:31:20 +02:00
meta-orientation-manager.h backends: Add a MetaOrientationManager class 2017-07-14 15:31:20 +02:00
meta-output.c backends: Add logical monitor -> monitor -> output -> crtc ref chain 2018-06-28 13:42:15 +02:00
meta-output.h backends: Move MetaOutput::crtc field into private struct 2018-06-28 13:42:15 +02:00
meta-pointer-constraint.c Implement support for the wp_pointer_constraints protocol 2016-02-16 19:02:48 +08:00
meta-pointer-constraint.h Implement support for the wp_pointer_constraints protocol 2016-02-16 19:02:48 +08:00
meta-remote-access-controller-private.h Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-remote-access-controller.c Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-remote-desktop-session.c Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-remote-desktop-session.h Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-remote-desktop.c remote-desktop: Remove unnecessary include 2018-07-06 19:47:17 +02:00
meta-remote-desktop.h Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-renderer-view.c renderer-view: Add view transform getter 2017-04-07 22:30:49 +08:00
meta-renderer-view.h renderer-view: Add view transform getter 2017-04-07 22:30:49 +08:00
meta-renderer.c monitor-manager: Store logical monitors in a GList 2017-01-25 16:28:52 +08:00
meta-renderer.h Rename MetaMonitorInfo MetaLogicalMonitor 2017-01-25 16:28:51 +08:00
meta-screen-cast-monitor-stream-src.c ScreenCast: Pass PipeWire stream node ID directly 2017-08-29 14:39:04 +08:00
meta-screen-cast-monitor-stream-src.h ScreenCast: Pass PipeWire stream node ID directly 2017-08-29 14:39:04 +08:00
meta-screen-cast-monitor-stream.c screen-cast-stream: Add API to transform relative coordinates 2018-02-23 19:33:31 +08:00
meta-screen-cast-monitor-stream.h Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-screen-cast-session.c Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-screen-cast-session.h Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-screen-cast-stream-src.c Don't cast free function passed to g_clear_pointer 2018-07-31 23:40:01 +02:00
meta-screen-cast-stream-src.h screen-cast-stream-src: Remove malformed include 2017-09-08 17:54:44 +02:00
meta-screen-cast-stream.c screen-cast-stream: Add API to transform relative coordinates 2018-02-23 19:33:31 +08:00
meta-screen-cast-stream.h screen-cast-stream: Add API to transform relative coordinates 2018-02-23 19:33:31 +08:00
meta-screen-cast.c remote-desktop, screen-cast: Add version number to D-Bus APIs 2018-02-23 19:33:31 +08:00
meta-screen-cast.h Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-settings-private.h Make screen cast and remote desktop non-experimental 2018-06-07 12:57:51 +00:00
meta-settings.c settings: Remove confused comment 2018-06-07 12:57:52 +00:00
meta-stage-private.h build: Introspect some more types 2018-05-07 21:44:47 +02:00
meta-stage.c build: Introspect some more types 2018-05-07 21:44:47 +02:00