From a311c031f6fd6194f315dbfdf67f60adfca5d5d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Thu, 9 Feb 2023 10:09:16 -0800 Subject: [PATCH] anv: Implement Xe version of anv_physical_device_get_parameters() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: José Roberto de Souza Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_device.c | 10 +++++++++- src/intel/vulkan/xe/anv_device.c | 10 ++++++++++ src/intel/vulkan/xe/anv_device.h | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 9a23815..2a23bd0 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -793,7 +793,15 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) static VkResult anv_physical_device_get_parameters(struct anv_physical_device *device) { - return anv_i915_physical_device_get_parameters(device); + switch (device->info.kmd_type) { + case INTEL_KMD_TYPE_I915: + return anv_i915_physical_device_get_parameters(device); + case INTEL_KMD_TYPE_XE: + return anv_xe_physical_device_get_parameters(device); + default: + unreachable("Missing"); + return VK_ERROR_UNKNOWN; + } } static VkResult diff --git a/src/intel/vulkan/xe/anv_device.c b/src/intel/vulkan/xe/anv_device.c index 8b85c39..bc3afb2 100644 --- a/src/intel/vulkan/xe/anv_device.c +++ b/src/intel/vulkan/xe/anv_device.c @@ -45,3 +45,13 @@ VkResult anv_xe_device_setup_vm(struct anv_device *device) device->vm_id = create.vm_id; return VK_SUCCESS; } + +VkResult +anv_xe_physical_device_get_parameters(struct anv_physical_device *device) +{ + device->has_exec_timeline = true; + /* TODO: fetch max_context_priority */ + device->max_context_priority = VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR; + + return VK_SUCCESS; +} diff --git a/src/intel/vulkan/xe/anv_device.h b/src/intel/vulkan/xe/anv_device.h index 03d222a..026f5aa 100644 --- a/src/intel/vulkan/xe/anv_device.h +++ b/src/intel/vulkan/xe/anv_device.h @@ -27,6 +27,10 @@ #include "vulkan/vulkan_core.h" struct anv_device; +struct anv_physical_device; bool anv_xe_device_destroy_vm(struct anv_device *device); VkResult anv_xe_device_setup_vm(struct anv_device *device); + +VkResult +anv_xe_physical_device_get_parameters(struct anv_physical_device *device); -- 2.7.4