summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-06-19 19:40:20 -0500
committerDudemanguy <random342@airmail.cc>2022-06-22 03:55:49 +0000
commit24f4582b6f7f57f566418551f9252b8578d2b602 (patch)
tree17888dcd02b9799903131f51ad67efe2c124c0e5 /video/out
parentd9f7dd7212b6306350c8b4c6e0b1959f384fb272 (diff)
downloadmpv-24f4582b6f7f57f566418551f9252b8578d2b602.tar.bz2
mpv-24f4582b6f7f57f566418551f9252b8578d2b602.tar.xz
x11: add --x11-present option
With the recent addition of the libxpresent, it should improve frame timings for most users. However, there were known cases of bad behavior (Nvidia) which lead to a construction of a whitelist instead of just enabling this all the time. Since there's no way to predict whatever combination of hardware/drivers/etc. may work correctly, just give users an option to switch the usage of xorg's presentation statistics on/off. The default value, auto, works like before (basically, Mesa drivers and no Nvidia are allowed), but now one can force it on/off if needed.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/x11_common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index f041d594ec..054557189f 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1286,11 +1286,13 @@ void vo_x11_check_events(struct vo *vo)
break;
case GenericEvent: {
XGenericEventCookie *cookie = (XGenericEventCookie *)&Event.xcookie;
- if (cookie->extension == x11->present_code && x11->have_present &&
- x11->has_mesa && !x11->has_nvidia)
+ if (cookie->extension == x11->present_code && x11->have_present)
{
+ int present = x11->opts->x11_present;
+ bool use_present = (x11->has_mesa && !x11->has_nvidia &&
+ present) || present == 2;
XGetEventData(x11->display, cookie);
- if (cookie->evtype == PresentCompleteNotify) {
+ if (cookie->evtype == PresentCompleteNotify && use_present) {
XPresentCompleteNotifyEvent *present_event;
present_event = (XPresentCompleteNotifyEvent *)cookie->data;
present_update_sync_values(x11->present, present_event->ust,