diff options
author | Dudemanguy <random342@airmail.cc> | 2022-06-21 11:40:07 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-06-21 18:05:35 +0000 |
commit | 230d490ecade2a7151a31973c13abaafdaba826f (patch) | |
tree | 2733c0e9e2f5cf9d7d665332d9ea3780ce5774b2 /video/out/x11_common.c | |
parent | b29878e3a19fa944b9ef044b9cef776ab3c89af7 (diff) | |
download | mpv-230d490ecade2a7151a31973c13abaafdaba826f.tar.bz2 mpv-230d490ecade2a7151a31973c13abaafdaba826f.tar.xz |
x11: correct provider detection logic
The old logic always reset the x11->has_mesa/has_nvidia values on every
loop through the provider. This meant that it would always just match
whatever the last provider happened to be. So in the case of a dual GPU
system, if nvidia was the very first provider and the integrated
intel/amd card was the second (in practice, this is probably mostly the
other way around), then mpv would set has_mesa to true and has_nvidia to
false and thus try to use presentation. This is not the intended
behavior. Just rework this by also checking x11->has_mesa/has_nvidia in
the loop so a true value from the previous iteration is preserved.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index e3479ea00c..4ceb7ba3d1 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -422,8 +422,8 @@ static void xrandr_read(struct vo_x11_state *x11) int intel = bstr_find0(provider_name, "intel"); int nvidia = bstr_find0(provider_name, "nvidia"); int radeon = bstr_find0(provider_name, "radeon"); - x11->has_mesa = amd >= 0 || intel >= 0 || radeon >= 0; - x11->has_nvidia = nvidia >= 0; + x11->has_mesa = x11->has_mesa || amd >= 0 || intel >= 0 || radeon >= 0; + x11->has_nvidia = x11->has_nvidia || nvidia >= 0; } XRRFreeProviderResources(pr); } |