summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-06-16 17:39:14 -0500
committerDudemanguy <random342@airmail.cc>2022-06-19 18:13:55 +0000
commitceade3493045898a30f0da1bbb639552447ffcdf (patch)
tree6c26367a9a2707a25f75d14e85ddea40d4bca1ee /video/out/x11_common.h
parent7ce26dd3248a45a4d5e0a8c15a981834e7efc733 (diff)
downloadmpv-ceade3493045898a30f0da1bbb639552447ffcdf.tar.bz2
mpv-ceade3493045898a30f0da1bbb639552447ffcdf.tar.xz
x11: use xrandr providers for driver detection
Unfortunately there's a certain company that makes graphics drivers that are harder to deal with. The next commit aims to implement presentation, but some empirical testing from users show that it's actually broken. Give up and just tap into Xrandr so we can figure what drivers (or well, providers by the extension terminology) are driving the screen. Basically if we find intel, amd, or radeon, assume it's a Mesa driver. If we find nvidia, then it must be nvidia. This detection requires randr 1.4 (which means using presentation in mpv secretly depends on randr 1.4), but this protocol version is nearly a decade old anyway so probably 99.9% of users are fine. Do the version query check and all that anyway just to be on the safe side.
Diffstat (limited to 'video/out/x11_common.h')
-rw-r--r--video/out/x11_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/x11_common.h b/video/out/x11_common.h
index acc08f2ee0..e9abf51585 100644
--- a/video/out/x11_common.h
+++ b/video/out/x11_common.h
@@ -68,6 +68,8 @@ struct vo_x11_state {
int current_icc_screen;
int xrandr_event;
+ bool has_mesa;
+ bool has_nvidia;
bool screensaver_enabled;
bool dpms_touched;