disp: msm: sde: remove idle time from Qsync threshold calculation
Remove idle time from the Qsync calculation as this was added by mistake to allow writes to complete just before the next TE but this causes tearing. Also, to ensure tearing doesn't recur, round down the threshold lines to the nearest multiple of 4, and remove a couple of extra lines to compensate for potential latencies. Change-Id: I8a53a989e26cbd7f0e2b94caa8df8f5bee3ad26c Signed-off-by: Steve Cohen <cohens@codeaurora.org>
This commit is contained in:
@@ -908,8 +908,6 @@ static int _get_tearcheck_threshold(struct sde_encoder_phys *phys_enc)
|
||||
u32 default_time_ns;
|
||||
u32 extra_time_ns;
|
||||
u32 default_line_time_ns;
|
||||
u32 idle_time_ns = 0;
|
||||
u32 transfer_time_us = 0;
|
||||
|
||||
if (phys_enc->parent_ops.get_qsync_fps)
|
||||
phys_enc->parent_ops.get_qsync_fps(
|
||||
@@ -932,26 +930,24 @@ static int _get_tearcheck_threshold(struct sde_encoder_phys *phys_enc)
|
||||
/* Calculate the number of extra lines*/
|
||||
slow_time_ns = DIV_ROUND_UP(1000000000, qsync_min_fps);
|
||||
default_time_ns = DIV_ROUND_UP(1000000000, default_fps);
|
||||
sde_encoder_get_transfer_time(phys_enc->parent,
|
||||
&transfer_time_us);
|
||||
if (transfer_time_us)
|
||||
idle_time_ns = default_time_ns -
|
||||
(1000 * transfer_time_us);
|
||||
extra_time_ns = slow_time_ns - default_time_ns;
|
||||
default_line_time_ns = DIV_ROUND_UP(default_time_ns, yres);
|
||||
|
||||
extra_time_ns = slow_time_ns - default_time_ns + idle_time_ns;
|
||||
default_line_time_ns = DIV_ROUND_UP(1000000000, default_fps * yres);
|
||||
threshold_lines = extra_time_ns / default_line_time_ns;
|
||||
|
||||
threshold_lines = DIV_ROUND_UP(extra_time_ns, default_line_time_ns);
|
||||
/* some DDICs express the timeout value in lines/4, round down to compensate */
|
||||
threshold_lines = round_down(threshold_lines, 4);
|
||||
/* remove 2 lines to cover for latency */
|
||||
if (threshold_lines - 2 > DEFAULT_TEARCHECK_SYNC_THRESH_START)
|
||||
threshold_lines -= 2;
|
||||
|
||||
SDE_DEBUG_CMDENC(cmd_enc, "slow:%d default:%d extra:%d(ns)\n",
|
||||
slow_time_ns, default_time_ns, extra_time_ns);
|
||||
SDE_DEBUG_CMDENC(cmd_enc, "xfer:%d(us) idle:%d(ns) lines:%d\n",
|
||||
transfer_time_us, idle_time_ns, threshold_lines);
|
||||
SDE_DEBUG_CMDENC(cmd_enc, "min_fps:%d fps:%d yres:%d\n",
|
||||
qsync_min_fps, default_fps, yres);
|
||||
SDE_DEBUG_CMDENC(cmd_enc, "min_fps:%d fps:%d yres:%d lines:%d\n",
|
||||
qsync_min_fps, default_fps, yres, threshold_lines);
|
||||
|
||||
SDE_EVT32(qsync_mode, qsync_min_fps, extra_time_ns, default_fps,
|
||||
yres, transfer_time_us, threshold_lines);
|
||||
yres, threshold_lines);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
Reference in New Issue
Block a user