summaryrefslogtreecommitdiff
path: root/graphics/mesa-devel/files/patch-userptr
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/mesa-devel/files/patch-userptr')
-rw-r--r--graphics/mesa-devel/files/patch-userptr18
1 files changed, 9 insertions, 9 deletions
diff --git a/graphics/mesa-devel/files/patch-userptr b/graphics/mesa-devel/files/patch-userptr
index eb4193ce8674..7c94dba02122 100644
--- a/graphics/mesa-devel/files/patch-userptr
+++ b/graphics/mesa-devel/files/patch-userptr
@@ -26,17 +26,17 @@ https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13162
bo->gem_handle = arg.handle;
/* Check the buffer for validity before we try and use it in a batch */
---- src/gallium/drivers/iris/iris_bufmgr.c.orig 2023-07-19 23:28:31 UTC
-+++ src/gallium/drivers/iris/iris_bufmgr.c
-@@ -1314,8 +1314,20 @@ iris_bo_create_userptr(struct iris_bufmgr *bufmgr, con
+--- src/gallium/drivers/iris/i915/iris_kmd_backend.c.orig 2023-07-31 18:56:34 UTC
++++ src/gallium/drivers/iris/i915/iris_kmd_backend.c
+@@ -430,8 +430,20 @@ i915_gem_create_userptr(struct iris_bufmgr *bufmgr, vo
.user_size = size,
- .flags = bufmgr->devinfo.has_userptr_probe ? I915_USERPTR_PROBE : 0,
+ .flags = devinfo->has_userptr_probe ? I915_USERPTR_PROBE : 0,
};
-- if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_USERPTR, &arg))
+- if (intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_I915_GEM_USERPTR, &arg))
+
+ int ret;
+retry:
-+ ret = intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_USERPTR, &arg);
++ ret = intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_I915_GEM_USERPTR, &arg);
+ if (ret) {
+ if (errno == ENODEV && arg.flags == 0) {
+ arg.flags = I915_USERPTR_UNSYNCHRONIZED;
@@ -45,11 +45,11 @@ https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13162
+ if (geteuid() != 0) {
+ fprintf(stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n");
+ }
- goto err_free;
+ return 0;
+ }
- bo->gem_handle = arg.handle;
- if (!bufmgr->devinfo.has_userptr_probe) {
+ if (!devinfo->has_userptr_probe) {
+ /* Check the buffer for validity before we try and use it in a batch */
--- src/intel/vulkan_hasvk/anv_gem.c.orig 2023-07-19 23:28:31 UTC
+++ src/intel/vulkan_hasvk/anv_gem.c
@@ -150,9 +150,19 @@ anv_gem_userptr(struct anv_device *device, void *mem,