Skip to content

Commit 98c8f14

Browse files
committed
drm/msm/dpu: correct error messages in RM
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 <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/698774/ Link: https://lore.kernel.org/r/20260115-dpu-fix-dspp-v1-1-b73152c147b3@oss.qualcomm.com
1 parent 83fe2cd commit 98c8f14

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,20 +315,19 @@ static bool _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm,
315315

316316
/* Already reserved? */
317317
if (reserved_by_other(global_state->mixer_to_crtc_id, lm_idx, crtc_id)) {
318-
DPU_DEBUG("lm %d already reserved\n", lm_idx + LM_0);
318+
DPU_DEBUG("LM_%d already reserved\n", lm_idx);
319319
return false;
320320
}
321321

322322
lm_cfg = to_dpu_hw_mixer(rm->mixer_blks[lm_idx])->cap;
323323
idx = lm_cfg->pingpong - PINGPONG_0;
324-
if (idx < 0 || idx >= ARRAY_SIZE(rm->pingpong_blks)) {
325-
DPU_ERROR("failed to get pp on lm %d\n", lm_cfg->pingpong);
324+
if (idx < 0 || idx >= ARRAY_SIZE(rm->pingpong_blks) || !rm->pingpong_blks[idx]) {
325+
DPU_ERROR("LM_%d, invalid PP_%d\n", lm_idx, idx);
326326
return false;
327327
}
328328

329329
if (reserved_by_other(global_state->pingpong_to_crtc_id, idx, crtc_id)) {
330-
DPU_DEBUG("lm %d pp %d already reserved\n", lm_cfg->id,
331-
lm_cfg->pingpong);
330+
DPU_DEBUG("LM_%d PP_%d already reserved\n", lm_idx, idx);
332331
return false;
333332
}
334333
*pp_idx = idx;
@@ -337,14 +336,13 @@ static bool _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm,
337336
return true;
338337

339338
idx = lm_cfg->dspp - DSPP_0;
340-
if (idx < 0 || idx >= ARRAY_SIZE(rm->dspp_blks)) {
341-
DPU_ERROR("failed to get dspp on lm %d\n", lm_cfg->dspp);
339+
if (idx < 0 || idx >= ARRAY_SIZE(rm->dspp_blks) || !rm->dspp_blks[idx]) {
340+
DPU_ERROR("LM_%d, invalid DSPP_%d\n", lm_idx, idx);
342341
return false;
343342
}
344343

345344
if (reserved_by_other(global_state->dspp_to_crtc_id, idx, crtc_id)) {
346-
DPU_DEBUG("lm %d dspp %d already reserved\n", lm_cfg->id,
347-
lm_cfg->dspp);
345+
DPU_DEBUG("LM_%d DSPP_%d already reserved\n", lm_idx, idx);
348346
return false;
349347
}
350348
*dspp_idx = idx;
@@ -364,7 +362,7 @@ static int _dpu_rm_reserve_lms(struct dpu_rm *rm,
364362
int i, lm_count = 0;
365363

366364
if (!topology->num_lm) {
367-
DPU_ERROR("invalid number of lm: %d\n", topology->num_lm);
365+
DPU_ERROR("zero LMs in topology\n");
368366
return -EINVAL;
369367
}
370368

@@ -468,13 +466,13 @@ static int _dpu_rm_reserve_ctls(
468466
features = ctl->caps->features;
469467
has_split_display = BIT(DPU_CTL_SPLIT_DISPLAY) & features;
470468

471-
DPU_DEBUG("ctl %d caps 0x%lX\n", j + CTL_0, features);
469+
DPU_DEBUG("CTL_%d caps 0x%lX\n", j, features);
472470

473471
if (needs_split_display != has_split_display)
474472
continue;
475473

476474
ctl_idx[i] = j;
477-
DPU_DEBUG("ctl %d match\n", j + CTL_0);
475+
DPU_DEBUG("CTL_%d match\n", j);
478476

479477
if (++i == num_ctls)
480478
break;

0 commit comments

Comments
 (0)