From d97bf83dc848762e20cb2bff51c9b6573a8f1eb4 Mon Sep 17 00:00:00 2001 From: Carl Zhang Date: Fri, 9 Jun 2023 04:22:24 -0400 Subject: [PATCH] change the try order of DRI2 and DRI3 try DRI2 firstly, if suecess, it could detect driver name , also could use vaPutSurfaces. if failed , try DRI3, it only support driver name detection could not use vaPutSurfaces. if there are both DRI2 and DRI3 it could ensure vaPutSurfaces work Signed-off-by: Carl Zhang --- va/x11/va_x11.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c index 242e6e7c3..60fa9a59c 100644 --- a/va/x11/va_x11.c +++ b/va/x11/va_x11.c @@ -77,10 +77,9 @@ static VAStatus va_DisplayContextGetDriverNames( { VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN; - if (!getenv("LIBVA_DRI3_DISABLE")) + vaStatus = va_DRI2_GetDriverNames(pDisplayContext, drivers, num_drivers); + if (!getenv("LIBVA_DRI3_DISABLE") && (vaStatus != VA_STATUS_SUCCESS)) vaStatus = va_DRI3_GetDriverNames(pDisplayContext, drivers, num_drivers); - if (vaStatus != VA_STATUS_SUCCESS) - vaStatus = va_DRI2_GetDriverNames(pDisplayContext, drivers, num_drivers); #ifdef HAVE_NVCTRL if (vaStatus != VA_STATUS_SUCCESS) vaStatus = va_NVCTRL_GetDriverNames(pDisplayContext, drivers, num_drivers);