Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dpu: try reserving the DSPP-less LM first

On most of the platforms only some mixers have connected DSPP blocks.
If DSPP is not required for the CRTC, try looking for the LM with no
DSSP block, leaving DSPP-enabled LMs to CRTCs which actually require
those.

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/698773/
Link: https://lore.kernel.org/r/20260115-dpu-fix-dspp-v1-2-b73152c147b3@oss.qualcomm.com

+38 -14
+38 -14
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
··· 350 350 return true; 351 351 } 352 352 353 - static int _dpu_rm_reserve_lms(struct dpu_rm *rm, 354 - struct dpu_global_state *global_state, 355 - uint32_t crtc_id, 356 - struct msm_display_topology *topology) 353 + static bool dpu_rm_find_lms(struct dpu_rm *rm, 354 + struct dpu_global_state *global_state, 355 + uint32_t crtc_id, bool skip_dspp, 356 + struct msm_display_topology *topology, 357 + int *lm_idx, int *pp_idx, int *dspp_idx) 357 358 358 359 { 359 - int lm_idx[MAX_BLOCKS]; 360 - int pp_idx[MAX_BLOCKS]; 361 - int dspp_idx[MAX_BLOCKS] = {0}; 362 360 int i, lm_count = 0; 363 - 364 - if (!topology->num_lm) { 365 - DPU_ERROR("zero LMs in topology\n"); 366 - return -EINVAL; 367 - } 368 361 369 362 /* Find a primary mixer */ 370 363 for (i = 0; i < ARRAY_SIZE(rm->mixer_blks) && 371 364 lm_count < topology->num_lm; i++) { 372 365 if (!rm->mixer_blks[i]) 373 366 continue; 367 + 368 + if (skip_dspp && to_dpu_hw_mixer(rm->mixer_blks[i])->cap->dspp) { 369 + DPU_DEBUG("Skipping LM_%d, skipping LMs with DSPPs\n", i); 370 + continue; 371 + } 374 372 375 373 /* 376 374 * Reset lm_count to an even index. This will drop the previous ··· 408 410 } 409 411 } 410 412 411 - if (lm_count != topology->num_lm) { 413 + return lm_count == topology->num_lm; 414 + } 415 + 416 + static int _dpu_rm_reserve_lms(struct dpu_rm *rm, 417 + struct dpu_global_state *global_state, 418 + uint32_t crtc_id, 419 + struct msm_display_topology *topology) 420 + 421 + { 422 + int lm_idx[MAX_BLOCKS]; 423 + int pp_idx[MAX_BLOCKS]; 424 + int dspp_idx[MAX_BLOCKS] = {0}; 425 + int i; 426 + bool found; 427 + 428 + if (!topology->num_lm) { 429 + DPU_ERROR("zero LMs in topology\n"); 430 + return -EINVAL; 431 + } 432 + 433 + /* Try using non-DSPP LM blocks first */ 434 + found = dpu_rm_find_lms(rm, global_state, crtc_id, !topology->num_dspp, 435 + topology, lm_idx, pp_idx, dspp_idx); 436 + if (!found && !topology->num_dspp) 437 + found = dpu_rm_find_lms(rm, global_state, crtc_id, false, 438 + topology, lm_idx, pp_idx, dspp_idx); 439 + if (!found) { 412 440 DPU_DEBUG("unable to find appropriate mixers\n"); 413 441 return -ENAVAIL; 414 442 } 415 443 416 - for (i = 0; i < lm_count; i++) { 444 + for (i = 0; i < topology->num_lm; i++) { 417 445 global_state->mixer_to_crtc_id[lm_idx[i]] = crtc_id; 418 446 global_state->pingpong_to_crtc_id[pp_idx[i]] = crtc_id; 419 447 global_state->dspp_to_crtc_id[dspp_idx[i]] =