From 0727c07fc816ec0a52986710079aa9e72c834dbd Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 1 Mar 2016 14:51:09 +0100 Subject: [PATCH] [RFC] Return early if vdpau_driver isn't autodetected with DRI2 This patch will return early if vdpau_driver isn't automatically detected with dri2. This is specially needed when nvidia is attempted as a fallback under wayland. This patch is RFC because: - Older xorg-server might not have dri2 vdpau autodetection so falling back to nvidia might still make sense there. But older - There is a need to implement a way to properly detect the vdpau backend if under Xwayland Previously reported as https://bugzilla.redhat.com/1305699 Signed-off-by: Nicolas Chauvet --- src/vdpau_wrapper.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vdpau_wrapper.c b/src/vdpau_wrapper.c index 79dcb94..5668bef 100644 --- a/src/vdpau_wrapper.c +++ b/src/vdpau_wrapper.c @@ -128,8 +128,17 @@ static VdpStatus _vdp_open_driver( vdpau_driver = vdpau_driver_dri2 = _vdp_get_driver_name_from_dri2(display, screen); } + + /* Don't allow vdpau_driver to fallback to nvidia as previously done, + * This helps when we can't fetch dri2 driver name because wayland */ if (!vdpau_driver) { - vdpau_driver = "nvidia"; + fprintf(stdout, "No vdpau backend found, try to set one using VDPAU_DRIVER=nvidia\n"); + if (vdpau_driver_dri2) { + XFree(vdpau_driver_dri2); + vdpau_driver_dri2 = NULL; + } + _VDP_ERROR_BREAKPOINT() + return VDP_STATUS_NO_IMPLEMENTATION; } /* Don't allow setuid apps to use VDPAU_DRIVER_PATH */ -- 2.7.4