From: José Roberto de Souza Date: Thu, 9 Feb 2023 16:13:14 +0000 (-0800) Subject: intel/dev: Implement Xe functions to handle hwconfig X-Git-Tag: upstream/23.3.3~12249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b81a80f550061d7a5f1b39757160d00b9985ce0;p=platform%2Fupstream%2Fmesa.git intel/dev: Implement Xe functions to handle hwconfig Signed-off-by: José Roberto de Souza Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/intel/dev/xe/intel_device_info.c b/src/intel/dev/xe/intel_device_info.c index 6c8f0b1..d726b14 100644 --- a/src/intel/dev/xe/intel_device_info.c +++ b/src/intel/dev/xe/intel_device_info.c @@ -25,6 +25,7 @@ #include "common/intel_gem.h" #include "dev/intel_device_info.h" +#include "dev/intel_hwconfig.h" #include "util/log.h" @@ -141,6 +142,19 @@ xe_query_gts(int fd, struct intel_device_info *devinfo) return true; } +static bool +xe_query_hwconfig(int fd, struct intel_device_info *devinfo) +{ + int32_t len; + void *data = xe_query_alloc_fetch(fd, DRM_XE_DEVICE_QUERY_HWCONFIG, &len); + if (!data) + return false; + + bool ret = intel_hwconfig_process_table(devinfo, data, len); + free(data); + return ret; +} + bool intel_device_info_xe_get_info_from_fd(int fd, struct intel_device_info *devinfo) { @@ -153,6 +167,9 @@ intel_device_info_xe_get_info_from_fd(int fd, struct intel_device_info *devinfo) if (!xe_query_gts(fd, devinfo)) return false; + if (xe_query_hwconfig(fd, devinfo)) + intel_device_info_update_after_hwconfig(devinfo); + devinfo->has_context_isolation = true; devinfo->has_mmap_offset = true; devinfo->has_caching_uapi = false;