Date: Sat, 16 May 2026 19:03:18 +0000 From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 790329e9a522 - main - graphics/mesa-devel: drop userptr workaround after 2ad6d0d7f8fc Message-ID: <6a08bf76.27579.4389627f@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=790329e9a5227f380e4f86e9c48f196199daa2a7 commit 790329e9a5227f380e4f86e9c48f196199daa2a7 Author: Jan Beich <jbeich@FreeBSD.org> AuthorDate: 2026-05-16 18:12:12 +0000 Commit: Jan Beich <jbeich@FreeBSD.org> CommitDate: 2026-05-16 19:02:06 +0000 graphics/mesa-devel: drop userptr workaround after 2ad6d0d7f8fc UNSYNCHRONIZED doesn't work on FreeBSD since drm-515-kmod. https://github.com/torvalds/linux/commit/c6bcc0c2fdfd This reverts commit 058e5ba0ff29ae64383b8392f23facad616be8c9. PR: 244877 --- graphics/mesa-devel/Makefile | 2 +- graphics/mesa-devel/files/patch-userptr | 100 -------------------------------- 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/graphics/mesa-devel/Makefile b/graphics/mesa-devel/Makefile index c684b489def2..d879a3078a3e 100644 --- a/graphics/mesa-devel/Makefile +++ b/graphics/mesa-devel/Makefile @@ -1,7 +1,7 @@ PORTNAME= mesa DISTVERSION= 26.1-branchpoint-1298 DISTVERSIONSUFFIX= -gf6debb842d7 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics PKGNAMESUFFIX= -devel diff --git a/graphics/mesa-devel/files/patch-userptr b/graphics/mesa-devel/files/patch-userptr deleted file mode 100644 index 7c94dba02122..000000000000 --- a/graphics/mesa-devel/files/patch-userptr +++ /dev/null @@ -1,100 +0,0 @@ -Try unsynchronized userptr if regular one fails. -https://github.com/FreeBSDDesktop/kms-drm/issues/197 -https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13162 - ---- src/gallium/drivers/crocus/crocus_bufmgr.c.orig 2023-07-19 23:28:31 UTC -+++ src/gallium/drivers/crocus/crocus_bufmgr.c -@@ -487,8 +487,20 @@ crocus_bo_create_userptr(struct crocus_bufmgr *bufmgr, - .user_ptr = (uintptr_t)ptr, - .user_size = size, - }; -- if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_USERPTR, &arg)) -+ -+ int ret; -+retry: -+ ret = intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_USERPTR, &arg); -+ if (ret) { -+ if (errno == ENODEV && arg.flags == 0) { -+ arg.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"); -+ } - goto err_free; -+ } - bo->gem_handle = arg.handle; - - /* Check the buffer for validity before we try and use it in a batch */ ---- 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 = devinfo->has_userptr_probe ? I915_USERPTR_PROBE : 0, - }; -- if (intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_I915_GEM_USERPTR, &arg)) -+ -+ int ret; -+retry: -+ 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; -+ goto retry; -+ } -+ if (geteuid() != 0) { -+ fprintf(stderr, "%s", "ioctl(I915_GEM_USERPTR) failed. Try running as root but expect poor stability.\n"); -+ } - return 0; -+ } - - 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, - if (device->physical->info.has_userptr_probe) - userptr.flags |= I915_USERPTR_PROBE; - -- int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); -- if (ret == -1) -+ int ret; -+retry: -+ ret = intel_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; - } ---- src/intel/vulkan/i915/anv_kmd_backend.c.orig 2023-07-19 23:28:31 UTC -+++ src/intel/vulkan/i915/anv_kmd_backend.c -@@ -191,9 +191,19 @@ i915_gem_create_userptr(struct anv_device *device, voi - if (device->physical->info.has_userptr_probe) - userptr.flags |= I915_USERPTR_PROBE; - -- int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); -- if (ret == -1) -+ int ret; -+retry: -+ ret = intel_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; - }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a08bf76.27579.4389627f>
