Skip to content

Commit 64f7b81

Browse files
Kuogee Hsiehlumag
authored andcommitted
drm/msm/dpu: add support of new peripheral flush mechanism
Introduce a peripheral flushing mechanism to decouple peripheral metadata flushing from timing engine related flush. Changes in v2: - Fixed some misalignment issues Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> Signed-off-by: Paloma Arellano <quic_parellan@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/579619/ Link: https://lore.kernel.org/r/20240222194025.25329-15-quic_parellan@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 55fb8ff commit 64f7b81

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#define CTL_WB_FLUSH 0x108
4040
#define CTL_INTF_FLUSH 0x110
4141
#define CTL_CDM_FLUSH 0x114
42+
#define CTL_PERIPH_FLUSH 0x128
4243
#define CTL_INTF_MASTER 0x134
4344
#define CTL_DSPP_n_FLUSH(n) ((0x13C) + ((n) * 4))
4445

@@ -49,6 +50,7 @@
4950
#define MERGE_3D_IDX 23
5051
#define DSC_IDX 22
5152
#define CDM_IDX 26
53+
#define PERIPH_IDX 30
5254
#define INTF_IDX 31
5355
#define WB_IDX 16
5456
#define DSPP_IDX 29 /* From DPU hw rev 7.x.x */
@@ -151,6 +153,10 @@ static inline void dpu_hw_ctl_trigger_flush_v1(struct dpu_hw_ctl *ctx)
151153
ctx->pending_dspp_flush_mask[dspp - DSPP_0]);
152154
}
153155

156+
if (ctx->pending_flush_mask & BIT(PERIPH_IDX))
157+
DPU_REG_WRITE(&ctx->hw, CTL_PERIPH_FLUSH,
158+
ctx->pending_periph_flush_mask);
159+
154160
if (ctx->pending_flush_mask & BIT(DSC_IDX))
155161
DPU_REG_WRITE(&ctx->hw, CTL_DSC_FLUSH,
156162
ctx->pending_dsc_flush_mask);
@@ -311,6 +317,13 @@ static void dpu_hw_ctl_update_pending_flush_intf_v1(struct dpu_hw_ctl *ctx,
311317
ctx->pending_flush_mask |= BIT(INTF_IDX);
312318
}
313319

320+
static void dpu_hw_ctl_update_pending_flush_periph_v1(struct dpu_hw_ctl *ctx,
321+
enum dpu_intf intf)
322+
{
323+
ctx->pending_periph_flush_mask |= BIT(intf - INTF_0);
324+
ctx->pending_flush_mask |= BIT(PERIPH_IDX);
325+
}
326+
314327
static void dpu_hw_ctl_update_pending_flush_merge_3d_v1(struct dpu_hw_ctl *ctx,
315328
enum dpu_merge_3d merge_3d)
316329
{
@@ -680,6 +693,10 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops,
680693
ops->reset_intf_cfg = dpu_hw_ctl_reset_intf_cfg_v1;
681694
ops->update_pending_flush_intf =
682695
dpu_hw_ctl_update_pending_flush_intf_v1;
696+
697+
ops->update_pending_flush_periph =
698+
dpu_hw_ctl_update_pending_flush_periph_v1;
699+
683700
ops->update_pending_flush_merge_3d =
684701
dpu_hw_ctl_update_pending_flush_merge_3d_v1;
685702
ops->update_pending_flush_wb = dpu_hw_ctl_update_pending_flush_wb_v1;

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ struct dpu_hw_ctl_ops {
122122
void (*update_pending_flush_intf)(struct dpu_hw_ctl *ctx,
123123
enum dpu_intf blk);
124124

125+
/**
126+
* OR in the given flushbits to the cached pending_(periph_)flush_mask
127+
* No effect on hardware
128+
* @ctx : ctl path ctx pointer
129+
* @blk : interface block index
130+
*/
131+
void (*update_pending_flush_periph)(struct dpu_hw_ctl *ctx,
132+
enum dpu_intf blk);
133+
125134
/**
126135
* OR in the given flushbits to the cached pending_(merge_3d_)flush_mask
127136
* No effect on hardware
@@ -264,6 +273,7 @@ struct dpu_hw_ctl {
264273
u32 pending_flush_mask;
265274
u32 pending_intf_flush_mask;
266275
u32 pending_wb_flush_mask;
276+
u32 pending_periph_flush_mask;
267277
u32 pending_merge_3d_flush_mask;
268278
u32 pending_dspp_flush_mask[DSPP_MAX - DSPP_0];
269279
u32 pending_dsc_flush_mask;

0 commit comments

Comments
 (0)