drm/msm/dpu: use PINGPONG_NONE to unbind INTF from PP
PATCH v2 1/2 drm/msm/dpu: use PINGPONG_NONE to unbind INTF from PP
Currently the driver passes the PINGPONG index to dpu_hw_intf_ops::bind_pingpong_blk() callback and uses separate boolean flag to tell whether INTF should be bound or unbound. Simplify this by passing PINGPONG_NONE in case of unbinding and drop the flag completely.
---
Changes since v1:
- Dropped != PINGPONG_NONE (Marijn)
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 4 +--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 - drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 1 - 5 files changed, 4 insertions(+), 9 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2 -2
@@ -2090,8 +2090,8 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)for (i =0 ; i < dpu_enc->num_phys_encs; i++) {if (dpu_enc->phys_encs[i] && phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk ( - dpu_enc->phys_encs[i]->hw_intf, false, - dpu_enc->phys_encs[i]->hw_pp->idx); + dpu_enc->phys_encs[i]->hw_intf, +PINGPONG_NONE );/* mark INTF flush as pending */ if (phys_enc->hw_ctl->ops.update_pending_flush_intf)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +1 -3
@@ -66,7 +66,6 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg(if (test_bit (DPU_CTL_ACTIVE_CFG , &ctl->caps->features) && phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk ( phys_enc->hw_intf, - true, phys_enc->hw_pp->idx); }
@@ -553,8 +552,7 @@ static void dpu_encoder_phys_cmd_disable(struct dpu_encoder_phys *phys_enc)if (phys_enc->hw_intf->ops.bind_pingpong_blk) { phys_enc->hw_intf->ops.bind_pingpong_blk ( phys_enc->hw_intf, - false, - phys_enc->hw_pp->idx); +PINGPONG_NONE ); ctl = phys_enc->hw_ctl; ctl->ops.update_pending_flush_intf (ctl, phys_enc->hw_intf->idx);
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +0 -1
@@ -287,7 +287,6 @@ static void dpu_encoder_phys_vid_setup_timing_engine(if (phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk ( phys_enc->hw_intf, - true, phys_enc->hw_pp->idx);if (phys_enc->hw_pp->merge_3d)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +1 -2
@@ -267,7 +267,6 @@ static void dpu_hw_intf_setup_prg_fetch(static void dpu_hw_intf_bind_pingpong_blk (struct dpu_hw_intf *intf, -bool enable,const enum dpu_pingpong pp) {struct dpu_hw_blk_reg_map *c = &intf->hw;
@@ -276,7 +275,7 @@ static void dpu_hw_intf_bind_pingpong_blk( mux_cfg =DPU_REG_READ (c,INTF_MUX ); mux_cfg &= ~0xf ; -if (enable) +if (pp) mux_cfg |= (pp -PINGPONG_0 ) &0x7 ;else mux_cfg |=0xf ;
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +0 -1
@@ -88,7 +88,6 @@ struct dpu_hw_intf_ops {u32 (*get_line_count)(struct dpu_hw_intf *intf);void (*bind_pingpong_blk)(struct dpu_hw_intf *intf, -bool enable,const enum dpu_pingpong pp);void (*setup_misr)(struct dpu_hw_intf *intf,bool enable,u32 frame_count);int (*collect_misr)(struct dpu_hw_intf *intf,u32 *misr_value);
Signature · 1 line
2.39.2
PATCH v2 2/2 drm/msm/dpu: use PINGPONG_NONE to unbind WB from PP
Currently the driver passes the PINGPONG index to dpu_hw_wb_ops::bind_pingpong_blk() callback and uses separate boolean flag to tell whether WB should be bound or unbound. Simplify this by passing PINGPONG_NONE in case of unbinding and drop the flag completely.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +1 -2
@@ -2080,8 +2080,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)if (phys_enc->hw_wb) {/* disable the PP block */ if (phys_enc->hw_wb->ops.bind_pingpong_blk) - phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb, false, - phys_enc->hw_pp->idx); + phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb,PINGPONG_NONE );/* mark WB flush as pending */ if (phys_enc->hw_ctl->ops.update_pending_flush_wb)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +1 -1
@@ -210,7 +210,7 @@ static void dpu_encoder_phys_wb_setup_cdp(struct dpu_encoder_phys *phys_enc)/* setup which pp blk will connect to this wb */ if (hw_pp && phys_enc->hw_wb->ops.bind_pingpong_blk) - phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb, true, + phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb, phys_enc->hw_pp->idx); phys_enc->hw_ctl->ops.setup_intf_cfg (phys_enc->hw_ctl, &intf_cfg);
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +2 -2
@@ -154,7 +154,7 @@ static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx,static void dpu_hw_wb_bind_pingpong_blk (struct dpu_hw_wb *ctx, -bool enable,const enum dpu_pingpong pp) +const enum dpu_pingpong pp) {struct dpu_hw_blk_reg_map *c;int mux_cfg;
@@ -167,7 +167,7 @@ static void dpu_hw_wb_bind_pingpong_blk( mux_cfg =DPU_REG_READ (c,WB_MUX ); mux_cfg &= ~0xf ; -if (enable) +if (pp) mux_cfg |= (pp -PINGPONG_0 ) &0x7 ;else mux_cfg |=0xf ;
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h +1 -1
@@ -49,7 +49,7 @@ struct dpu_hw_wb_ops { bool enable);void (*bind_pingpong_blk)(struct dpu_hw_wb *ctx, -bool enable,const enum dpu_pingpong pp); +const enum dpu_pingpong pp); };/**
Signature · 1 line
2.39.2
Re: [PATCH v2 2/2] drm/msm/dpu: use PINGPONG_NONE to unbind WB from PP
Quoted 7 lines · Dmitry Baryshkov
Currently the driver passes the PINGPONG index to
dpu_hw_wb_ops::bind_pingpong_blk()callback and uses separate boolean flag to tell whether WB should be bound or unbound. Simplify this by passingPINGPONG_NONEin case of unbinding and drop the flag completely.Suggested-by Marijn Suijten <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>
Quoted 72 lines
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +1
-2@@ -2080,8 +2080,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)if (phys_enc->hw_wb) {/* disable the PP block */ if (phys_enc->hw_wb->ops.bind_pingpong_blk) - phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb, false, - phys_enc->hw_pp->idx); + phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb,PINGPONG_NONE );/* mark WB flush as pending */ if (phys_enc->hw_ctl->ops.update_pending_flush_wb)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +1
-1@@ -210,7 +210,7 @@ static void dpu_encoder_phys_wb_setup_cdp(struct dpu_encoder_phys *phys_enc)/* setup which pp blk will connect to this wb */ if (hw_pp && phys_enc->hw_wb->ops.bind_pingpong_blk) - phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb, true, + phys_enc->hw_wb->ops.bind_pingpong_blk (phys_enc->hw_wb, phys_enc->hw_pp->idx); phys_enc->hw_ctl->ops.setup_intf_cfg (phys_enc->hw_ctl, &intf_cfg);drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c +2
-2@@ -154,7 +154,7 @@ static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx,static void dpu_hw_wb_bind_pingpong_blk (struct dpu_hw_wb *ctx, -bool enable,const enum dpu_pingpong pp) +const enum dpu_pingpong pp) {struct dpu_hw_blk_reg_map *c;int mux_cfg;@@ -167,7 +167,7 @@ static void dpu_hw_wb_bind_pingpong_blk( mux_cfg =DPU_REG_READ (c,WB_MUX ); mux_cfg &= ~0xf ; -if (enable) +if (pp) mux_cfg |= (pp -PINGPONG_0 ) &0x7 ;else mux_cfg |=0xf ;drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h +1
-1@@ -49,7 +49,7 @@ struct dpu_hw_wb_ops { bool enable);void (*bind_pingpong_blk)(struct dpu_hw_wb *ctx, -bool enable,const enum dpu_pingpong pp); +const enum dpu_pingpong pp); };/** Signature · 1 line
2.39.2
Quoted 6 lines · Dmitry Baryshkov
Currently the driver passes the PINGPONG index to
dpu_hw_intf_ops::bind_pingpong_blk()callback and uses separate boolean flag to tell whether INTF should be bound or unbound. Simplify this by passingPINGPONG_NONEin case of unbinding and drop the flag completely.Signed-off-by Dmitry Baryshkov <[email protected]>
Quoted 98 lines
---
Changes since v1:
- Dropped !=PINGPONG_NONE(Marijn)--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 4 +--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 - drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 1 - 5 files changed, 4 insertions(+), 9 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2
-2@@ -2090,8 +2090,8 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)for (i =0 ; i < dpu_enc->num_phys_encs; i++) {if (dpu_enc->phys_encs[i] && phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk ( - dpu_enc->phys_encs[i]->hw_intf, false, - dpu_enc->phys_encs[i]->hw_pp->idx); + dpu_enc->phys_encs[i]->hw_intf, +PINGPONG_NONE );/* mark INTF flush as pending */ if (phys_enc->hw_ctl->ops.update_pending_flush_intf)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +1
-3@@ -66,7 +66,6 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg(if (test_bit (DPU_CTL_ACTIVE_CFG , &ctl->caps->features) && phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk ( phys_enc->hw_intf, - true, phys_enc->hw_pp->idx); }@@ -553,8 +552,7 @@ static void dpu_encoder_phys_cmd_disable(struct dpu_encoder_phys *phys_enc)if (phys_enc->hw_intf->ops.bind_pingpong_blk) { phys_enc->hw_intf->ops.bind_pingpong_blk ( phys_enc->hw_intf, - false, - phys_enc->hw_pp->idx); +PINGPONG_NONE ); ctl = phys_enc->hw_ctl; ctl->ops.update_pending_flush_intf (ctl, phys_enc->hw_intf->idx);drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +0
-1@@ -287,7 +287,6 @@ static void dpu_encoder_phys_vid_setup_timing_engine(if (phys_enc->hw_intf->ops.bind_pingpong_blk) phys_enc->hw_intf->ops.bind_pingpong_blk ( phys_enc->hw_intf, - true, phys_enc->hw_pp->idx);if (phys_enc->hw_pp->merge_3d)drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +1
-2@@ -267,7 +267,6 @@ static void dpu_hw_intf_setup_prg_fetch(static void dpu_hw_intf_bind_pingpong_blk (struct dpu_hw_intf *intf, -bool enable,const enum dpu_pingpong pp) {struct dpu_hw_blk_reg_map *c = &intf->hw;@@ -276,7 +275,7 @@ static void dpu_hw_intf_bind_pingpong_blk( mux_cfg =DPU_REG_READ (c,INTF_MUX ); mux_cfg &= ~0xf ; -if (enable) +if (pp) mux_cfg |= (pp -PINGPONG_0 ) &0x7 ;else mux_cfg |=0xf ;drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +0
-1@@ -88,7 +88,6 @@ struct dpu_hw_intf_ops {u32 (*get_line_count)(struct dpu_hw_intf *intf);void (*bind_pingpong_blk)(struct dpu_hw_intf *intf, -bool enable,const enum dpu_pingpong pp);void (*setup_misr)(struct dpu_hw_intf *intf,bool enable,u32 frame_count);int (*collect_misr)(struct dpu_hw_intf *intf,u32 *misr_value);Signature · 1 line
2.39.2
Dmitry Baryshkov
AppliedQuoted 6 lines · Dmitry Baryshkov
Currently the driver passes the PINGPONG index to
dpu_hw_intf_ops::bind_pingpong_blk()callback and uses separate boolean flag to tell whether INTF should be bound or unbound. Simplify this by passingPINGPONG_NONEin case of unbinding and drop the flag completely.
Applied, thanks!
[1/2] drm/msm/dpu: use PINGPONG_NONE to unbind INTF from PP
https://gitlab.freedesktop.org/lumag/msm/-/commit/a03b7c4698d7 [2/2] drm/msm/dpu: use PINGPONG_NONE to unbind WB from PP https://gitlab.freedesktop.org/lumag/msm/-/commit/0f86d9c980a3
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>