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:

committed by
Marge Bot

parent
e9eceb1106
commit
d5d1331381
@@ -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->has_tiling_uapi = devinfo->has_tiling_uapi;
|
||||||
bufmgr->bo_reuse = bo_reuse;
|
bufmgr->bo_reuse = bo_reuse;
|
||||||
bufmgr->has_mmap_offset = devinfo->has_mmap_offset;
|
bufmgr->has_mmap_offset = devinfo->has_mmap_offset;
|
||||||
int val;
|
bufmgr->has_userptr_probe = devinfo->has_userptr_probe;
|
||||||
if (intel_gem_get_param(fd, I915_PARAM_HAS_USERPTR_PROBE, &val) && val >= 1)
|
|
||||||
bufmgr->has_userptr_probe = true;
|
|
||||||
iris_bufmgr_get_meminfo(bufmgr, devinfo);
|
iris_bufmgr_get_meminfo(bufmgr, devinfo);
|
||||||
bufmgr->all_vram_mappable = intel_vram_all_mappable(devinfo);
|
bufmgr->all_vram_mappable = intel_vram_all_mappable(devinfo);
|
||||||
|
|
||||||
|
@@ -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))
|
if (getparam(fd, I915_PARAM_MMAP_GTT_VERSION, &val))
|
||||||
devinfo->has_mmap_offset = val >= 4;
|
devinfo->has_mmap_offset = val >= 4;
|
||||||
|
if (getparam(fd, I915_PARAM_HAS_USERPTR_PROBE, &val))
|
||||||
|
devinfo->has_userptr_probe = val;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -147,6 +147,7 @@ struct intel_device_info
|
|||||||
bool has_lsc;
|
bool has_lsc;
|
||||||
bool has_mesh_shading;
|
bool has_mesh_shading;
|
||||||
bool has_mmap_offset;
|
bool has_mmap_offset;
|
||||||
|
bool has_userptr_probe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \name Intel hardware quirks
|
* \name Intel hardware quirks
|
||||||
|
@@ -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))
|
if (intel_gem_get_param(fd, I915_PARAM_HAS_EXEC_TIMELINE_FENCES, &val))
|
||||||
device->has_exec_timeline = 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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -176,7 +176,7 @@ anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
|
|||||||
.flags = 0,
|
.flags = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (device->physical->has_userptr_probe)
|
if (device->physical->info.has_userptr_probe)
|
||||||
userptr.flags |= I915_USERPTR_PROBE;
|
userptr.flags |= I915_USERPTR_PROBE;
|
||||||
|
|
||||||
int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr);
|
int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr);
|
||||||
|
@@ -964,7 +964,6 @@ struct anv_physical_device {
|
|||||||
bool has_exec_capture;
|
bool has_exec_capture;
|
||||||
VkQueueGlobalPriorityKHR max_context_priority;
|
VkQueueGlobalPriorityKHR max_context_priority;
|
||||||
bool has_context_isolation;
|
bool has_context_isolation;
|
||||||
bool has_userptr_probe;
|
|
||||||
uint64_t gtt_size;
|
uint64_t gtt_size;
|
||||||
|
|
||||||
bool always_use_bindless;
|
bool always_use_bindless;
|
||||||
|
@@ -882,9 +882,6 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
|
|||||||
device->always_flush_cache = INTEL_DEBUG(DEBUG_STALL) ||
|
device->always_flush_cache = INTEL_DEBUG(DEBUG_STALL) ||
|
||||||
driQueryOptionb(&instance->dri_options, "always_flush_cache");
|
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);
|
device->compiler = brw_compiler_create(NULL, &device->info);
|
||||||
if (device->compiler == NULL) {
|
if (device->compiler == NULL) {
|
||||||
result = vk_error(instance, VK_ERROR_OUT_OF_HOST_MEMORY);
|
result = vk_error(instance, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||||
|
@@ -147,7 +147,7 @@ anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
|
|||||||
.flags = 0,
|
.flags = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (device->physical->has_userptr_probe)
|
if (device->physical->info.has_userptr_probe)
|
||||||
userptr.flags |= I915_USERPTR_PROBE;
|
userptr.flags |= I915_USERPTR_PROBE;
|
||||||
|
|
||||||
int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr);
|
int ret = intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr);
|
||||||
|
@@ -963,7 +963,6 @@ struct anv_physical_device {
|
|||||||
bool has_exec_capture;
|
bool has_exec_capture;
|
||||||
int max_context_priority;
|
int max_context_priority;
|
||||||
bool has_context_isolation;
|
bool has_context_isolation;
|
||||||
bool has_userptr_probe;
|
|
||||||
uint64_t gtt_size;
|
uint64_t gtt_size;
|
||||||
|
|
||||||
bool use_relocations;
|
bool use_relocations;
|
||||||
|
Reference in New Issue
Block a user