Merge "disp: msm: sde: use INTF mdp_vsync timestamp only for video-mode" into display-kernel.lnx.5.15
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
e4a2f166c3
@@ -158,15 +158,16 @@ ktime_t sde_encoder_calc_last_vsync_timestamp(struct drm_encoder *drm_enc)
|
||||
struct intf_status intf_status = {0};
|
||||
unsigned long features;
|
||||
u32 fps;
|
||||
bool is_cmd, is_vid;
|
||||
|
||||
sde_enc = to_sde_encoder_virt(drm_enc);
|
||||
cur_master = sde_enc->cur_master;
|
||||
fps = sde_encoder_get_fps(drm_enc);
|
||||
is_cmd = sde_encoder_check_curr_mode(drm_enc, MSM_DISPLAY_CMD_MODE);
|
||||
is_vid = sde_encoder_check_curr_mode(drm_enc, MSM_DISPLAY_VIDEO_MODE);
|
||||
|
||||
if (!cur_master || !cur_master->hw_intf || !fps
|
||||
|| !cur_master->hw_intf->ops.get_vsync_timestamp
|
||||
|| (!sde_encoder_check_curr_mode(drm_enc, MSM_DISPLAY_CMD_MODE)
|
||||
&& !sde_encoder_check_curr_mode(drm_enc, MSM_DISPLAY_VIDEO_MODE)))
|
||||
|| !cur_master->hw_intf->ops.get_vsync_timestamp || (!is_cmd && !is_vid))
|
||||
return 0;
|
||||
|
||||
features = cur_master->hw_intf->cap->features;
|
||||
@@ -182,7 +183,7 @@ ktime_t sde_encoder_calc_last_vsync_timestamp(struct drm_encoder *drm_enc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
vsync_counter = cur_master->hw_intf->ops.get_vsync_timestamp(cur_master->hw_intf);
|
||||
vsync_counter = cur_master->hw_intf->ops.get_vsync_timestamp(cur_master->hw_intf, is_vid);
|
||||
qtmr_counter = arch_timer_read_counter();
|
||||
cur_time = ktime_get_ns();
|
||||
|
||||
|
@@ -224,14 +224,14 @@ static void sde_hw_intf_reset_counter(struct sde_hw_intf *ctx)
|
||||
SDE_REG_WRITE(c, INTF_LINE_COUNT, BIT(31));
|
||||
}
|
||||
|
||||
static u64 sde_hw_intf_get_vsync_timestamp(struct sde_hw_intf *ctx)
|
||||
static u64 sde_hw_intf_get_vsync_timestamp(struct sde_hw_intf *ctx, bool is_vid)
|
||||
{
|
||||
struct sde_hw_blk_reg_map *c = &ctx->hw;
|
||||
u32 timestamp_lo, timestamp_hi;
|
||||
u64 timestamp = 0;
|
||||
u32 reg_ts_0, reg_ts_1;
|
||||
|
||||
if (ctx->cap->features & BIT(SDE_INTF_MDP_VSYNC_TS)) {
|
||||
if (ctx->cap->features & BIT(SDE_INTF_MDP_VSYNC_TS) && is_vid) {
|
||||
reg_ts_0 = INTF_MDP_VSYNC_TIMESTAMP0;
|
||||
reg_ts_1 = INTF_MDP_VSYNC_TIMESTAMP1;
|
||||
} else {
|
||||
|
@@ -236,7 +236,7 @@ struct sde_hw_intf_ops {
|
||||
/**
|
||||
* Get the HW vsync timestamp counter
|
||||
*/
|
||||
u64 (*get_vsync_timestamp)(struct sde_hw_intf *intf);
|
||||
u64 (*get_vsync_timestamp)(struct sde_hw_intf *intf, bool is_vid);
|
||||
|
||||
/**
|
||||
* Enable processing of 2 pixels per clock
|
||||
|
Reference in New Issue
Block a user