]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/msm/disp/dpu: get timing engine status from intf status register
authorVinod Polimera <quic_vpolimer@quicinc.com>
Thu, 2 Mar 2023 16:33:08 +0000 (22:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:36 +0000 (19:39 +0200)
[ Upstream commit e3969eadc8ee78a5bdca65b8ed0a421a359e4090 ]

Recommended way of reading the interface timing gen status is via
status register. Timing gen status register will give a reliable status
of the interface especially during ON/OFF transitions. This support was
added from DPU version 5.0.0.

Signed-off-by: Vinod Polimera <quic_vpolimer@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/524724/
Link: https://lore.kernel.org/r/1677774797-31063-6-git-send-email-quic_vpolimer@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Stable-dep-of: a7129231edf3 ("drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c

index f7214c4401e19a9f935bd2b57676efc96cdd6525..900cdb40c7b403584523c583db307a7175a0bf15 100644 (file)
@@ -94,7 +94,8 @@
 
 #define INTF_SDM845_MASK (0)
 
-#define INTF_SC7180_MASK BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE)
+#define INTF_SC7180_MASK \
+       (BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | BIT(DPU_INTF_STATUS_SUPPORTED))
 
 #define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN)
 
index 5f96dd8def0920ada8e2ddb841c08da7771b2f90..d7d45e1e7b3101b31774cc511d8441ff309cd8f8 100644 (file)
@@ -214,17 +214,19 @@ enum {
 
 /**
  * INTF sub-blocks
- * @DPU_INTF_INPUT_CTRL         Supports the setting of pp block from which
- *                              pixel data arrives to this INTF
- * @DPU_INTF_TE                 INTF block has TE configuration support
- * @DPU_DATA_HCTL_EN            Allows data to be transferred at different rate
-                                than video timing
+ * @DPU_INTF_INPUT_CTRL             Supports the setting of pp block from which
+ *                                  pixel data arrives to this INTF
+ * @DPU_INTF_TE                     INTF block has TE configuration support
+ * @DPU_DATA_HCTL_EN                Allows data to be transferred at different rate
+ *                                  than video timing
+ * @DPU_INTF_STATUS_SUPPORTED       INTF block has INTF_STATUS register
  * @DPU_INTF_MAX
  */
 enum {
        DPU_INTF_INPUT_CTRL = 0x1,
        DPU_INTF_TE,
        DPU_DATA_HCTL_EN,
+       DPU_INTF_STATUS_SUPPORTED,
        DPU_INTF_MAX
 };
 
index b2a94b9a3e9878125f061d86c740fa0573d621f1..b9dddf576c029f0d136ce281eff897f7f041953b 100644 (file)
@@ -57,6 +57,7 @@
 #define   INTF_PROG_FETCH_START         0x170
 #define   INTF_PROG_ROT_START           0x174
 #define   INTF_MUX                      0x25C
+#define   INTF_STATUS                   0x26C
 
 #define INTF_CFG_ACTIVE_H_EN   BIT(29)
 #define INTF_CFG_ACTIVE_V_EN   BIT(30)
@@ -292,8 +293,13 @@ static void dpu_hw_intf_get_status(
                struct intf_status *s)
 {
        struct dpu_hw_blk_reg_map *c = &intf->hw;
+       unsigned long cap = intf->cap->features;
+
+       if (cap & BIT(DPU_INTF_STATUS_SUPPORTED))
+               s->is_en = DPU_REG_READ(c, INTF_STATUS) & BIT(0);
+       else
+               s->is_en = DPU_REG_READ(c, INTF_TIMING_ENGINE_EN);
 
-       s->is_en = DPU_REG_READ(c, INTF_TIMING_ENGINE_EN);
        s->is_prog_fetch_en = !!(DPU_REG_READ(c, INTF_CONFIG) & BIT(31));
        if (s->is_en) {
                s->frame_count = DPU_REG_READ(c, INTF_FRAME_COUNT);