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

Commit bf8aed20 authored by Jayaprakash's avatar Jayaprakash
Browse files

disp: msm: sde: add plane check in continuous splash case



In dual display continuous splash case, there are certain
scenarios where pipe being used in secondary display at boot up
is allocated by primary crtc. Add check to return failure
in such cases.

Change-Id: I9047b6e7f91e59a9daff5089abb41017c068b449
Signed-off-by: default avatarJayaprakash <jmadiset@codeaurora.org>
parent 700f3cc7
Loading
Loading
Loading
Loading
+43 −0
Original line number Original line Diff line number Diff line
@@ -2534,6 +2534,44 @@ static int _sde_atomic_check_excl_rect(struct sde_plane *psde,
	return ret;
	return ret;
}
}



static int _sde_plane_validate_shared_crtc(struct sde_plane *psde,
				struct drm_plane_state *state)
{
	struct sde_kms *sde_kms;
	struct sde_splash_display *splash_display;
	int i, j;

	sde_kms = _sde_plane_get_kms(&psde->base);

	if (!sde_kms || !state->crtc)
		return 0;

	for (i = 0; i < MAX_DSI_DISPLAYS; i++) {
		splash_display = &sde_kms->splash_data.splash_display[i];

		if (splash_display && splash_display->cont_splash_enabled &&
			splash_display->encoder &&
			state->crtc != splash_display->encoder->crtc) {

			for (j = 0; j < MAX_DATA_PATH_PER_DSIPLAY; j++) {

				if (splash_display->pipes[j].sspp ==
						psde->pipe) {
					SDE_ERROR_PLANE(psde,
					"pipe:%d used in cont-splash on crtc:%d\n",
					psde->pipe,
					splash_display->encoder->crtc->base.id);
					return -EINVAL;
				}
			}
		}
	}

	return 0;

}

static int sde_plane_sspp_atomic_check(struct drm_plane *plane,
static int sde_plane_sspp_atomic_check(struct drm_plane *plane,
		struct drm_plane_state *state)
		struct drm_plane_state *state)
{
{
@@ -2634,6 +2672,11 @@ static int sde_plane_sspp_atomic_check(struct drm_plane *plane,
	ret = _sde_atomic_check_excl_rect(psde, pstate,
	ret = _sde_atomic_check_excl_rect(psde, pstate,
		&src, fmt, ret);
		&src, fmt, ret);


	if (ret)
		return ret;

	ret = _sde_plane_validate_shared_crtc(psde, state);

	if (ret)
	if (ret)
		return ret;
		return ret;