Skip to content

Commit d97bf83

Browse files
committed
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 <carl.zhang@intel.com>
1 parent f3752ec commit d97bf83

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

va/x11/va_x11.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ static VAStatus va_DisplayContextGetDriverNames(
7777
{
7878
VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
7979

80-
if (!getenv("LIBVA_DRI3_DISABLE"))
80+
vaStatus = va_DRI2_GetDriverNames(pDisplayContext, drivers, num_drivers);
81+
if (!getenv("LIBVA_DRI3_DISABLE") && (vaStatus != VA_STATUS_SUCCESS))
8182
vaStatus = va_DRI3_GetDriverNames(pDisplayContext, drivers, num_drivers);
82-
if (vaStatus != VA_STATUS_SUCCESS)
83-
vaStatus = va_DRI2_GetDriverNames(pDisplayContext, drivers, num_drivers);
8483
#ifdef HAVE_NVCTRL
8584
if (vaStatus != VA_STATUS_SUCCESS)
8685
vaStatus = va_NVCTRL_GetDriverNames(pDisplayContext, drivers, num_drivers);

0 commit comments

Comments
 (0)