Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/disp/dpu: get timing engine status from intf status register

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>

authored by

Vinod Polimera and committed by
Dmitry Baryshkov
e3969ead b6975693

+16 -7
+2 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
··· 78 78 79 79 #define INTF_SDM845_MASK (0) 80 80 81 - #define INTF_SC7180_MASK BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) 81 + #define INTF_SC7180_MASK \ 82 + (BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | BIT(DPU_INTF_STATUS_SUPPORTED)) 82 83 83 84 #define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN) 84 85
+7 -5
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
··· 213 213 214 214 /** 215 215 * INTF sub-blocks 216 - * @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which 217 - * pixel data arrives to this INTF 218 - * @DPU_INTF_TE INTF block has TE configuration support 219 - * @DPU_DATA_HCTL_EN Allows data to be transferred at different rate 220 - than video timing 216 + * @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which 217 + * pixel data arrives to this INTF 218 + * @DPU_INTF_TE INTF block has TE configuration support 219 + * @DPU_DATA_HCTL_EN Allows data to be transferred at different rate 220 + * than video timing 221 + * @DPU_INTF_STATUS_SUPPORTED INTF block has INTF_STATUS register 221 222 * @DPU_INTF_MAX 222 223 */ 223 224 enum { 224 225 DPU_INTF_INPUT_CTRL = 0x1, 225 226 DPU_INTF_TE, 226 227 DPU_DATA_HCTL_EN, 228 + DPU_INTF_STATUS_SUPPORTED, 227 229 DPU_INTF_MAX 228 230 }; 229 231
+7 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
··· 62 62 #define INTF_LINE_COUNT 0x0B0 63 63 64 64 #define INTF_MUX 0x25C 65 + #define INTF_STATUS 0x26C 65 66 66 67 #define INTF_CFG_ACTIVE_H_EN BIT(29) 67 68 #define INTF_CFG_ACTIVE_V_EN BIT(30) ··· 298 297 struct intf_status *s) 299 298 { 300 299 struct dpu_hw_blk_reg_map *c = &intf->hw; 300 + unsigned long cap = intf->cap->features; 301 301 302 - s->is_en = DPU_REG_READ(c, INTF_TIMING_ENGINE_EN); 302 + if (cap & BIT(DPU_INTF_STATUS_SUPPORTED)) 303 + s->is_en = DPU_REG_READ(c, INTF_STATUS) & BIT(0); 304 + else 305 + s->is_en = DPU_REG_READ(c, INTF_TIMING_ENGINE_EN); 306 + 303 307 s->is_prog_fetch_en = !!(DPU_REG_READ(c, INTF_CONFIG) & BIT(31)); 304 308 if (s->is_en) { 305 309 s->frame_count = DPU_REG_READ(c, INTF_FRAME_COUNT);