diff --git a/DOCS/interface-changes/wayland-internal-vsync.txt b/DOCS/interface-changes/wayland-internal-vsync.txt new file mode 100644 index 0000000000..8131143998 --- /dev/null +++ b/DOCS/interface-changes/wayland-internal-vsync.txt @@ -0,0 +1,2 @@ +deprecate `--wayland-disable-vsync` +add `--wayland-internal-vsync` as a replacement for `--wayland-disable-vsync` diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index ecd0d326a5..136411e9f9 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -6159,11 +6159,6 @@ them. (default) will automatically switch between telling the compositor the content is a photo, video or possibly none depending on internal heuristics. -``--wayland-disable-vsync=`` - Disable mpv's internal vsync for Wayland-based video output (default: no). - This is mainly useful for benchmarking wayland VOs when combined with - ``video-sync=display-desync``, ``--audio=no``, and ``--untimed=yes``. - ``--wayland-edge-pixels-pointer=`` Defines the size of an edge border (default: 16) to initiate client side resize events in the wayland contexts with the mouse. This is only active if @@ -6173,6 +6168,12 @@ them. Defines the size of an edge border (default: 32) to initiate client side resizes events in the wayland contexts with touch events. +``--wayland-internal-vsync=`` + Controls whether to use mpv's internal vsync for Wayland-base video outputs + (default: ``auto``). This is mainly useful for benchmarking wayland VOs when + combined with ``video-sync=display-desync``, ``--audio=no``, and + ``--untimed=yes``. + ``--wayland-present=`` Enable the use of wayland's presentation time protocol for more accurate frame presentation if it is supported by the compositor (default: ``yes``). diff --git a/options/options.c b/options/options.c index e85e1e9125..80996293cd 100644 --- a/options/options.c +++ b/options/options.c @@ -206,7 +206,10 @@ static const m_option_t mp_vo_opt_list[] = { {"auto", -1}, {"no", 0}, {"yes", 1})}, {"wayland-content-type", OPT_CHOICE(wl_content_type, {"auto", -1}, {"none", 0}, {"photo", 1}, {"video", 2}, {"game", 3})}, - {"wayland-disable-vsync", OPT_BOOL(wl_disable_vsync)}, + {"wayland-disable-vsync", OPT_BOOL(wl_disable_vsync), + .deprecation_message = "replaced by --wayland-internal-vsync=no"}, + {"wayland-internal-vsync", OPT_CHOICE(wl_internal_vsync, + {"no", 0}, {"auto", 1}, {"yes", 2})}, {"wayland-edge-pixels-pointer", OPT_INT(wl_edge_pixels_pointer), M_RANGE(0, INT_MAX)}, {"wayland-edge-pixels-touch", OPT_INT(wl_edge_pixels_touch), @@ -274,6 +277,7 @@ const struct m_sub_options vo_sub_opts = { .wl_content_type = -1, .wl_edge_pixels_pointer = 16, .wl_edge_pixels_touch = 32, + .wl_internal_vsync = 1, .wl_present = true, .mmcss_profile = "Playback", .ontop_level = -1, diff --git a/options/options.h b/options/options.h index e5add1473f..8504845e1f 100644 --- a/options/options.h +++ b/options/options.h @@ -39,6 +39,7 @@ typedef struct mp_vo_opts { int wl_configure_bounds; int wl_content_type; bool wl_disable_vsync; + int wl_internal_vsync; int wl_edge_pixels_pointer; int wl_edge_pixels_touch; bool wl_present; diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index b4b200cfb3..6940c9749e 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -69,7 +69,7 @@ static void wayland_egl_swap_buffers(struct ra_ctx *ctx) eglSwapBuffers(p->egl_display, p->egl_surface); - if (!wl->opts->wl_disable_vsync) + if (wl->opts->wl_internal_vsync) vo_wayland_wait_frame(wl); if (wl->use_present) diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c index 1a12c32ddb..df0199c4ae 100644 --- a/video/out/vo_dmabuf_wayland.c +++ b/video/out/vo_dmabuf_wayland.c @@ -653,7 +653,7 @@ static void flip_page(struct vo *vo) wl_surface_commit(wl->osd_surface); wl_surface_commit(wl->surface); - if (!wl->opts->wl_disable_vsync) + if (wl->opts->wl_internal_vsync) vo_wayland_wait_frame(wl); if (wl->use_present) diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index 708963e55a..37264989ec 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -302,7 +302,7 @@ static void flip_page(struct vo *vo) vo->dheight); wl_surface_commit(wl->surface); - if (!wl->opts->wl_disable_vsync) + if (wl->opts->wl_internal_vsync) vo_wayland_wait_frame(wl); if (wl->use_present) diff --git a/video/out/vulkan/context_wayland.c b/video/out/vulkan/context_wayland.c index 700822c9a4..eae5d25e7d 100644 --- a/video/out/vulkan/context_wayland.c +++ b/video/out/vulkan/context_wayland.c @@ -36,7 +36,7 @@ static void wayland_vk_swap_buffers(struct ra_ctx *ctx) { struct vo_wayland_state *wl = ctx->vo->wl; - if (!wl->opts->wl_disable_vsync) + if (wl->opts->wl_internal_vsync) vo_wayland_wait_frame(wl); if (wl->use_present)