Skip to content

Commit ffc0b0d

Browse files
sivileridvrogozh
authored andcommitted
va_display_drm: Allow VGEM for WSL2
Signed-off-by: Sil Vilerino <[email protected]>
1 parent ab82f89 commit ffc0b0d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

common/va_display_drm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#endif
3535
#include <xf86drm.h>
3636
#include "va_display.h"
37+
#include <sys/utsname.h>
3738

3839
static int drm_fd = -1;
3940
extern const char *g_device_name;
@@ -81,7 +82,14 @@ va_open_display_drm(void)
8182
close(drm_fd);
8283
continue;
8384
}
84-
if (!strncmp(version->name, "vgem", 4)) {
85+
/* On normal Linux platforms we do not want vgem.
86+
* Yet Windows subsystem for linux uses vgem,
87+
* while also providing a fallback VA driver.
88+
* See https://github.com/intel/libva/pull/688
89+
*/
90+
struct utsname sysinfo = {};
91+
if (!strncmp(version->name, "vgem", 4) && (uname(&sysinfo) >= 0) &&
92+
!strstr(sysinfo.release, "WSL")) {
8593
drmFreeVersion(version);
8694
close(drm_fd);
8795
continue;

0 commit comments

Comments
 (0)