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

Commit 2f0444a0 authored by Kalyan Thota's avatar Kalyan Thota Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: ignore last close during cont splash



Ignore last close call to msm when continuous splash is
still ON. This is to avoid cleaning up the states when
we did not receive first commit.

Change-Id: Ide8df725415d0ff15159be01790535b8a8ab0dfc
Signed-off-by: default avatarKalyan Thota <kalyant@codeaurora.org>
parent 4731ea89
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -947,6 +947,14 @@ static void msm_lastclose(struct drm_device *dev)
	struct msm_kms *kms = priv->kms;
	int i;

	/* check for splash status before triggering cleanup
	 * if we end up here with splash status ON i.e before first
	 * commit then ignore the last close call
	 */
	if (kms && kms->funcs && kms->funcs->check_for_splash
		&& kms->funcs->check_for_splash(kms))
		return;

	/*
	 * clean up vblank disable immediately as this is the last close.
	 */
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -106,6 +106,8 @@ struct msm_kms_funcs {
			unsigned int domain);
	/* handle continuous splash  */
	int (*cont_splash_config)(struct msm_kms *kms);
	/* check for continuous splash status */
	bool (*check_for_splash)(struct msm_kms *kms);
};

struct msm_kms {
+14 −0
Original line number Diff line number Diff line
@@ -2704,6 +2704,19 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms)
	return rc;
}

static bool sde_kms_check_for_splash(struct msm_kms *kms)
{
	struct sde_kms *sde_kms;

	if (!kms) {
		SDE_ERROR("invalid kms\n");
		return false;
	}

	sde_kms = to_sde_kms(kms);
	return sde_kms->splash_data.cont_splash_en;
}

static int sde_kms_pm_suspend(struct device *dev)
{
	struct drm_device *ddev;
@@ -2904,6 +2917,7 @@ static const struct msm_kms_funcs kms_funcs = {
	.register_events = _sde_kms_register_events,
	.get_address_space = _sde_kms_get_address_space,
	.postopen = _sde_kms_post_open,
	.check_for_splash = sde_kms_check_for_splash,
};

/* the caller api needs to turn on clock before calling it */