Commit f7254785 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

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: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://lore.kernel.org/r/20211201225140.2481577-5-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 1e35e3fc
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#define SSPP_TRAFFIC_SHAPER 0x130 #define SSPP_TRAFFIC_SHAPER 0x130
#define SSPP_CDP_CNTL 0x134 #define SSPP_CDP_CNTL 0x134
#define SSPP_UBWC_ERROR_STATUS 0x138 #define SSPP_UBWC_ERROR_STATUS 0x138
#define SSPP_CDP_CNTL_REC1 0x13c
#define SSPP_TRAFFIC_SHAPER_PREFILL 0x150 #define SSPP_TRAFFIC_SHAPER_PREFILL 0x150
#define SSPP_TRAFFIC_SHAPER_REC1_PREFILL 0x154 #define SSPP_TRAFFIC_SHAPER_REC1_PREFILL 0x154
#define SSPP_TRAFFIC_SHAPER_REC1 0x158 #define SSPP_TRAFFIC_SHAPER_REC1 0x158
...@@ -624,10 +625,12 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_pipe *ctx, ...@@ -624,10 +625,12 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_pipe *ctx,
} }
static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx,
struct dpu_hw_pipe_cdp_cfg *cfg) struct dpu_hw_pipe_cdp_cfg *cfg,
enum dpu_sspp_multirect_index index)
{ {
u32 idx; u32 idx;
u32 cdp_cntl = 0; u32 cdp_cntl = 0;
u32 cdp_cntl_offset = 0;
if (!ctx || !cfg) if (!ctx || !cfg)
return; return;
...@@ -635,6 +638,11 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, ...@@ -635,6 +638,11 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx,
if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx)) if (_sspp_subblk_offset(ctx, DPU_SSPP_SRC, &idx))
return; return;
if (index == DPU_SSPP_RECT_SOLO || index == DPU_SSPP_RECT_0)
cdp_cntl_offset = SSPP_CDP_CNTL;
else
cdp_cntl_offset = SSPP_CDP_CNTL_REC1;
if (cfg->enable) if (cfg->enable)
cdp_cntl |= BIT(0); cdp_cntl |= BIT(0);
if (cfg->ubwc_meta_enable) if (cfg->ubwc_meta_enable)
...@@ -644,7 +652,7 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx, ...@@ -644,7 +652,7 @@ static void dpu_hw_sspp_setup_cdp(struct dpu_hw_pipe *ctx,
if (cfg->preload_ahead == DPU_SSPP_CDP_PRELOAD_AHEAD_64) if (cfg->preload_ahead == DPU_SSPP_CDP_PRELOAD_AHEAD_64)
cdp_cntl |= BIT(3); cdp_cntl |= BIT(3);
DPU_REG_WRITE(&ctx->hw, SSPP_CDP_CNTL, cdp_cntl); DPU_REG_WRITE(&ctx->hw, cdp_cntl_offset, cdp_cntl);
} }
static void _setup_layer_ops(struct dpu_hw_pipe *c, static void _setup_layer_ops(struct dpu_hw_pipe *c,
......
...@@ -356,9 +356,11 @@ struct dpu_hw_sspp_ops { ...@@ -356,9 +356,11 @@ struct dpu_hw_sspp_ops {
* setup_cdp - setup client driven prefetch * setup_cdp - setup client driven prefetch
* @ctx: Pointer to pipe context * @ctx: Pointer to pipe context
* @cfg: Pointer to cdp configuration * @cfg: Pointer to cdp configuration
* @index: rectangle index in multirect
*/ */
void (*setup_cdp)(struct dpu_hw_pipe *ctx, void (*setup_cdp)(struct dpu_hw_pipe *ctx,
struct dpu_hw_pipe_cdp_cfg *cfg); struct dpu_hw_pipe_cdp_cfg *cfg,
enum dpu_sspp_multirect_index index);
}; };
/** /**
......
...@@ -1191,7 +1191,7 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) ...@@ -1191,7 +1191,7 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
DPU_FORMAT_IS_TILE(fmt); DPU_FORMAT_IS_TILE(fmt);
cdp_cfg.preload_ahead = DPU_SSPP_CDP_PRELOAD_AHEAD_64; cdp_cfg.preload_ahead = DPU_SSPP_CDP_PRELOAD_AHEAD_64;
pdpu->pipe_hw->ops.setup_cdp(pdpu->pipe_hw, &cdp_cfg); pdpu->pipe_hw->ops.setup_cdp(pdpu->pipe_hw, &cdp_cfg, pstate->multirect_index);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment