mirror of https://github.com/intel/libva-utils.git
va_display_drm: Allow VGEM for WSL2
Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
This commit is contained in:
parent
ab82f899de
commit
ffc0b0dbc4
|
@ -34,6 +34,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
#include "va_display.h"
|
#include "va_display.h"
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
static int drm_fd = -1;
|
static int drm_fd = -1;
|
||||||
extern const char *g_device_name;
|
extern const char *g_device_name;
|
||||||
|
@ -81,7 +82,14 @@ va_open_display_drm(void)
|
||||||
close(drm_fd);
|
close(drm_fd);
|
||||||
continue;
|
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);
|
drmFreeVersion(version);
|
||||||
close(drm_fd);
|
close(drm_fd);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue