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

Commit 6d21d4c0 authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: add kthread_flush_work for crtc event thread



CRTC waits for frame_events of the previous frame to be
processed from the event thread before every kickoff. Though
the event thread is configured with realtime priority, it
might be taking longer duration to execute due to scheduling
delays and this results in frame_done timeouts as the commit
thread waits for only a specified duration. Add flush work
for event threads before the wait, to make sure the event
thread execution is completed.

Change-Id: I9a483e87daf8440a0bd90a76f3445c0a228c3856
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent cd538dbf
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -3228,7 +3228,7 @@ static void sde_crtc_destroy_state(struct drm_crtc *crtc,
static int _sde_crtc_wait_for_frame_done(struct drm_crtc *crtc)
{
	struct sde_crtc *sde_crtc;
	int ret, rc = 0;
	int ret, rc = 0, i;

	if (!crtc) {
		SDE_ERROR("invalid argument\n");
@@ -3241,7 +3241,17 @@ static int _sde_crtc_wait_for_frame_done(struct drm_crtc *crtc)
		return 0;
	}

	SDE_EVT32_VERBOSE(DRMID(crtc), SDE_EVTLOG_FUNC_ENTRY);
	SDE_EVT32(DRMID(crtc), SDE_EVTLOG_FUNC_ENTRY);

	/*
	 * flush all the event thread work to make sure all the
	 * FRAME_EVENTS from encoder are propagated to crtc
	 */
	for (i = 0; i < ARRAY_SIZE(sde_crtc->frame_events); i++) {
		if (list_empty(&sde_crtc->frame_events[i].list))
			kthread_flush_work(&sde_crtc->frame_events[i].work);
	}

	ret = wait_for_completion_timeout(&sde_crtc->frame_done_comp,
			msecs_to_jiffies(SDE_FRAME_DONE_TIMEOUT));
	if (!ret) {