[Intel-xe] [RFC v1 07/17] drm/xe: Remove useless query config num_params
Francois Dugast
francois.dugast at intel.com
Wed Oct 11 13:59:16 UTC 2023
num_params is only used to represent the number of query types.
Removing it as it is useless and should not be used.
Signed-off-by: Francois Dugast <francois.dugast at intel.com>
---
drivers/gpu/drm/xe/xe_query.c | 6 +++---
include/uapi/drm/xe_drm.h | 7 -------
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 00a8aa7668de..5365331e452c 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -305,9 +305,10 @@ static int query_memory_usage(struct xe_device *xe,
static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
{
- u32 num_params = XE_QUERY_CONFIG_NUM_PARAM;
+#define XE_QUERY_CONFIG_NUM_PARAM (XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY + 1)
size_t size =
- sizeof(struct drm_xe_query_config) + num_params * sizeof(u64);
+ sizeof(struct drm_xe_query_config)
+ + XE_QUERY_CONFIG_NUM_PARAM * sizeof(u64);
struct drm_xe_query_config __user *query_ptr =
u64_to_user_ptr(query->data);
struct drm_xe_query_config *config;
@@ -323,7 +324,6 @@ static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
if (!config)
return -ENOMEM;
- config->num_params = num_params;
config->info[XE_QUERY_CONFIG_REV_AND_DEVICE_ID] =
xe->info.devid | (xe->info.revid << 16);
if (xe_device_get_root_tile(xe)->mem.vram.usable_size)
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 8d5bd2b9c408..b3dcd7c6f2e5 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -315,9 +315,6 @@ struct drm_xe_query_mem_usage {
* struct drm_xe_query_config in .data.
*/
struct drm_xe_query_config {
- /** @num_params: number of parameters returned in info */
- __u32 num_params;
-
/** @pad: MBZ */
__u32 pad;
@@ -355,10 +352,6 @@ struct drm_xe_query_config {
* Value of the highest available exec queue priority
*/
#define XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 6
- /*
- * Number of elements in the info array
- */
-#define XE_QUERY_CONFIG_NUM_PARAM (XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY + 1)
/** @info: array of elements containing the config info */
__u64 info[];
};
--
2.34.1
More information about the Intel-xe
mailing list