Commit f7315565 authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe/guc: Reuse code while debugging GuC params

There is no need to duplicate code to print GuC parameters.
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240404155046.627-2-michal.wajdeczko@intel.com
parent 12f95f99
...@@ -180,7 +180,7 @@ static u32 guc_ctl_devid(struct xe_guc *guc) ...@@ -180,7 +180,7 @@ static u32 guc_ctl_devid(struct xe_guc *guc)
return (((u32)xe->info.devid) << 16) | xe->info.revid; return (((u32)xe->info.devid) << 16) | xe->info.revid;
} }
static void guc_init_params(struct xe_guc *guc) static void guc_print_params(struct xe_guc *guc)
{ {
struct xe_gt *gt = guc_to_gt(guc); struct xe_gt *gt = guc_to_gt(guc);
u32 *params = guc->params; u32 *params = guc->params;
...@@ -189,6 +189,14 @@ static void guc_init_params(struct xe_guc *guc) ...@@ -189,6 +189,14 @@ static void guc_init_params(struct xe_guc *guc)
BUILD_BUG_ON(sizeof(guc->params) != GUC_CTL_MAX_DWORDS * sizeof(u32)); BUILD_BUG_ON(sizeof(guc->params) != GUC_CTL_MAX_DWORDS * sizeof(u32));
BUILD_BUG_ON(GUC_CTL_MAX_DWORDS + 2 != SOFT_SCRATCH_COUNT); BUILD_BUG_ON(GUC_CTL_MAX_DWORDS + 2 != SOFT_SCRATCH_COUNT);
for (i = 0; i < GUC_CTL_MAX_DWORDS; i++)
xe_gt_dbg(gt, "GuC param[%2d] = 0x%08x\n", i, params[i]);
}
static void guc_init_params(struct xe_guc *guc)
{
u32 *params = guc->params;
params[GUC_CTL_LOG_PARAMS] = guc_ctl_log_params_flags(guc); params[GUC_CTL_LOG_PARAMS] = guc_ctl_log_params_flags(guc);
params[GUC_CTL_FEATURE] = 0; params[GUC_CTL_FEATURE] = 0;
params[GUC_CTL_DEBUG] = guc_ctl_debug_flags(guc); params[GUC_CTL_DEBUG] = guc_ctl_debug_flags(guc);
...@@ -196,18 +204,12 @@ static void guc_init_params(struct xe_guc *guc) ...@@ -196,18 +204,12 @@ static void guc_init_params(struct xe_guc *guc)
params[GUC_CTL_WA] = 0; params[GUC_CTL_WA] = 0;
params[GUC_CTL_DEVID] = guc_ctl_devid(guc); params[GUC_CTL_DEVID] = guc_ctl_devid(guc);
for (i = 0; i < GUC_CTL_MAX_DWORDS; i++) guc_print_params(guc);
xe_gt_dbg(gt, "GuC param[%2d] = 0x%08x\n", i, params[i]);
} }
static void guc_init_params_post_hwconfig(struct xe_guc *guc) static void guc_init_params_post_hwconfig(struct xe_guc *guc)
{ {
struct xe_gt *gt = guc_to_gt(guc);
u32 *params = guc->params; u32 *params = guc->params;
int i;
BUILD_BUG_ON(sizeof(guc->params) != GUC_CTL_MAX_DWORDS * sizeof(u32));
BUILD_BUG_ON(GUC_CTL_MAX_DWORDS + 2 != SOFT_SCRATCH_COUNT);
params[GUC_CTL_LOG_PARAMS] = guc_ctl_log_params_flags(guc); params[GUC_CTL_LOG_PARAMS] = guc_ctl_log_params_flags(guc);
params[GUC_CTL_FEATURE] = guc_ctl_feature_flags(guc); params[GUC_CTL_FEATURE] = guc_ctl_feature_flags(guc);
...@@ -216,8 +218,7 @@ static void guc_init_params_post_hwconfig(struct xe_guc *guc) ...@@ -216,8 +218,7 @@ static void guc_init_params_post_hwconfig(struct xe_guc *guc)
params[GUC_CTL_WA] = guc_ctl_wa_flags(guc); params[GUC_CTL_WA] = guc_ctl_wa_flags(guc);
params[GUC_CTL_DEVID] = guc_ctl_devid(guc); params[GUC_CTL_DEVID] = guc_ctl_devid(guc);
for (i = 0; i < GUC_CTL_MAX_DWORDS; i++) guc_print_params(guc);
xe_gt_dbg(gt, "GuC param[%2d] = 0x%08x\n", i, params[i]);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment