anv: Use I915_USERPTR_PROBE when available

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12044>
This commit is contained in:
Jason Ekstrand
2021-07-23 12:45:47 -05:00
parent 9feb57a85e
commit b8e2214ee5
3 changed files with 7 additions and 0 deletions

View File

@@ -890,6 +890,9 @@ anv_physical_device_try_create(struct anv_instance *instance,
device->has_mmap_offset =
anv_gem_get_param(fd, I915_PARAM_MMAP_GTT_VERSION) >= 4;
device->has_userptr_probe =
anv_gem_get_param(fd, I915_PARAM_HAS_USERPTR_PROBE);
/* GENs prior to 8 do not support EU/Subslice info */
device->subslice_total = intel_device_info_subslice_total(&device->info);

View File

@@ -173,6 +173,9 @@ anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
.flags = 0,
};
if (device->physical->has_userptr_probe)
userptr.flags |= I915_USERPTR_PROBE;
int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr);
if (ret == -1)
return 0;

View File

@@ -928,6 +928,7 @@ struct anv_physical_device {
bool has_thread_submit;
bool has_mem_available;
bool has_mmap_offset;
bool has_userptr_probe;
uint64_t gtt_size;
bool use_softpin;