Skip to content

Commit 1642b58

Browse files
Jessica Zhanglumag
authored andcommitted
drm/msm/dpu: Set DATA_COMPRESS on command mode for DCE/DSC 1.2
Add a DPU INTF op to set the DCE_DATA_COMPRESS bit to enable the DCE/DSC 1.2 datapath Note: For now, this op is called for command mode encoders only. Changes to set DATA_COMPRESS for video mode encoders will be posted along with DSC v1.2 support for DP. Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Patchwork: https://patchwork.freedesktop.org/patch/541966/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-4-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 22598cf commit 1642b58

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg(
6767
phys_enc->hw_intf->ops.bind_pingpong_blk(
6868
phys_enc->hw_intf,
6969
phys_enc->hw_pp->idx);
70+
71+
if (intf_cfg.dsc != 0 && phys_enc->hw_intf->ops.enable_compression)
72+
phys_enc->hw_intf->ops.enable_compression(phys_enc->hw_intf);
7073
}
7174

7275
static void dpu_encoder_phys_cmd_pp_tx_done_irq(void *arg, int irq_idx)

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191

9292
#define INTF_CFG2_DATABUS_WIDEN BIT(0)
9393
#define INTF_CFG2_DATA_HCTL_EN BIT(4)
94+
#define INTF_CFG2_DCE_DATA_COMPRESS BIT(12)
9495

9596

9697
static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx,
@@ -512,6 +513,15 @@ static void dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf,
512513

513514
}
514515

516+
static void dpu_hw_intf_enable_compression(struct dpu_hw_intf *ctx)
517+
{
518+
u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2);
519+
520+
intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS;
521+
522+
DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2);
523+
}
524+
515525
static void _setup_intf_ops(struct dpu_hw_intf_ops *ops,
516526
unsigned long cap)
517527
{
@@ -532,6 +542,9 @@ static void _setup_intf_ops(struct dpu_hw_intf_ops *ops,
532542
ops->vsync_sel = dpu_hw_intf_vsync_sel;
533543
ops->disable_autorefresh = dpu_hw_intf_disable_autorefresh;
534544
}
545+
546+
if (cap & BIT(DPU_INTF_DATA_COMPRESS))
547+
ops->enable_compression = dpu_hw_intf_enable_compression;
535548
}
536549

537550
struct dpu_hw_intf *dpu_hw_intf_init(const struct dpu_intf_cfg *cfg,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct intf_status {
7070
* @get_autorefresh: Retrieve autorefresh config from hardware
7171
* Return: 0 on success, -ETIMEDOUT on timeout
7272
* @vsync_sel: Select vsync signal for tear-effect configuration
73+
* @enable_compression: Enable data compression
7374
*/
7475
struct dpu_hw_intf_ops {
7576
void (*setup_timing_gen)(struct dpu_hw_intf *intf,
@@ -106,6 +107,8 @@ struct dpu_hw_intf_ops {
106107
* Disable autorefresh if enabled
107108
*/
108109
void (*disable_autorefresh)(struct dpu_hw_intf *intf, uint32_t encoder_id, u16 vdisplay);
110+
111+
void (*enable_compression)(struct dpu_hw_intf *intf);
109112
};
110113

111114
struct dpu_hw_intf {

0 commit comments

Comments
 (0)