Skip to content

Commit f7101b6

Browse files
committed
x11: don't do DRI3 with Intel drivers
Requests for DRI3 have been widely known for over 5 years. DRI3 support landed in libva nearly one year ago and there is seemingly zero interest in adding support to the i965 or iHD drivers. There is MIT licensed code in Mesa to handle all problematic vaPutSurface path (et al), although even if a random volunteer codes forward with a MRs those are very unlikely to get merged. The i965 driver is practically unmaintained at this point, with Intel refusing to throw the towel (officially at least). The iHD one is having some changes done, but only a handful of privileged people within the Intel Org have a _change_ of getting stuff merged. It's quite unfortunate, yet here we are. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
1 parent 984dfee commit f7101b6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

va/x11/va_x11.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,27 @@ 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+
/* Intel drivers lack DRI3 support and they seem uninterested in
85+
* adding one - le sigh.
86+
*/
87+
if (vaStatus == VA_STATUS_SUCCESS) {
88+
for (unsigned i = 0; i < *num_drivers; i++) {
89+
if (drivers[i] && (!strcmp(drivers[i], "iHD") ||
90+
!strcmp(drivers[i], "i965")))
91+
vaStatus = VA_STATUS_ERROR_UNKNOWN;
92+
}
93+
if (vaStatus == VA_STATUS_ERROR_UNKNOWN) {
94+
for (unsigned i = 0; i < *num_drivers; i++)
95+
free(drivers[i]);
96+
*num_drivers = old_num_drivers;
97+
}
98+
}
99+
}
100+
82101
if (vaStatus != VA_STATUS_SUCCESS)
83102
vaStatus = va_DRI2_GetDriverNames(pDisplayContext, drivers, num_drivers);
84103
#ifdef HAVE_NVCTRL

0 commit comments

Comments
 (0)