[Intel-xe] [PATCH v1 1/7] drm/xe/uapi: Remove useless XE_QUERY_CONFIG_NUM_PARAM

Souza, Jose jose.souza at intel.com
Fri Nov 10 15:51:27 UTC 2023


On Fri, 2023-11-10 at 15:41 +0000, Francois Dugast wrote:
> num_params can be used to retrieve the size of the info array
> for the specific version of the kernel being used.
> 
> Signed-off-by: Francois Dugast <francois.dugast at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_query.c | 1 +
>  include/uapi/drm/xe_drm.h     | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
> index 10b9878ec95a..6b1cd5c68a99 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -305,6 +305,7 @@ static int query_memory_usage(struct xe_device *xe,
>  
>  static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
>  {
> +#define XE_QUERY_CONFIG_NUM_PARAM	(XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY + 1)
>  	u32 num_params = XE_QUERY_CONFIG_NUM_PARAM;

There is no reason to keep XE_QUERY_CONFIG_NUM_PARAM.

const u32 num_params = XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY + 1;

With this:
Reviewed-by: José Roberto de Souza <jose.souza at intel.com>

>  	size_t size =
>  		sizeof(struct drm_xe_query_config) + num_params * sizeof(u64);
> diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> index 9bd7092a7ea4..b9a68f8b69f3 100644
> --- a/include/uapi/drm/xe_drm.h
> +++ b/include/uapi/drm/xe_drm.h
> @@ -329,7 +329,6 @@ 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_EXEC_QUEUE_PRIORITY	6
> -#define XE_QUERY_CONFIG_NUM_PARAM		(XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY + 1)
>  	/** @info: array of elements containing the config info */
>  	__u64 info[];
>  };



More information about the Intel-xe mailing list