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

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

Merge "drm/msm/sde: Update color processing on suspend/resume transitions"

parents 84b54be0 c5c2e0b2
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -2380,8 +2380,6 @@ static void _sde_crtc_set_suspend(struct drm_crtc *crtc, bool enable)
	struct sde_crtc *sde_crtc;
	struct msm_drm_private *priv;
	struct sde_kms *sde_kms;
	struct drm_event event;
	u32 power_on;
	int ret = 0;

	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
@@ -2402,19 +2400,6 @@ static void _sde_crtc_set_suspend(struct drm_crtc *crtc, bool enable)

	mutex_lock(&sde_crtc->crtc_lock);

	event.type = DRM_EVENT_CRTC_POWER;
	event.length = sizeof(u32);
	/*
	 * Update CP on suspend/resume transitions
	 */
	if (enable && !sde_crtc->suspend) {
		sde_cp_crtc_suspend(crtc);
		power_on = 0;
	} else if (!enable && sde_crtc->suspend) {
		sde_cp_crtc_resume(crtc);
		power_on = 1;
	}

	/*
	 * If the vblank is enabled, release a power reference on suspend
	 * and take it back during resume (if it is still enabled).
@@ -2432,8 +2417,6 @@ static void _sde_crtc_set_suspend(struct drm_crtc *crtc, bool enable)
	}

	sde_crtc->suspend = enable;
	msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
			(u8 *)&power_on);
	mutex_unlock(&sde_crtc->crtc_lock);
}

@@ -2612,6 +2595,8 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
	struct msm_drm_private *priv;
	unsigned long flags;
	struct sde_crtc_irq_info *node = NULL;
	struct drm_event event;
	u32 power_on;
	int ret;

	if (!crtc || !crtc->dev || !crtc->dev->dev_private || !crtc->state) {
@@ -2630,6 +2615,14 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
	mutex_lock(&sde_crtc->crtc_lock);
	SDE_EVT32_VERBOSE(DRMID(crtc));

	/* update color processing on suspend */
	event.type = DRM_EVENT_CRTC_POWER;
	event.length = sizeof(u32);
	sde_cp_crtc_suspend(crtc);
	power_on = 0;
	msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
			(u8 *)&power_on);

	/* wait for frame_event_done completion */
	if (_sde_crtc_wait_for_frame_done(crtc))
		SDE_ERROR("crtc%d wait for frame done failed;frame_pending%d\n",
@@ -2696,6 +2689,8 @@ static void sde_crtc_enable(struct drm_crtc *crtc)
	struct msm_drm_private *priv;
	unsigned long flags;
	struct sde_crtc_irq_info *node = NULL;
	struct drm_event event;
	u32 power_on;
	int ret;

	if (!crtc || !crtc->dev || !crtc->dev->dev_private) {
@@ -2726,6 +2721,15 @@ static void sde_crtc_enable(struct drm_crtc *crtc)
					sde_crtc->name, ret);
	}
	sde_crtc->enabled = true;

	/* update color processing on resume */
	event.type = DRM_EVENT_CRTC_POWER;
	event.length = sizeof(u32);
	sde_cp_crtc_resume(crtc);
	power_on = 1;
	msm_mode_object_event_notify(&crtc->base, crtc->dev, &event,
			(u8 *)&power_on);

	mutex_unlock(&sde_crtc->crtc_lock);

	spin_lock_irqsave(&sde_crtc->spin_lock, flags);