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

Commit 8f43c01c authored by Alan Kwong's avatar Alan Kwong
Browse files

drm/msm/sde: avoid fence reset during modeset crtc disable



Fence is signalled during crtc disable for any outstanding
commits. This is correct if crtc is disabled for this commit.
Since crtc disable is also invoked during modeset, fence will
be signalled prematurely if crtc is modeset to enable for this
commit. Add check to avoid fence signal during crtc disable if
modeset is in progress and crtc will be enabled and active for
this commit.

Change-Id: I718c6281916c2a018e17da3f9b8f0e67bccd60d5
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 003ee1e0
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -3848,7 +3848,8 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
				atomic_read(&sde_crtc->frame_pending));

	SDE_EVT32(DRMID(crtc), sde_crtc->enabled, sde_crtc->suspend,
			sde_crtc->vblank_requested);
			sde_crtc->vblank_requested,
			crtc->state->active, crtc->state->enable);
	if (sde_crtc->enabled && !sde_crtc->suspend &&
			sde_crtc->vblank_requested) {
		ret = _sde_crtc_vblank_enable_no_lock(sde_crtc, false);
@@ -3893,11 +3894,14 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
	/**
	 * All callbacks are unregistered and frame done waits are complete
	 * at this point. No buffers are accessed by hardware.
	 * reset the fence timeline if there is any issue.
	 * reset the fence timeline if crtc will not be enabled for this commit
	 */
	if (!crtc->state->active || !crtc->state->enable) {
		sde_fence_signal(&sde_crtc->output_fence, ktime_get(), true);
		for (i = 0; i < cstate->num_connectors; ++i)
		sde_connector_commit_reset(cstate->connectors[i], ktime_get());
			sde_connector_commit_reset(cstate->connectors[i],
					ktime_get());
	}

	memset(sde_crtc->mixers, 0, sizeof(sde_crtc->mixers));
	sde_crtc->num_mixers = 0;