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

Commit a1665093 authored by Prabhanjan Kandula's avatar Prabhanjan Kandula
Browse files

drm/msm/sde: reset plane state if not used in first commit



For planes attached in continuous splash, if client is not reading
the plane state and neither disabled the plane leads to stale
plane state and it can cause atomic check failures as there is no
valid fb attached. This change reset the plane state of the planes
used in continuous splash during continuous splash handoff only if
client is not using the plane in the current commit.

Change-Id: Ia2ddf1f1d3ca6b3f4660e80c88d5acf97897b0c7
Signed-off-by: default avatarPrabhanjan Kandula <pkandula@codeaurora.org>
parent c444ac04
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -1047,6 +1047,9 @@ static void _sde_kms_release_splash_resource(struct sde_kms *sde_kms,
{
	struct msm_drm_private *priv;
	struct sde_splash_display *splash_display;
	struct drm_plane *plane;
	enum sde_sspp plane_id;
	bool is_virtual;
	int i;

	if (!sde_kms || !crtc)
@@ -1069,6 +1072,29 @@ static void _sde_kms_release_splash_resource(struct sde_kms *sde_kms,
	if (i >= MAX_DSI_DISPLAYS)
		return;

	/*
	 * For planes attached in continuous splash, reset the plane state
	 * only if first commit is not using the plane for display.
	 * Valid fb indicates client is using the plane.
	 */
	for (i = 0; i < splash_display->pipe_cnt; i++) {
		drm_for_each_plane(plane, sde_kms->dev) {
			plane_id = sde_plane_pipe(plane);
			is_virtual = is_sde_plane_virtual(plane);

			if ((plane_id != splash_display->pipes[i].sspp) ||
				(splash_display->pipes[i].is_virtual !=
					 is_virtual) || (plane->state->fb))
				continue;

			plane->crtc = NULL;
			plane->state->crtc = NULL;
			SDE_DEBUG("reset crtc plane:%d rect:%d\n",
					plane_id, is_virtual);
			break;
		}
	}

	_sde_kms_splash_mem_put(sde_kms, splash_display->splash);

	if (splash_display->cont_splash_enabled) {