[Intel-xe] [PATCH 08/19] drm/xe: Remove dump function from reg_sr

Matt Roper matthew.d.roper at intel.com
Wed Mar 8 22:08:09 UTC 2023


On Tue, Mar 07, 2023 at 01:24:35AM -0800, Lucas De Marchi wrote:
> The dump function was originally added with the idea that it could be
> re-used both for printing the reg-sr data and saving it to pass to GuC
> via ADS. This was not used by the GuC integration, so remove it now to
> give place to a new debug.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_reg_sr.c       | 26 --------------------------
>  drivers/gpu/drm/xe/xe_reg_sr.h       |  2 --
>  drivers/gpu/drm/xe/xe_reg_sr_types.h |  5 -----
>  3 files changed, 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c
> index e4eb18332a9d..194a5060f1b3 100644
> --- a/drivers/gpu/drm/xe/xe_reg_sr.c
> +++ b/drivers/gpu/drm/xe/xe_reg_sr.c
> @@ -43,32 +43,6 @@ int xe_reg_sr_init(struct xe_reg_sr *sr, const char *name, struct xe_device *xe)
>  	return drmm_add_action_or_reset(&xe->drm, reg_sr_fini, sr);
>  }
>  
> -int xe_reg_sr_dump_kv(struct xe_reg_sr *sr,
> -		      struct xe_reg_sr_kv **dst)
> -{
> -	struct xe_reg_sr_kv *iter;
> -	struct xe_reg_sr_entry *entry;
> -	unsigned long idx;
> -
> -	if (xa_empty(&sr->xa)) {
> -		*dst = NULL;
> -		return 0;
> -	}
> -
> -	*dst = kmalloc_array(sr->pool.used, sizeof(**dst), GFP_KERNEL);
> -	if (!*dst)
> -		return -ENOMEM;
> -
> -	iter = *dst;
> -	xa_for_each(&sr->xa, idx, entry) {
> -		iter->k = idx;
> -		iter->v = *entry;
> -		iter++;
> -	}
> -
> -	return 0;
> -}
> -
>  static struct xe_reg_sr_entry *alloc_entry(struct xe_reg_sr *sr)
>  {
>  	if (sr->pool.used == sr->pool.allocated) {
> diff --git a/drivers/gpu/drm/xe/xe_reg_sr.h b/drivers/gpu/drm/xe/xe_reg_sr.h
> index c3a9db251e92..9f47230c8ddc 100644
> --- a/drivers/gpu/drm/xe/xe_reg_sr.h
> +++ b/drivers/gpu/drm/xe/xe_reg_sr.h
> @@ -16,8 +16,6 @@ struct xe_device;
>  struct xe_gt;
>  
>  int xe_reg_sr_init(struct xe_reg_sr *sr, const char *name, struct xe_device *xe);
> -int xe_reg_sr_dump_kv(struct xe_reg_sr *sr,
> -		      struct xe_reg_sr_kv **dst);
>  
>  int xe_reg_sr_add(struct xe_reg_sr *sr, u32 reg,
>  		  const struct xe_reg_sr_entry *e);
> diff --git a/drivers/gpu/drm/xe/xe_reg_sr_types.h b/drivers/gpu/drm/xe/xe_reg_sr_types.h
> index 0e6d542ff1b4..3d2257891005 100644
> --- a/drivers/gpu/drm/xe/xe_reg_sr_types.h
> +++ b/drivers/gpu/drm/xe/xe_reg_sr_types.h
> @@ -23,11 +23,6 @@ struct xe_reg_sr_entry {
>  	u8		reg_type;
>  };
>  
> -struct xe_reg_sr_kv {
> -	u32			k;
> -	struct xe_reg_sr_entry	v;
> -};
> -
>  struct xe_reg_sr {
>  	struct {
>  		struct xe_reg_sr_entry *arr;
> -- 
> 2.39.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list