Skip to content

Commit e1a950e

Browse files
Abhinav Kumarlumag
authored andcommitted
drm/msm/dpu: add reset_intf_cfg operation for dpu_hw_ctl
Add a reset_intf_cfg operation for dpu_hw_ctl to reset the entire CTL path by disabling each component namely layer mixer, 3d-merge and interface blocks. changes in v3: - none Signed-off-by: Abhinav Kumar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/483502/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 53324b9 commit e1a950e

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,37 @@ static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx,
563563
DPU_REG_WRITE(c, CTL_TOP, intf_cfg);
564564
}
565565

566+
static void dpu_hw_ctl_reset_intf_cfg_v1(struct dpu_hw_ctl *ctx,
567+
struct dpu_hw_intf_cfg *cfg)
568+
{
569+
struct dpu_hw_blk_reg_map *c = &ctx->hw;
570+
u32 intf_active = 0;
571+
u32 merge3d_active = 0;
572+
573+
/*
574+
* This API resets each portion of the CTL path namely,
575+
* clearing the sspps staged on the lm, merge_3d block,
576+
* interfaces etc to ensure clean teardown of the pipeline.
577+
* This will be used for writeback to begin with to have a
578+
* proper teardown of the writeback session but upon further
579+
* validation, this can be extended to all interfaces.
580+
*/
581+
if (cfg->merge_3d) {
582+
merge3d_active = DPU_REG_READ(c, CTL_MERGE_3D_ACTIVE);
583+
merge3d_active &= ~BIT(cfg->merge_3d - MERGE_3D_0);
584+
DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE,
585+
merge3d_active);
586+
}
587+
588+
dpu_hw_ctl_clear_all_blendstages(ctx);
589+
590+
if (cfg->intf) {
591+
intf_active = DPU_REG_READ(c, CTL_INTF_ACTIVE);
592+
intf_active &= ~BIT(cfg->intf - INTF_0);
593+
DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active);
594+
}
595+
}
596+
566597
static void dpu_hw_ctl_set_fetch_pipe_active(struct dpu_hw_ctl *ctx,
567598
unsigned long *fetch_active)
568599
{
@@ -586,6 +617,7 @@ static void _setup_ctl_ops(struct dpu_hw_ctl_ops *ops,
586617
if (cap & BIT(DPU_CTL_ACTIVE_CFG)) {
587618
ops->trigger_flush = dpu_hw_ctl_trigger_flush_v1;
588619
ops->setup_intf_cfg = dpu_hw_ctl_intf_cfg_v1;
620+
ops->reset_intf_cfg = dpu_hw_ctl_reset_intf_cfg_v1;
589621
ops->update_pending_flush_intf =
590622
dpu_hw_ctl_update_pending_flush_intf_v1;
591623
ops->update_pending_flush_merge_3d =

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ struct dpu_hw_ctl_ops {
140140
void (*setup_intf_cfg)(struct dpu_hw_ctl *ctx,
141141
struct dpu_hw_intf_cfg *cfg);
142142

143+
/**
144+
* reset ctl_path interface config
145+
* @ctx : ctl path ctx pointer
146+
* @cfg : interface config structure pointer
147+
*/
148+
void (*reset_intf_cfg)(struct dpu_hw_ctl *ctx,
149+
struct dpu_hw_intf_cfg *cfg);
150+
143151
int (*reset)(struct dpu_hw_ctl *c);
144152

145153
/*

0 commit comments

Comments
 (0)