drm/msm/dpu: use PINGPONG_NONE to unbind WB from PP
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Sun, 4 Jun 2023 03:13:08 +0000 (06:13 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 7 Jun 2023 23:08:23 +0000 (02:08 +0300)
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.

Suggested-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Patchwork: https://patchwork.freedesktop.org/patch/540969/
Link: https://lore.kernel.org/r/20230604031308.894274-2-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.h

index d219a1359906955d1cb8cf6ab3f55cddb56b34ba..625f89c4d3deeca6eff0b377d05b7b002c254aac 100644 (file)
@@ -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)
index e9325cafb1a85e9490c5a388123bf39b0596bd5d..a466ff70a4d62beabee0117ea902b97f7673221e 100644 (file)
@@ -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);
index dcffd6cc47fc836e0771f78d8e3b88086b75d808..ebc416400382202194550ed789f7f4c0bb3ecb64 100644 (file)
@@ -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;
index c7f792eeb55cafad0f162ff9b62589b507ded204..2d7db2efa3d0181fa6ba5247d55ce2ac566ed9b3 100644 (file)
@@ -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);
 };
 
 /**