Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db4b424b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: fix spurious wait4pingpong timeouts"

parents 3f151577 d3a18691
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)
+21 −3
Original line number Diff line number Diff line
@@ -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));