Skip to content

Commit

Permalink
change the try order of DRI2 and DRI3
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
XinfengZhang committed Jun 9, 2023
1 parent f3752ec commit d97bf83
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions va/x11/va_x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d97bf83

Please sign in to comment.