View | Details | Raw Unified | Return to bug 221540 | Differences between
and this patch

Collapse All | Expand All

(-)b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__gem.c (+21 lines)
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
 }
(-)b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__queue.c (+10 lines)
Lines 1-5 Link Here
1
- Define ETIME if missing
1
- Define ETIME if missing
2
- Drop header that was never used
2
- Drop header that was never used
3
- Work around early timeouts with I915_USERPTR_UNSYNCHRONIZED
3
4
4
--- src/intel/vulkan/anv_queue.c.orig	2017-10-23 13:21:18 UTC
5
--- src/intel/vulkan/anv_queue.c.orig	2017-10-23 13:21:18 UTC
5
+++ src/intel/vulkan/anv_queue.c
6
+++ src/intel/vulkan/anv_queue.c
Lines 16-18 Link Here
16
 
17
 
17
 #include "anv_private.h"
18
 #include "anv_private.h"
18
 #include "vk_util.h"
19
 #include "vk_util.h"
20
@@ -102,7 +102,7 @@ anv_device_submit_simple_batch(struct anv_device *devi
21
    if (result != VK_SUCCESS)
22
       goto fail;
23
 
24
-   result = anv_device_wait(device, &bo, INT64_MAX);
25
+   result = anv_device_wait(device, &bo, INT32_MAX);
26
 
27
  fail:
28
    anv_bo_pool_free(&device->batch_bo_pool, &bo);

Return to bug 221540