2023-07-06 20:49:17

by Ryan McCann

[permalink] [raw]
Subject: [PATCH v3 5/6] drm/msm/dpu: Refactor printing of main blocks in device core dump

Currently, the names of main blocks are hardcoded into the
msm_disp_snapshot_add_block function rather than using the name that
already exists in the catalog. Change this to take the name directly from
the catalog instead of hardcoding it.

Signed-off-by: Ryan McCann <[email protected]>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index aa8499de1b9f..70dbb1204e6c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -899,38 +899,38 @@ static void dpu_kms_mdp_snapshot(struct msm_disp_state *disp_state, struct msm_k

/* dump CTL sub-blocks HW regs info */
for (i = 0; i < cat->ctl_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->ctl[i].len,
- dpu_kms->mmio + cat->ctl[i].base, "ctl_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->ctl[i].len, dpu_kms->mmio +
+ cat->ctl[i].base, cat->ctl[i].name);

/* dump DSPP sub-blocks HW regs info */
for (i = 0; i < cat->dspp_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->dspp[i].len,
- dpu_kms->mmio + cat->dspp[i].base, "dspp_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->dspp[i].len, dpu_kms->mmio +
+ cat->dspp[i].base, cat->dspp[i].name);

/* dump INTF sub-blocks HW regs info */
for (i = 0; i < cat->intf_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->intf[i].len,
- dpu_kms->mmio + cat->intf[i].base, "intf_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->intf[i].len, dpu_kms->mmio +
+ cat->intf[i].base, cat->intf[i].name);

/* dump PP sub-blocks HW regs info */
for (i = 0; i < cat->pingpong_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->pingpong[i].len,
- dpu_kms->mmio + cat->pingpong[i].base, "pingpong_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->pingpong[i].len, dpu_kms->mmio +
+ cat->pingpong[i].base, cat->pingpong[i].name);

/* dump SSPP sub-blocks HW regs info */
for (i = 0; i < cat->sspp_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->sspp[i].len,
- dpu_kms->mmio + cat->sspp[i].base, "sspp_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->sspp[i].len, dpu_kms->mmio +
+ cat->sspp[i].base, cat->sspp[i].name);

/* dump LM sub-blocks HW regs info */
for (i = 0; i < cat->mixer_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->mixer[i].len,
- dpu_kms->mmio + cat->mixer[i].base, "lm_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->mixer[i].len, dpu_kms->mmio +
+ cat->mixer[i].base, cat->mixer[i].name);

/* dump WB sub-blocks HW regs info */
for (i = 0; i < cat->wb_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->wb[i].len,
- dpu_kms->mmio + cat->wb[i].base, "wb_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->wb[i].len, dpu_kms->mmio +
+ cat->wb[i].base, cat->wb[i].name);

if (cat->mdp[0].features & BIT(DPU_MDP_PERIPH_0_REMOVED)) {
msm_disp_snapshot_add_block(disp_state, MDP_PERIPH_TOP0,
@@ -944,8 +944,8 @@ static void dpu_kms_mdp_snapshot(struct msm_disp_state *disp_state, struct msm_k

/* dump DSC sub-blocks HW regs info */
for (i = 0; i < cat->dsc_count; i++)
- msm_disp_snapshot_add_block(disp_state, cat->dsc[i].len,
- dpu_kms->mmio + cat->dsc[i].base, "dsc_%d", i);
+ msm_disp_snapshot_add_block(disp_state, cat->dsc[i].len, dpu_kms->mmio +
+ cat->dsc[i].base, cat->dsc[i].name);

pm_runtime_put_sync(&dpu_kms->pdev->dev);
}

--
2.25.1