Skip to content

Commit 5c92f27

Browse files
committed
x11: don't do DRI3 with Intel drivers
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]>
1 parent 984dfee commit 5c92f27

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

va/x11/va_x11.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,34 @@ static VAStatus va_DisplayContextGetDriverNames(
7777
{
7878
VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
7979

80-
if (!getenv("LIBVA_DRI3_DISABLE"))
80+
if (!getenv("LIBVA_DRI3_DISABLE")) {
81+
unsigned old_num_drivers = *num_drivers;
82+
8183
vaStatus = va_DRI3_GetDriverNames(pDisplayContext, drivers, num_drivers);
84+
/* As of 8 July 2023, i965 and iHD drivers lack DRI3 support.
85+
*
86+
* Requests by the community were raised as early as 29 July 2017,
87+
* with DRI3 support landing in libva on the 27 September 2022. At of
88+
* time of writing it's unknown if/when that would materialise.
89+
*
90+
* To handle this on libva level, we are explicitly disabling DRI3
91+
* support on said drivers - it scales better than having every user
92+
* to set the environment override listed above.
93+
*/
94+
if (vaStatus == VA_STATUS_SUCCESS) {
95+
for (unsigned i = 0; i < *num_drivers; i++) {
96+
if (drivers[i] && (!strcmp(drivers[i], "iHD") ||
97+
!strcmp(drivers[i], "i965")))
98+
vaStatus = VA_STATUS_ERROR_UNKNOWN;
99+
}
100+
if (vaStatus == VA_STATUS_ERROR_UNKNOWN) {
101+
for (unsigned i = 0; i < *num_drivers; i++)
102+
free(drivers[i]);
103+
*num_drivers = old_num_drivers;
104+
}
105+
}
106+
}
107+
82108
if (vaStatus != VA_STATUS_SUCCESS)
83109
vaStatus = va_DRI2_GetDriverNames(pDisplayContext, drivers, num_drivers);
84110
#ifdef HAVE_NVCTRL

0 commit comments

Comments
 (0)