diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index 76c73918be3..dd694921064 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -210,6 +210,7 @@ struct iris_bufmgr { bool has_local_mem:1; bool has_mmap_offset:1; bool has_tiling_uapi:1; + bool has_userptr_probe:1; bool bo_reuse:1; struct intel_aux_map_context *aux_map_ctx; @@ -707,18 +708,21 @@ iris_bo_create_userptr(struct iris_bufmgr *bufmgr, const char *name, struct drm_i915_gem_userptr arg = { .user_ptr = (uintptr_t)ptr, .user_size = size, + .flags = bufmgr->has_userptr_probe ? I915_USERPTR_PROBE : 0, }; if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_USERPTR, &arg)) goto err_free; bo->gem_handle = arg.handle; - /* Check the buffer for validity before we try and use it in a batch */ - struct drm_i915_gem_set_domain sd = { - .handle = bo->gem_handle, - .read_domains = I915_GEM_DOMAIN_CPU, - }; - if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &sd)) - goto err_close; + if (!bufmgr->has_userptr_probe) { + /* Check the buffer for validity before we try and use it in a batch */ + struct drm_i915_gem_set_domain sd = { + .handle = bo->gem_handle, + .read_domains = I915_GEM_DOMAIN_CPU, + }; + if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &sd)) + goto err_close; + } bo->name = name; bo->size = size; @@ -1774,6 +1778,8 @@ iris_bufmgr_create(struct intel_device_info *devinfo, int fd, bool bo_reuse) bufmgr->has_tiling_uapi = devinfo->has_tiling_uapi; bufmgr->bo_reuse = bo_reuse; bufmgr->has_mmap_offset = gem_param(fd, I915_PARAM_MMAP_GTT_VERSION) >= 4; + bufmgr->has_userptr_probe = + gem_param(fd, I915_PARAM_HAS_USERPTR_PROBE) >= 1; iris_bufmgr_query_meminfo(bufmgr); STATIC_ASSERT(IRIS_MEMZONE_SHADER_START == 0ull);