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

drm/msm/dpu: fix CDP setup to account for multirect index

Client driven prefetch (CDP) is properly setup only for SSPP REC0
currently. Enable client driven prefetch also for SSPP REC1.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://lore.kernel.org/r/20211201225140.2481577-5-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

+14 -4
+10 -2
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
··· 75 75 #define SSPP_TRAFFIC_SHAPER 0x130 76 76 #define SSPP_CDP_CNTL 0x134 77 77 #define SSPP_UBWC_ERROR_STATUS 0x138 78 + #define SSPP_CDP_CNTL_REC1 0x13c 78 79 #define SSPP_TRAFFIC_SHAPER_PREFILL 0x150 79 80 #define SSPP_TRAFFIC_SHAPER_REC1_PREFILL 0x154 80 81 #define SSPP_TRAFFIC_SHAPER_REC1 0x158 ··· 625 624 } 626 625 627 626 static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, 628 - struct dpu_hw_pipe_cdp_cfg *cfg) 627 + struct dpu_hw_pipe_cdp_cfg *cfg, 628 + enum dpu_sspp_multirect_index index) 629 629 { 630 630 u32 idx; 631 631 u32 cdp_cntl = 0; 632 + u32 cdp_cntl_offset = 0; 632 633 633 634 if (!ctx || !cfg) 634 635 return; 635 636 636 637 if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) 637 638 return; 639 + 640 + if (index == DPU_SSPP_RECT_SOLO || index == DPU_SSPP_RECT_0) 641 + cdp_cntl_offset = SSPP_CDP_CNTL; 642 + else 643 + cdp_cntl_offset = SSPP_CDP_CNTL_REC1; 638 644 639 645 if (cfg->enable) 640 646 cdp_cntl |= BIT(0); ··· 652 644 if (cfg->preload_ahead == DPU_SSPP_CDP_PRELOAD_AHEAD_64) 653 645 cdp_cntl |= BIT(3); 654 646 655 - DPU_REG_WRITE(&ctx->hw, SSPP_CDP_CNTL, cdp_cntl); 647 + DPU_REG_WRITE(&ctx->hw, cdp_cntl_offset, cdp_cntl); 656 648 } 657 649 658 650 static void _setup_layer_ops(struct dpu_hw_pipe *c,
+3 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h
··· 356 356 * setup_cdp - setup client driven prefetch 357 357 * @ctx: Pointer to pipe context 358 358 * @cfg: Pointer to cdp configuration 359 + * @index: rectangle index in multirect 359 360 */ 360 361 void (*setup_cdp)(struct dpu_hw_pipe *ctx, 361 - struct dpu_hw_pipe_cdp_cfg *cfg); 362 + struct dpu_hw_pipe_cdp_cfg *cfg, 363 + enum dpu_sspp_multirect_index index); 362 364 }; 363 365 364 366 /**
+1 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
··· 1191 1191 DPU_FORMAT_IS_TILE(fmt); 1192 1192 cdp_cfg.preload_ahead = DPU_SSPP_CDP_PRELOAD_AHEAD_64; 1193 1193 1194 - pdpu->pipe_hw->ops.setup_cdp(pdpu->pipe_hw, &cdp_cfg); 1194 + pdpu->pipe_hw->ops.setup_cdp(pdpu->pipe_hw, &cdp_cfg, pstate->multirect_index); 1195 1195 } 1196 1196 } 1197 1197