Skip to content

Commit ca97fa4

Browse files
MarijnS95lumag
authored andcommitted
drm/msm/dpu: Allow configuring multiple active DSC blocks
Just like the active interface and writeback block in ctl_intf_cfg_v1(), and later the rest of the blocks in followup active-CTL fixes or reworks, multiple calls to this function should enable additional DSC blocks instead of overwriting the blocks that are enabled. This pattern is observed in an active-CTL scenario since DPU 5.0.0 where for example bonded-DSI uses a single CTL to drive multiple INTFs, and each encoder calls this function individually with the INTF (hence the pre-existing update instead of overwrite of this bitmask) and DSC blocks it wishes to be enabled, and expects them to be OR'd into the bitmask. The reverse already exists in reset_intf_cfg_v1() where only specified DSC blocks are removed out of the CTL_DSC_ACTIVE bitmask (same for all other blocks and ACTIVE bitmasks), leaving the rest enabled. Fixes: 77f6da9 ("drm/msm/disp/dpu1: Add DSC support in hw_ctl") Signed-off-by: Marijn Suijten <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/589902/ Link: https://lore.kernel.org/r/20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-4-78ae3ee9a697@somainline.org Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 2b938c3 commit ca97fa4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
545545
{
546546
struct dpu_hw_blk_reg_map *c = &ctx->hw;
547547
u32 intf_active = 0;
548+
u32 dsc_active = 0;
548549
u32 wb_active = 0;
549550
u32 mode_sel = 0;
550551

@@ -560,24 +561,26 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
560561

561562
intf_active = DPU_REG_READ(c, CTL_INTF_ACTIVE);
562563
wb_active = DPU_REG_READ(c, CTL_WB_ACTIVE);
564+
dsc_active = DPU_REG_READ(c, CTL_DSC_ACTIVE);
563565

564566
if (cfg->intf)
565567
intf_active |= BIT(cfg->intf - INTF_0);
566568

567569
if (cfg->wb)
568570
wb_active |= BIT(cfg->wb - WB_0);
569571

572+
if (cfg->dsc)
573+
dsc_active |= cfg->dsc;
574+
570575
DPU_REG_WRITE(c, CTL_TOP, mode_sel);
571576
DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active);
572577
DPU_REG_WRITE(c, CTL_WB_ACTIVE, wb_active);
578+
DPU_REG_WRITE(c, CTL_DSC_ACTIVE, dsc_active);
573579

574580
if (cfg->merge_3d)
575581
DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE,
576582
BIT(cfg->merge_3d - MERGE_3D_0));
577583

578-
if (cfg->dsc)
579-
DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc);
580-
581584
if (cfg->cdm)
582585
DPU_REG_WRITE(c, CTL_CDM_ACTIVE, cfg->cdm);
583586
}

0 commit comments

Comments
 (0)