[Intel-xe] [PATCH] drm/xe: Extend query ioctl to expose tile count

Janga Rahul Kumar janga.rahul.kumar at intel.com
Wed Oct 4 08:51:38 UTC 2023


Tile count can be queried by UMD's using the query ioctl.
VM bind ioctl has tile mask param whose valid range can be
determined based on the tile count info.

Cc: Aravind Iddamsetty <aravind.iddamsetty at intel.com>
Cc: Matt Roper <matthew.d.roper at intel.com>
Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
---
 drivers/gpu/drm/xe/xe_query.c | 2 ++
 include/uapi/drm/xe_drm.h     | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index a951205100fe..ada1f26dc1d9 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -200,6 +200,8 @@ static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
 		hweight_long(xe->info.mem_region_mask);
 	config->info[XE_QUERY_CONFIG_MAX_ENGINE_PRIORITY] =
 		xe_exec_queue_device_get_max_priority(xe);
+	config->info[XE_QUERY_CONFIG_TILE_COUNT] =
+		xe->info.tile_count;
 
 	if (copy_to_user(query_ptr, config, size)) {
 		kfree(config);
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index d48d8e3c898c..1d207b5398ae 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -257,7 +257,8 @@ struct drm_xe_query_config {
 #define XE_QUERY_CONFIG_GT_COUNT		4
 #define XE_QUERY_CONFIG_MEM_REGION_COUNT	5
 #define XE_QUERY_CONFIG_MAX_ENGINE_PRIORITY	6
-#define XE_QUERY_CONFIG_NUM_PARAM		(XE_QUERY_CONFIG_MAX_ENGINE_PRIORITY + 1)
+#define XE_QUERY_CONFIG_TILE_COUNT		7
+#define XE_QUERY_CONFIG_NUM_PARAM		(XE_QUERY_CONFIG_TILE_COUNT + 1)
 	/** @info: array of elements containing the config info */
 	__u64 info[];
 };
-- 
2.25.1



More information about the Intel-xe mailing list