@@ -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+
566597static 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 =
0 commit comments