[PATCH v5 1/2] drm/xe/query: Define and use a constant for the number of masks

Dong, Zhanjun zhanjun.dong at intel.com
Mon Mar 25 17:45:25 UTC 2024


LGTM for this patch 1/2

Reviewed-by: Zhanjun Dong <zhanjun.dong at intel.com>

For the 2/2 in this series, I see an CI.Hooks failure you might want to 
check:

+ find drivers/gpu/drm/xe/ -name '*.[ch]' -not -path 
'drivers/gpu/drm/xe/display/*'
+ xargs ./scripts/kernel-doc -Werror -none include/uapi/drm/xe_drm.h
drivers/gpu/drm/xe/xe_gt_types.h:374: warning: Excess struct member 
'l3_bank_mask' description in 'xe_gt'
1 warnings as Errors
run-parts: /workspace/ci/hooks/20-kernel-doc exited with return code 123


On 2024-03-25 7:14 a.m., Francois Dugast wrote:
> Replace a magic value by a constant with an explicit name to make clear
> what it stands for: the number of masks returned by the topology query.
> 
> Suggested-by: Zhanjun Dong <zhanjun.dong at intel.com>
> Signed-off-by: Francois Dugast <francois.dugast at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_query.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
> index df407d73e5f5..109a96212310 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -23,6 +23,8 @@
>   #include "xe_mmio.h"
>   #include "xe_ttm_vram_mgr.h"
>   
> +#define TOPO_NUMBER_OF_MASKS   (3)
> +
>   static const u16 xe_to_user_engine_class[] = {
>   	[XE_ENGINE_CLASS_RENDER] = DRM_XE_ENGINE_CLASS_RENDER,
>   	[XE_ENGINE_CLASS_COPY] = DRM_XE_ENGINE_CLASS_COPY,
> @@ -454,7 +456,8 @@ static int query_hwconfig(struct xe_device *xe,
>   static size_t calc_topo_query_size(struct xe_device *xe)
>   {
>   	return xe->info.gt_count *
> -		(3 * sizeof(struct drm_xe_query_topology_mask) +
> +		(TOPO_NUMBER_OF_MASKS
> +		 * sizeof(struct drm_xe_query_topology_mask) +
>   		 sizeof_field(struct xe_gt, fuse_topo.g_dss_mask) +
>   		 sizeof_field(struct xe_gt, fuse_topo.c_dss_mask) +
>   		 sizeof_field(struct xe_gt, fuse_topo.eu_mask_per_dss));


More information about the Intel-xe mailing list