--- files/patch-src_intel_vulkan_anv__gem.c (revision 527733) +++ files/patch-src_intel_vulkan_anv__gem.c (working copy) @@ -1,6 +1,6 @@ - Define ETIME if missing ---- src/intel/vulkan/anv_gem.c.orig 2017-10-23 13:21:18 UTC +--- src/intel/vulkan/anv_gem.c.orig 2019-01-17 11:26:23 UTC +++ src/intel/vulkan/anv_gem.c @@ -26,6 +26,9 @@ #include @@ -12,3 +12,25 @@ #include #include +@@ -116,9 +119,19 @@ anv_gem_userptr(struct anv_device *device, void *mem, + .flags = 0, + }; + +- int ret = anv_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); +- if (ret == -1) ++ int ret; ++retry: ++ ret = anv_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); ++ if (ret == -1) { ++ if (errno == ENODEV && userptr.flags == 0) { ++ userptr.flags = I915_USERPTR_UNSYNCHRONIZED; ++ goto retry; ++ } ++ if (geteuid() != 0) { ++ fprintf(stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n"); ++ } + return 0; ++ } + + return userptr.handle; + }