Lines 1-4
Link Here
|
1 |
- Define ETIME if missing |
1 |
- Define ETIME if missing |
|
|
2 |
- Try harder to allocate userptr, see |
3 |
https://github.com/FreeBSDDesktop/freebsd-base-graphics/issues/132 |
2 |
|
4 |
|
3 |
--- src/intel/vulkan/anv_gem.c.orig 2017-10-23 13:21:18 UTC |
5 |
--- src/intel/vulkan/anv_gem.c.orig 2017-10-23 13:21:18 UTC |
4 |
+++ src/intel/vulkan/anv_gem.c |
6 |
+++ src/intel/vulkan/anv_gem.c |
Lines 12-14
Link Here
|
12 |
#include <unistd.h> |
14 |
#include <unistd.h> |
13 |
#include <fcntl.h> |
15 |
#include <fcntl.h> |
14 |
|
16 |
|
|
|
17 |
@@ -114,9 +114,16 @@ anv_gem_userptr(struct anv_device *device, void *mem, |
18 |
.flags = 0, |
19 |
}; |
20 |
|
21 |
- int ret = anv_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); |
22 |
- if (ret == -1) |
23 |
+ int ret; |
24 |
+retry: |
25 |
+ ret = anv_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); |
26 |
+ if (ret == -1) { |
27 |
+ if (errno == ENODEV && userptr.flags == 0) { |
28 |
+ userptr.flags = I915_USERPTR_UNSYNCHRONIZED; |
29 |
+ goto retry; |
30 |
+ } |
31 |
return 0; |
32 |
+ } |
33 |
|
34 |
return userptr.handle; |
35 |
} |