Skip to content

Commit

Permalink
x11: don't do DRI3 with Intel drivers
Browse files Browse the repository at this point in the history
Unfortunately i965 and iHD drivers lack DRI3 support.

It's unknown when/if they will gain support, so explicitly disable DRI3
for them - it's not perfect, alas better than asking every affected user
to manually set the environment override.

Signed-off-by: Emil Velikov <[email protected]>
  • Loading branch information
evelikov committed Jul 7, 2023
1 parent 984dfee commit 5c92f27
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion va/x11/va_x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,34 @@ static VAStatus va_DisplayContextGetDriverNames(
{
VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;

if (!getenv("LIBVA_DRI3_DISABLE"))
if (!getenv("LIBVA_DRI3_DISABLE")) {
unsigned old_num_drivers = *num_drivers;

vaStatus = va_DRI3_GetDriverNames(pDisplayContext, drivers, num_drivers);
/* As of 8 July 2023, i965 and iHD drivers lack DRI3 support.
*
* Requests by the community were raised as early as 29 July 2017,
* with DRI3 support landing in libva on the 27 September 2022. At of
* time of writing it's unknown if/when that would materialise.
*
* To handle this on libva level, we are explicitly disabling DRI3
* support on said drivers - it scales better than having every user
* to set the environment override listed above.
*/
if (vaStatus == VA_STATUS_SUCCESS) {
for (unsigned i = 0; i < *num_drivers; i++) {
if (drivers[i] && (!strcmp(drivers[i], "iHD") ||
!strcmp(drivers[i], "i965")))
vaStatus = VA_STATUS_ERROR_UNKNOWN;
}
if (vaStatus == VA_STATUS_ERROR_UNKNOWN) {
for (unsigned i = 0; i < *num_drivers; i++)
free(drivers[i]);
*num_drivers = old_num_drivers;
}
}
}

if (vaStatus != VA_STATUS_SUCCESS)
vaStatus = va_DRI2_GetDriverNames(pDisplayContext, drivers, num_drivers);
#ifdef HAVE_NVCTRL
Expand Down

0 comments on commit 5c92f27

Please sign in to comment.