intel: Add has_context_isolation 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:33:24 -07:00
committed by Marge Bot
parent d5d1331381
commit 29550bc50a
9 changed files with 8 additions and 14 deletions

View File

@@ -784,8 +784,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
*
* Checking the last feature availability will include all previous ones.
*/
int v;
if (!intel_gem_get_param(fd, I915_PARAM_HAS_CONTEXT_ISOLATION, &v) || !v) {
if (!screen->devinfo.has_context_isolation) {
debug_error("Kernel is too old (4.16+ required) or unusable for Iris.\n"
"Check your dmesg logs for loading failures.\n");
return NULL;

View File

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

View File

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

View File

@@ -793,9 +793,6 @@ anv_i915_physical_device_get_parameters(struct anv_physical_device *device)
device->max_context_priority = priorities[i];
}
if (intel_gem_get_param(fd, I915_PARAM_HAS_CONTEXT_ISOLATION, &val))
device->has_context_isolation = val;
if (intel_gem_get_param(fd, I915_PARAM_HAS_EXEC_TIMELINE_FENCES, &val))
device->has_exec_timeline = val;
@@ -956,7 +953,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
device->compiler->shader_debug_log = compiler_debug_log;
device->compiler->shader_perf_log = compiler_perf_log;
device->compiler->constant_buffer_0_is_relative =
!device->has_context_isolation;
!device->info.has_context_isolation;
device->compiler->supports_shader_constants = true;
device->compiler->indirect_ubos_use_sampler = device->info.ver < 12;

View File

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

View File

@@ -424,7 +424,7 @@ init_render_queue_state(struct anv_queue *queue)
*
* This is only safe on kernels with context isolation support.
*/
if (device->physical->has_context_isolation) {
if (device->physical->info.has_context_isolation) {
anv_batch_write_reg(&batch, GENX(CS_DEBUG_MODE2), csdm2) {
csdm2.CONSTANT_BUFFERAddressOffsetDisable = true;
csdm2.CONSTANT_BUFFERAddressOffsetDisableMask = true;

View File

@@ -819,9 +819,6 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
assert(device->supports_48bit_addresses == !device->use_relocations);
device->use_softpin = !device->use_relocations;
if (intel_gem_get_param(fd, I915_PARAM_HAS_CONTEXT_ISOLATION, &val))
device->has_context_isolation = val;
if (intel_gem_get_param(fd, I915_PARAM_HAS_EXEC_TIMELINE_FENCES, &val))
device->has_exec_timeline = val;
if (debug_get_bool_option("ANV_QUEUE_THREAD_DISABLE", false))
@@ -890,7 +887,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
device->compiler->shader_debug_log = compiler_debug_log;
device->compiler->shader_perf_log = compiler_perf_log;
device->compiler->constant_buffer_0_is_relative =
device->info.ver < 8 || !device->has_context_isolation;
device->info.ver < 8 || !device->info.has_context_isolation;
device->compiler->supports_shader_constants = true;
device->compiler->indirect_ubos_use_sampler = device->info.ver < 12;

View File

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

View File

@@ -387,7 +387,7 @@ init_render_queue_state(struct anv_queue *queue)
*
* This is only safe on kernels with context isolation support.
*/
if (GFX_VER >= 8 && device->physical->has_context_isolation) {
if (GFX_VER >= 8 && device->physical->info.has_context_isolation) {
#if GFX_VER >= 9
anv_batch_write_reg(&batch, GENX(CS_DEBUG_MODE2), csdm2) {
csdm2.CONSTANT_BUFFERAddressOffsetDisable = true;