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: Fail atomic_check if multiple outputs request CDM block

Currently, our hardware only supports a single output using CDM block at
most. Because of this, we cannot support cases where both writeback and DP
output request CDM simultaneously

To avoid this happening when CWB is enabled, change
msm_display_topoloy.needs_cdm into a num_cdm counter to track how many
outputs are requesting CDM block. Return EINVAL if multiple outputs are
trying to reserve CDM.

Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/637499/
Link: https://lore.kernel.org/r/20250214-concurrent-wb-v6-6-a44c293cf422@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Jessica Zhang and committed by
Dmitry Baryshkov
f1f0379e 20972609

+14 -7
+2 -2
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
··· 700 700 fb = conn_state->writeback_job->fb; 701 701 702 702 if (fb && MSM_FORMAT_IS_YUV(msm_framebuffer_format(fb))) 703 - topology->needs_cdm = true; 703 + topology->num_cdm++; 704 704 } else if (disp_info->intf_type == INTF_DP) { 705 705 if (msm_dp_is_yuv_420_enabled(priv->dp[disp_info->h_tile_instance[0]], adj_mode)) 706 - topology->needs_cdm = true; 706 + topology->num_cdm++; 707 707 } 708 708 } 709 709
+9 -3
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
··· 585 585 586 586 static int _dpu_rm_reserve_cdm(struct dpu_rm *rm, 587 587 struct dpu_global_state *global_state, 588 - uint32_t crtc_id) 588 + uint32_t crtc_id, 589 + int num_cdm) 589 590 { 590 591 /* try allocating only one CDM block */ 591 592 if (!rm->cdm_blk) { 592 593 DPU_ERROR("CDM block does not exist\n"); 593 594 return -EIO; 595 + } 596 + 597 + if (num_cdm > 1) { 598 + DPU_ERROR("More than 1 INTF requesting CDM\n"); 599 + return -EINVAL; 594 600 } 595 601 596 602 if (global_state->cdm_to_crtc_id) { ··· 635 629 if (ret) 636 630 return ret; 637 631 638 - if (topology->needs_cdm) { 639 - ret = _dpu_rm_reserve_cdm(rm, global_state, crtc_id); 632 + if (topology->num_cdm > 0) { 633 + ret = _dpu_rm_reserve_cdm(rm, global_state, crtc_id, topology->num_cdm); 640 634 if (ret) { 641 635 DPU_ERROR("unable to find CDM blk\n"); 642 636 return ret;
+3 -2
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
··· 51 51 * @num_intf: number of interfaces the panel is mounted on 52 52 * @num_dspp: number of dspp blocks used 53 53 * @num_dsc: number of Display Stream Compression (DSC) blocks used 54 - * @needs_cdm: indicates whether cdm block is needed for this display topology 54 + * @num_cdm: indicates how many outputs are requesting cdm block for 55 + * this display topology 55 56 * @cwb_enabled: indicates whether CWB is enabled for this display topology 56 57 */ 57 58 struct msm_display_topology { ··· 60 59 u32 num_intf; 61 60 u32 num_dspp; 62 61 u32 num_dsc; 63 - bool needs_cdm; 62 + int num_cdm; 64 63 bool cwb_enabled; 65 64 }; 66 65