Some of error messages in RM reference block index, while other print the enum value (which is shifted by 1), not to mention that some of the messages are misleading. Reformat the messages, making them more clear and also always printing the hardware block name.
Signed-off-by: Dmitry Baryshkov <[email protected]> --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index f6568ed8375f..7e77d88f8959 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -315,20 +315,19 @@ static bool _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm, /* Already reserved? */ if (reserved_by_other(global_state->mixer_to_crtc_id, lm_idx, crtc_id)) { - DPU_DEBUG("lm %d already reserved\n", lm_idx + LM_0); + DPU_DEBUG("LM_%d already reserved\n", lm_idx); return false; } lm_cfg = to_dpu_hw_mixer(rm->mixer_blks[lm_idx])->cap; idx = lm_cfg->pingpong - PINGPONG_0; - if (idx < 0 || idx >= ARRAY_SIZE(rm->pingpong_blks)) { - DPU_ERROR("failed to get pp on lm %d\n", lm_cfg->pingpong); + if (idx < 0 || idx >= ARRAY_SIZE(rm->pingpong_blks) || !rm->pingpong_blks[idx]) { + DPU_ERROR("LM_%d, invalid PP_%d\n", lm_idx, idx); return false; } if (reserved_by_other(global_state->pingpong_to_crtc_id, idx, crtc_id)) { - DPU_DEBUG("lm %d pp %d already reserved\n", lm_cfg->id, - lm_cfg->pingpong); + DPU_DEBUG("LM_%d PP_%d already reserved\n", lm_idx, idx); return false; } *pp_idx = idx; @@ -337,14 +336,13 @@ static bool _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm, return true; idx = lm_cfg->dspp - DSPP_0; - if (idx < 0 || idx >= ARRAY_SIZE(rm->dspp_blks)) { - DPU_ERROR("failed to get dspp on lm %d\n", lm_cfg->dspp); + if (idx < 0 || idx >= ARRAY_SIZE(rm->dspp_blks) || !rm->dspp_blks[idx]) { + DPU_ERROR("LM_%d, invalid DSPP_%d\n", lm_idx, idx); return false; } if (reserved_by_other(global_state->dspp_to_crtc_id, idx, crtc_id)) { - DPU_DEBUG("lm %d dspp %d already reserved\n", lm_cfg->id, - lm_cfg->dspp); + DPU_DEBUG("LM_%d DSPP_%d already reserved\n", lm_idx, idx); return false; } *dspp_idx = idx; @@ -364,7 +362,7 @@ static int _dpu_rm_reserve_lms(struct dpu_rm *rm, int i, lm_count = 0; if (!topology->num_lm) { - DPU_ERROR("invalid number of lm: %d\n", topology->num_lm); + DPU_ERROR("zero LMs in topology\n"); return -EINVAL; } @@ -468,13 +466,13 @@ static int _dpu_rm_reserve_ctls( features = ctl->caps->features; has_split_display = BIT(DPU_CTL_SPLIT_DISPLAY) & features; - DPU_DEBUG("ctl %d caps 0x%lX\n", j + CTL_0, features); + DPU_DEBUG("CTL_%d caps 0x%lX\n", j, features); if (needs_split_display != has_split_display) continue; ctl_idx[i] = j; - DPU_DEBUG("ctl %d match\n", j + CTL_0); + DPU_DEBUG("CTL_%d match\n", j); if (++i == num_ctls) break; -- 2.47.3
