intel: Add has_userptr_probe to intel_device_info

Iris, hasvk and anv were fetching the same information, better do it
on one place.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19425>
This commit is contained in:
José Roberto de Souza
2022-10-06 10:15:54 -07:00
committed by Marge Bot
parent e9eceb1106
commit d5d1331381
9 changed files with 6 additions and 13 deletions

View File

@@ -2409,9 +2409,7 @@ 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 = devinfo->has_mmap_offset;
int val;
if (intel_gem_get_param(fd, I915_PARAM_HAS_USERPTR_PROBE, &val) && val >= 1)
bufmgr->has_userptr_probe = true;
bufmgr->has_userptr_probe = devinfo->has_userptr_probe;
iris_bufmgr_get_meminfo(bufmgr, devinfo);
bufmgr->all_vram_mappable = intel_vram_all_mappable(devinfo);

View File

@@ -2006,6 +2006,8 @@ intel_i915_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
if (getparam(fd, I915_PARAM_MMAP_GTT_VERSION, &val))
devinfo->has_mmap_offset = val >= 4;
if (getparam(fd, I915_PARAM_HAS_USERPTR_PROBE, &val))
devinfo->has_userptr_probe = val;
return true;
}

View File

@@ -147,6 +147,7 @@ struct intel_device_info
bool has_lsc;
bool has_mesh_shading;
bool has_mmap_offset;
bool has_userptr_probe;
/**
* \name Intel hardware quirks

View File

@@ -799,9 +799,6 @@ anv_i915_physical_device_get_parameters(struct anv_physical_device *device)
if (intel_gem_get_param(fd, I915_PARAM_HAS_EXEC_TIMELINE_FENCES, &val))
device->has_exec_timeline = val;
if (intel_gem_get_param(fd, I915_PARAM_HAS_USERPTR_PROBE, &val))
device->has_userptr_probe = val;
return result;
}

View File

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

View File

@@ -964,7 +964,6 @@ struct anv_physical_device {
bool has_exec_capture;
VkQueueGlobalPriorityKHR max_context_priority;
bool has_context_isolation;
bool has_userptr_probe;
uint64_t gtt_size;
bool always_use_bindless;

View File

@@ -882,9 +882,6 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
device->always_flush_cache = INTEL_DEBUG(DEBUG_STALL) ||
driQueryOptionb(&instance->dri_options, "always_flush_cache");
if (intel_gem_get_param(fd, I915_PARAM_HAS_USERPTR_PROBE, &val))
device->has_userptr_probe = val;
device->compiler = brw_compiler_create(NULL, &device->info);
if (device->compiler == NULL) {
result = vk_error(instance, VK_ERROR_OUT_OF_HOST_MEMORY);

View File

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

View File

@@ -963,7 +963,6 @@ struct anv_physical_device {
bool has_exec_capture;
int max_context_priority;
bool has_context_isolation;
bool has_userptr_probe;
uint64_t gtt_size;
bool use_relocations;