1
0
Fork 0
mutter-performance-source/src/backends/x11
Daniel van Vugt 6ed5d2e2b4 cogl: Remove GLX "threaded swap wait" used on Nvidia
Threaded swap wait was added for using together with the Nvidia GLX
driver due to the lack of anything equivalent to the INTEL_swap_event
GLX extension. The purpose was to avoid inhibiting the invocation of
idle callbacks when constantly rendering, as the combination of
throttling on swap-interval 1 and glxSwapBuffers() and the frame clock
source having higher priority than the default idle callback sources
meant they would never be invoked.

This was solved in gbz#779039 by introducing a thread that took care of
the vsync waiting, pushing frame completion events to the main thread
meaning the main thread could go idle while waiting to draw the next
frame instead of blocking on glxSwapBuffers().

As of https://gitlab.gnome.org/GNOME/mutter/merge_requests/363, the
main thread will instead use prediction to estimate when the next frame
should be drawn. A side effect of this is that even without
INTEL_swap_event, we would not block as much, or at all, on
glxSwapBuffers(), as at the time it is called, we have likely already
hit the vblank, or will hit it soon.

After having introduced the swap waiting thread, it was observed that
the Nvidia driver used a considerable amount of CPU waiting for the
vblank, effectively wasting CPU time. The need to call glFinish() was
also problematic as it would wait for the frame to finish, before
continuing. Due to this, remove the threaded swap wait, and rely only on
the frame clock not scheduling frames too early.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=781835
Related: https://gitlab.gnome.org/GNOME/mutter/issues/700

[jadahl: Rewrote commit message]

https://gitlab.gnome.org/GNOME/mutter/merge_requests/602
2019-09-02 18:12:10 +08:00
..
cm compositor: Move out X11 compositing code into sub type 2019-08-19 08:44:58 +00:00
nested backends: Move nested stage to src/backends/x11/nested 2019-08-24 08:59:08 +00:00
meta-backend-x11.c cogl: Remove GLX "threaded swap wait" used on Nvidia 2019-09-02 18:12:10 +08:00
meta-backend-x11.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-barrier-x11.c Use G_DECLARE_DERIVABLE/FINAL_TYPE on some types 2018-12-21 19:48:50 +00:00
meta-barrier-x11.h Use G_DECLARE_DERIVABLE/FINAL_TYPE on some types 2018-12-21 19:48:50 +00:00
meta-clutter-backend-x11.c backends: Move nested stage to src/backends/x11/nested 2019-08-24 08:59:08 +00:00
meta-clutter-backend-x11.h Make mutter manage its own clutter backends 2016-07-20 14:23:48 +08:00
meta-crtc-xrandr.c backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-crtc-xrandr.h backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-cursor-renderer-x11.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cursor-renderer-x11.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-device-manager-x11.c backends: Don't use glib types in new X11 backend objects 2019-08-24 08:59:08 +00:00
meta-device-manager-x11.h clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-event-x11.c clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-event-x11.h clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-gpu-xrandr.c backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-gpu-xrandr.h backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-input-device-tool-x11.c clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-input-device-tool-x11.h clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-input-device-x11.c backends: Don't use glib types in new X11 backend objects 2019-08-24 08:59:08 +00:00
meta-input-device-x11.h backends: Don't use glib types in new X11 backend objects 2019-08-24 08:59:08 +00:00
meta-input-settings-x11.c Use a consistent style for enum braces 2019-02-28 09:31:01 +01:00
meta-input-settings-x11.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-keymap-x11.c backends: Don't use glib types in new X11 backend objects 2019-08-24 08:59:08 +00:00
meta-keymap-x11.h backends: Don't use glib types in new X11 backend objects 2019-08-24 08:59:08 +00:00
meta-monitor-manager-xrandr.c backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-monitor-manager-xrandr.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-output-xrandr.c backend: Move GPU ownership from the monitor manager to the backend 2019-06-20 13:31:55 +00:00
meta-output-xrandr.h backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-renderer-x11.c cogl: Remove GLX "threaded swap wait" used on Nvidia 2019-09-02 18:12:10 +08:00
meta-renderer-x11.h renderer-x11: Split up into CM and Nested renderers 2017-04-07 22:30:49 +08:00
meta-stage-x11.c backends: Don't use glib types in new X11 backend objects 2019-08-24 08:59:08 +00:00
meta-stage-x11.h clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-virtual-input-device-x11.c clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-virtual-input-device-x11.h clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00
meta-xkb-a11y-x11.c backends: Don't use glib types in new X11 backend objects 2019-08-24 08:59:08 +00:00
meta-xkb-a11y-x11.h clutter: Move X11 input to src/backends/x11 2019-08-24 08:59:08 +00:00