@@ -, +, @@ --- files/patch-src_intel_vulkan_anv__gem.c | 24 ++++++++++++++++++++++++ files/patch-src_intel_vulkan_anv__queue.c | 12 +++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 files/patch-src_intel_vulkan_anv__gem.c --- /dev/null +++ graphics/mesa-dri/files/patch-src_intel_vulkan_anv__gem.c @@ -0,0 +1,24 @@ +Try harder to allocate userptr +https://github.com/FreeBSDDesktop/freebsd-base-graphics/issues/132 + +--- src/intel/vulkan/anv_gem.c.orig 2017-09-17 23:03:22 UTC ++++ src/intel/vulkan/anv_gem.c +@@ -114,9 +114,16 @@ 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; ++ } + return 0; ++ } + + return userptr.handle; + } --- graphics/mesa-dri/files/patch-src_intel_vulkan_anv__queue.c +++ graphics/mesa-dri/files/patch-src_intel_vulkan_anv__queue.c @@ -1,4 +1,5 @@ -Drop header that was never used +- Drop header that was never used +- Work around early timeouts with I915_USERPTR_UNSYNCHRONIZED --- src/intel/vulkan/anv_queue.c.orig 2017-08-12 16:09:52 UTC +++ src/intel/vulkan/anv_queue.c @@ -10,3 +11,12 @@ Drop header that was never used #include "anv_private.h" #include "vk_util.h" +@@ -102,7 +102,7 @@ anv_device_submit_simple_batch(struct anv_device *devi + if (result != VK_SUCCESS) + goto fail; + +- result = anv_device_wait(device, &bo, INT64_MAX); ++ result = anv_device_wait(device, &bo, INT32_MAX); + + fail: + anv_bo_pool_free(&device->batch_bo_pool, &bo);