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

Commit ddbf775d authored by Clarence Ip's avatar Clarence Ip
Browse files

drm/msm/sde: send start command to inline rotation



Inline rotations are handled by the external rotator driver,
but any timeout detection by the rotator needs to be delayed
until after the DRM is ready to start the commit operation.

The rotator is notified during the plane's flush function
that the DRM is ready to start the hardware commit.

CRs-Fixed: 2046958
Change-Id: I9c1a56cbe0b0fe4a07b1cbcddccc4f62c83ccdcf
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent b25c65cb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -563,6 +563,10 @@ static int sde_hw_rot_commit(struct sde_hw_rot *hw, struct sde_hw_rot_cmd *data,
	case SDE_HW_ROT_CMD_COMMIT:
		cmd_type = SDE_ROTATOR_INLINE_CMD_COMMIT;
		break;
	case SDE_HW_ROT_CMD_START:
		cmd_type = SDE_ROTATOR_INLINE_CMD_START;
		priv_handle = data->priv_handle;
		break;
	case SDE_HW_ROT_CMD_CLEANUP:
		cmd_type = SDE_ROTATOR_INLINE_CMD_CLEANUP;
		priv_handle = data->priv_handle;
+2 −0
Original line number Diff line number Diff line
@@ -24,11 +24,13 @@ struct sde_hw_rot;
 * enum sde_hw_rot_cmd_type - type of rotator hardware command
 * @SDE_HW_ROT_CMD_VALDIATE: validate rotator command; do not commit
 * @SDE_HW_ROT_CMD_COMMIT: commit/execute rotator command
 * @SDE_HW_ROT_CMD_START: mdp is ready to start
 * @SDE_HW_ROT_CMD_CLEANUP: cleanup rotator command after it is done
 */
enum sde_hw_rot_cmd_type {
	SDE_HW_ROT_CMD_VALIDATE,
	SDE_HW_ROT_CMD_COMMIT,
	SDE_HW_ROT_CMD_START,
	SDE_HW_ROT_CMD_CLEANUP,
};

+24 −2
Original line number Diff line number Diff line
@@ -2040,6 +2040,23 @@ static void sde_plane_rot_atomic_update(struct drm_plane *plane,
	sde_plane_rot_submit_command(plane, state, SDE_HW_ROT_CMD_COMMIT);
}

/**
 * sde_plane_rot_flush - perform final flush related rotator options
 * @plane: Pointer to drm plane
 * @pstate: Pointer to sde plane state
 */
static void sde_plane_rot_flush(struct drm_plane *plane,
		struct sde_plane_state *pstate)
{
	if (!plane || !pstate || !pstate->rot.rot_hw ||
			!pstate->rot.rot_hw->ops.commit)
		return;

	pstate->rot.rot_hw->ops.commit(pstate->rot.rot_hw,
			&pstate->rot.rot_cmd,
			SDE_HW_ROT_CMD_START);
}

/**
 * sde_plane_rot_destroy_state - destroy state for rotator stage
 * @plane: Pointer to drm plane
@@ -2706,13 +2723,15 @@ static int sde_plane_atomic_check(struct drm_plane *plane,
void sde_plane_flush(struct drm_plane *plane)
{
	struct sde_plane *psde;
	struct sde_plane_state *pstate;

	if (!plane) {
	if (!plane || !plane->state) {
		SDE_ERROR("invalid plane\n");
		return;
	}

	psde = to_sde_plane(plane);
	pstate = to_sde_plane_state(plane->state);

	/*
	 * These updates have to be done immediately before the plane flush
@@ -2733,7 +2752,10 @@ void sde_plane_flush(struct drm_plane *plane)

	/* flag h/w flush complete */
	if (plane->state)
		to_sde_plane_state(plane->state)->pending = false;
		pstate->pending = false;

	/* signal inline rotator start */
	sde_plane_rot_flush(plane, pstate);
}

static int sde_plane_sspp_atomic_update(struct drm_plane *plane,