0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
mpv/video/out
Sultan Alsawaf 0d44ae319d x11: remove PresentNotifyMSC from egl/glx/vulkan to fix xpresent timing
PresentNotifyMSC turns out to be not only redundant, but also harmful with
mesa-backed egl/glx/vulkan VOs because for all of them, mesa uses
PresentPixmap behind the scenes when DRI3 is available, which already
spawns a PresentCompleteNotify event when the buffer swap actually
finishes. This is important because without using the timing information
from these PresentCompleteKindPixmap events, there's no way for mpv to know
exactly when a frame becomes visible on the display.

By using PresentNotifyMSC in conjunction with DRI3-enabled mesa, two
problems are created:
1. mpv assumes that a vblank won't elapse (i.e., it assumes the current MSC
   won't change) between the time when mesa enqueues the buffer swap and
   the time when mpv calls PresentNotifyMSC to ask xorg for a notification
   at the next MSC, relative to the current MSC at the time that xorg reads
   it for the PresentNotifyMSC call. This means that mpv could get a
   notification one or more vblanks later than it expects, since the
   intention here is for mpv to get a notification at the MSC that the
   buffer swap completes.
2. mpv assumes that a buffer swap always takes one vblank to complete,
   which isn't always true. A buffer swap (i.e., a page flip) could take
   longer than that depending on hardware conditions (if the GPU is running
   slowly or needs to exit a low-power state), scheduling delays (under
   heavy system or GPU load), or unfortunate timing (if the raster scan
   line happens to be at one of the last few rows of pixels and a vblank
   elapses just before the buffer swap is enqueued).

This causes mpv to have a faulty assumption of when frames become visible.

Since mpv already receives the PresentCompleteNotify events generated by
mesa's buffer swaps under the hood, the PresentNotifyMSC usage is unneeded
and just throws a wrench in mpv's vsync timing when xpresent is enabled.

Simply removing the PresentNotifyMSC usage from the egl, glx, and vulkan
VOs fixes the xpresent vsync timing.
2023-01-25 03:13:23 +00:00
..
cocoa cocoa_common: remove deprecated VOCTRLs/VO_EVENTs 2019-12-12 19:56:03 +01:00
d3d11 various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriate 2023-01-12 22:02:07 +01:00
gpu vo_gpu: implement VO_DR_FLAG_HOST_CACHED 2023-01-23 14:13:34 +01:00
gpu_next vo_gpu_next: vulkan: libplacebo: unify log prefix 2022-10-09 21:47:35 +02:00
hwdec drm: rewrite based around vo_drm_state 2023-01-21 17:08:29 +00:00
mac mac: avoid unnecessary unsafe conversions; fixes crash in debug builds 2022-09-14 16:28:12 -05:00
opengl x11: remove PresentNotifyMSC from egl/glx/vulkan to fix xpresent timing 2023-01-25 03:13:23 +00:00
placebo vo_gpu: implement VO_DR_FLAG_HOST_CACHED 2023-01-23 14:13:34 +01:00
vulkan x11: remove PresentNotifyMSC from egl/glx/vulkan to fix xpresent timing 2023-01-25 03:13:23 +00:00
win32 vo_gpu: win: remove exclusive-fullscreen detection hack 2017-12-20 14:53:41 +11:00
wldmabuf wayland: cleanup on vo_wayland_init error 2023-01-08 20:42:42 +00:00
android_common.c vo: change vo_platform_init to bool 2023-01-08 20:42:42 +00:00
android_common.h vo: change vo_platform_init to bool 2023-01-08 20:42:42 +00:00
aspect.c options: add --video-scale-x/y 2020-06-03 17:26:44 +02:00
aspect.h aspect: change license to LGPL 2017-06-17 17:08:51 +02:00
bitmap_packer.c video/out/bitmap_packer: Avoid empty initializer list 2019-11-18 16:50:21 +01:00
bitmap_packer.h bitmap_packer: remove some unused functions 2016-07-01 20:29:45 +02:00
cocoa_cb_common.swift mac: avoid unnecessary unsafe conversions; fixes crash in debug builds 2022-09-14 16:28:12 -05:00
cocoa_common.h osx: change license of OSX and cocoa files to LGPL 2017-06-24 16:29:22 +02:00
cocoa_common.m various: fix typos 2022-04-25 09:07:18 -04:00
dither.c video/out/dither: remove custom index_t typedef 2022-06-04 01:23:03 +02:00
dither.h gl_video: improve dithering 2013-05-26 16:44:20 +02:00
dr_helper.c vo: add int flags to the get_image signature 2023-01-23 14:13:34 +01:00
dr_helper.h vo: add int flags to the get_image signature 2023-01-23 14:13:34 +01:00
drm_atomic.c drm: rewrite based around vo_drm_state 2023-01-21 17:08:29 +00:00
drm_atomic.h drm: rewrite based around vo_drm_state 2023-01-21 17:08:29 +00:00
drm_common.c drm: rewrite based around vo_drm_state 2023-01-21 17:08:29 +00:00
drm_common.h drm: rewrite based around vo_drm_state 2023-01-21 17:08:29 +00:00
drm_prime.c drm_prime: fallback to drmModeAddFB2 2020-05-08 21:26:25 +02:00
drm_prime.h drm_prime: double free bug 2020-03-05 18:12:57 +01:00
filter_kernels.c filter_kernels: fix kaiser 2022-12-20 13:53:25 +01:00
filter_kernels.h vo_opengl: refactor scaler LUT weight packing/loading 2017-09-04 13:53:14 +02:00
libmpv_sw.c client API: add software rendering API 2020-07-08 22:42:05 +02:00
libmpv.h vo: add int flags to the get_image signature 2023-01-23 14:13:34 +01:00
present_sync.c vo: move wayland presentation to separate files 2022-06-19 18:13:55 +00:00
present_sync.h vo: move wayland presentation to separate files 2022-06-19 18:13:55 +00:00
vo_caca.c vo_caca: Implement VOCTRL_UPDATE_WINDOW_TITLE 2019-10-29 17:07:41 +01:00
vo_direct3d.c various: fix typos 2022-04-25 09:07:18 -04:00
vo_dmabuf_wayland.c wayland: rewrite geometry and scaling handling 2023-01-24 00:04:39 +00:00
vo_drm.c drm: rewrite based around vo_drm_state 2023-01-21 17:08:29 +00:00
vo_gpu_next.c vo_gpu_next: implement VO_DR_FLAG_HOST_CACHED 2023-01-23 14:13:34 +01:00
vo_gpu.c vo: add int flags to the get_image signature 2023-01-23 14:13:34 +01:00
vo_image.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_kitty.c build: add configure test for POSIX shm for the sake of vo_kitty 2022-12-26 15:08:07 +01:00
vo_lavc.c various: replace if + abort() with MP_HANDLE_OOM() 2023-01-12 22:02:07 +01:00
vo_libmpv.c vo: add int flags to the get_image signature 2023-01-23 14:13:34 +01:00
vo_mediacodec_embed.c vo: hwdec: do hwdec interop lookup by image format 2022-09-21 09:39:34 -07:00
vo_null.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_rpi.c vo_rpi: fix DISPMANX_UPDATE_HANDLE_T leak 2021-09-28 16:46:52 +00:00
vo_sdl.c sub: rename SUBBITMAP_RGBA to SUBBITMAP_BGRA 2022-01-11 23:45:08 +02:00
vo_sixel.c vo_sixel: Implement write() loop 2022-12-20 10:45:36 +01:00
vo_tct.c video: replace sprintf usage 2023-01-12 22:02:07 +01:00
vo_vaapi.c x11: support xorg present extension 2022-06-19 18:13:55 +00:00
vo_vdpau.c various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriate 2023-01-12 22:02:07 +01:00
vo_wlshm.c wayland: add wp-fractional-scale-v1 support 2023-01-24 00:04:39 +00:00
vo_x11.c x11: avoid XPresent API calls when it's not needed 2022-06-22 18:09:11 +00:00
vo_xv.c x11: avoid XPresent API calls when it's not needed 2022-06-22 18:09:11 +00:00
vo.c vo: add int flags to the get_image signature 2023-01-23 14:13:34 +01:00
vo.h vd_lavc: add "auto" choice for vd-lavc-dr 2023-01-23 14:13:34 +01:00
w32_common.c vo: change vo_platform_init to bool 2023-01-08 20:42:42 +00:00
w32_common.h vo: change vo_platform_init to bool 2023-01-08 20:42:42 +00:00
wayland_common.c wayland: add wp-fractional-scale-v1 support 2023-01-24 00:04:39 +00:00
wayland_common.h wayland: add wp-fractional-scale-v1 support 2023-01-24 00:04:39 +00:00
win_state.c win_state: add vo_calc_window_geometry3 2021-09-06 10:16:10 +03:00
win_state.h win_state: add vo_calc_window_geometry3 2021-09-06 10:16:10 +03:00
wlbuf_pool.c vo_dmabuf_wayland: wayland VO displaying dmabuf buffers 2022-10-26 18:41:47 +00:00
wlbuf_pool.h wlbuf_pool.h: add headers for forward declarations 2022-11-20 19:13:59 +00:00
x11_common.c video/x11: replace sprintf usage 2023-01-12 22:02:07 +01:00
x11_common.h vo: change vo_platform_init to bool 2023-01-08 20:42:42 +00:00