Merge "msm: mdss: fix spurious wait4pingpong timeouts"
This commit is contained in:
commit
db4b424be4
2 changed files with 23 additions and 4 deletions
|
@ -56,7 +56,8 @@
|
|||
#define C0_G_Y 0 /* G/luma */
|
||||
|
||||
/* wait for at most 2 vsync for lowest refresh rate (24hz) */
|
||||
#define KOFF_TIMEOUT msecs_to_jiffies(84)
|
||||
#define KOFF_TIMEOUT_MS 84
|
||||
#define KOFF_TIMEOUT msecs_to_jiffies(KOFF_TIMEOUT_MS)
|
||||
|
||||
#define OVERFETCH_DISABLE_TOP BIT(0)
|
||||
#define OVERFETCH_DISABLE_BOTTOM BIT(1)
|
||||
|
|
|
@ -1835,6 +1835,26 @@ int mdss_mdp_cmd_reconfigure_splash_done(struct mdss_mdp_ctl *ctl,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int __mdss_mdp_wait4pingpong(struct mdss_mdp_cmd_ctx *ctx)
|
||||
{
|
||||
int rc = 0;
|
||||
s64 expected_time = ktime_to_ms(ktime_get()) + KOFF_TIMEOUT_MS;
|
||||
s64 time;
|
||||
|
||||
do {
|
||||
rc = wait_event_timeout(ctx->pp_waitq,
|
||||
atomic_read(&ctx->koff_cnt) == 0,
|
||||
KOFF_TIMEOUT);
|
||||
time = ktime_to_ms(ktime_get());
|
||||
|
||||
MDSS_XLOG(rc, time, expected_time, atomic_read(&ctx->koff_cnt));
|
||||
/* If we timed out, counter is valid and time is less, wait again */
|
||||
} while (atomic_read(&ctx->koff_cnt) && (rc == 0) &&
|
||||
(time < expected_time));
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int mdss_mdp_cmd_wait4pingpong(struct mdss_mdp_ctl *ctl, void *arg)
|
||||
{
|
||||
struct mdss_mdp_cmd_ctx *ctx;
|
||||
|
@ -1856,9 +1876,7 @@ static int mdss_mdp_cmd_wait4pingpong(struct mdss_mdp_ctl *ctl, void *arg)
|
|||
pr_debug("%s: intf_num=%d ctx=%p koff_cnt=%d\n", __func__,
|
||||
ctl->intf_num, ctx, atomic_read(&ctx->koff_cnt));
|
||||
|
||||
rc = wait_event_timeout(ctx->pp_waitq,
|
||||
atomic_read(&ctx->koff_cnt) == 0,
|
||||
KOFF_TIMEOUT);
|
||||
rc = __mdss_mdp_wait4pingpong(ctx);
|
||||
|
||||
trace_mdp_cmd_wait_pingpong(ctl->num,
|
||||
atomic_read(&ctx->koff_cnt));
|
||||
|
|
Loading…
Add table
Reference in a new issue