intel/dev: Implement Xe functions to handle hwconfig
authorJosé Roberto de Souza <jose.souza@intel.com>
Thu, 9 Feb 2023 16:13:14 +0000 (08:13 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 3 Mar 2023 05:25:35 +0000 (05:25 +0000)
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>

src/intel/dev/xe/intel_device_info.c

index 6c8f0b1..d726b14 100644 (file)
@@ -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;