Skip to content

Commit

Permalink
va_display_drm: Allow VGEM for WSL2
Browse files Browse the repository at this point in the history
Signed-off-by: Sil Vilerino <[email protected]>
  • Loading branch information
sivileri authored and dvrogozh committed Feb 15, 2023
1 parent ab82f89 commit ffc0b0d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion common/va_display_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#endif
#include <xf86drm.h>
#include "va_display.h"
#include <sys/utsname.h>

static int drm_fd = -1;
extern const char *g_device_name;
Expand Down Expand Up @@ -81,7 +82,14 @@ va_open_display_drm(void)
close(drm_fd);
continue;
}
if (!strncmp(version->name, "vgem", 4)) {
/* On normal Linux platforms we do not want vgem.
* Yet Windows subsystem for linux uses vgem,
* while also providing a fallback VA driver.
* See https://github.com/intel/libva/pull/688
*/
struct utsname sysinfo = {};
if (!strncmp(version->name, "vgem", 4) && (uname(&sysinfo) >= 0) &&
!strstr(sysinfo.release, "WSL")) {
drmFreeVersion(version);
close(drm_fd);
continue;
Expand Down

0 comments on commit ffc0b0d

Please sign in to comment.