From f647eff1725430dd835ac05a9f8f1661e2765f8e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi <lucas.demarchi@intel.com> Date: Wed, 1 Mar 2023 01:31:08 -0800 Subject: [PATCH] drm/xe: Remove dump function from reg_sr 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@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@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 d67516469710..b2370241ebf9 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;