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

Commit fe9857b5 authored by Camus Wong's avatar Camus Wong
Browse files

DRM: SDE: Avoid vblank request to the same state



This change add check to existing vblank request state.  It will avoid
enable vblank multiple times.  It will also avoid disable vblank
multiple times.

Change-Id: I10781c33e51b1032b72fcbc1a01a7d01be8be510
Signed-off-by: default avatarCamus Wong <camusw@codeaurora.org>
parent f0020b57
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -1190,7 +1190,7 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
			sde_crtc->vblank_requested) {
		ret = _sde_crtc_vblank_enable_no_lock(sde_crtc, false);
		if (ret)
			SDE_ERROR("%s vblank enable failed: %d\n",
			SDE_ERROR("%s vblank disable failed: %d\n",
				sde_crtc->name, ret);
	}

@@ -1491,6 +1491,7 @@ int sde_crtc_vblank(struct drm_crtc *crtc, bool en)
	sde_crtc = to_sde_crtc(crtc);

	mutex_lock(&sde_crtc->crtc_lock);
	if (sde_crtc->vblank_requested != en) {
		SDE_EVT32(DRMID(&sde_crtc->base), en, sde_crtc->enabled,
				sde_crtc->suspend, sde_crtc->vblank_requested);
		if (sde_crtc->enabled && !sde_crtc->suspend) {
@@ -1501,6 +1502,7 @@ int sde_crtc_vblank(struct drm_crtc *crtc, bool en)
		}

		sde_crtc->vblank_requested = en;
	}
	mutex_unlock(&sde_crtc->crtc_lock);

	return 0;