disp: msm: sde: report AVR_STATUS in vsync_event sysfs node

Report the AVR_STATUS which indicates if there's a pending
trigger when Adaptive Variable Refresh feature is enabled.
This allows SW to detect whether the old frame is repeated
or if the new frame was taken when the trigger is very
close to Vsync.

Change-Id: I6b04482e5c4c3bb92bad426c529c1fd3612d41c3
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
This commit is contained in:
Steve Cohen
2021-03-17 17:34:35 -04:00
parent 3090ffd63f
commit 61e6723732
7 changed files with 71 additions and 2 deletions

View File

@@ -184,6 +184,20 @@ static void sde_hw_intf_avr_ctrl(struct sde_hw_intf *ctx,
SDE_REG_WRITE(c, INTF_AVR_MODE, avr_mode);
}
static u32 sde_hw_intf_get_avr_status(struct sde_hw_intf *ctx)
{
struct sde_hw_blk_reg_map *c;
u32 avr_ctrl;
if (!ctx)
return false;
c = &ctx->hw;
avr_ctrl = SDE_REG_READ(c, INTF_AVR_CONTROL);
return avr_ctrl >> 31;
}
static inline void _check_and_set_comp_bit(struct sde_hw_intf *ctx,
bool dsc_4hs_merge, bool compression_en, u32 *intf_cfg2)
{
@@ -868,6 +882,9 @@ static void _setup_intf_ops(struct sde_hw_intf_ops *ops,
if (cap & BIT(SDE_INTF_WD_TIMER))
ops->setup_vsync_source = sde_hw_intf_setup_vsync_source;
if (cap & BIT(SDE_INTF_AVR_STATUS))
ops->get_avr_status = sde_hw_intf_get_avr_status;
if (cap & BIT(SDE_INTF_TE)) {
ops->setup_tearcheck = sde_hw_intf_setup_te_config;
ops->enable_tearcheck = sde_hw_intf_enable_te;