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

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

drm/msm/sde: delay inline rotate start until kickoff



Avoid sending the inline rotate start until the actual hardware
kickoff is dispatched. This prevents the rotator driver from
detecting a false timeout while the DRM driver is waiting for
the previous frame to complete.

Change-Id: I8df2ecb2cb245401f357d8082f16e30452c26574
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent 2f90dca7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1220,7 +1220,8 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
				state->src_w >> 16, state->src_h >> 16,
				state->crtc_x, state->crtc_y,
				state->crtc_w, state->crtc_h,
				cstate->sbuf_cfg.rot_op_mode);
				flush_tmp ? cstate->sbuf_cfg.rot_op_mode :
				SDE_CTL_ROT_OP_MODE_OFFLINE);

		stage_idx = zpos_cnt[pstate->stage]++;
		stage_cfg->stage[pstate->stage][stage_idx] =
@@ -2119,6 +2120,7 @@ static int _sde_crtc_wait_for_frame_done(struct drm_crtc *crtc)

void sde_crtc_commit_kickoff(struct drm_crtc *crtc)
{
	struct drm_plane *plane;
	struct drm_encoder *encoder;
	struct drm_device *dev;
	struct sde_crtc *sde_crtc;
@@ -2189,6 +2191,10 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc)
	}
	sde_crtc->play_count++;

	if (cstate->sbuf_cfg.rot_op_mode != SDE_CTL_ROT_OP_MODE_OFFLINE)
		drm_atomic_crtc_for_each_plane(plane, crtc)
			sde_plane_kickoff(plane);

	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
		if (encoder->crtc != crtc)
			continue;
+12 −17
Original line number Diff line number Diff line
@@ -1753,7 +1753,7 @@ static void sde_plane_rot_calc_cfg(struct drm_plane *plane,
			drm_rect_height(&rstate->out_rot_rect) >> 16,
			rstate->out_rot_rect.x1 >> 16,
			rstate->out_rot_rect.y1 >> 16);
	SDE_EVT32_VERBOSE(DRMID(plane), rstate->sequence_id,
	SDE_EVT32(DRMID(plane), rstate->sequence_id,
			rstate->out_xpos, rstate->nplane,
			in_rot->x1 >> 16, in_rot->y1 >> 16,
			drm_rect_width(in_rot) >> 16,
@@ -2353,16 +2353,18 @@ 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)
void sde_plane_kickoff(struct drm_plane *plane)
{
	if (!plane || !pstate || !pstate->rot.rot_hw ||
			!pstate->rot.rot_hw->ops.commit)
	struct sde_plane_state *pstate;

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

	pstate = to_sde_plane_state(plane->state);

	if (!pstate->rot.rot_hw || !pstate->rot.rot_hw->ops.commit)
		return;

	pstate->rot.rot_hw->ops.commit(pstate->rot.rot_hw,
@@ -3140,10 +3142,6 @@ static int sde_plane_atomic_check(struct drm_plane *plane,
	return ret;
}

/**
 * sde_plane_flush - final plane operations before commit flush
 * @plane: Pointer to drm plane structure
 */
void sde_plane_flush(struct drm_plane *plane)
{
	struct sde_plane *psde;
@@ -3177,9 +3175,6 @@ void sde_plane_flush(struct drm_plane *plane)
	/* flag h/w flush complete */
	if (plane->state)
		pstate->pending = false;

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

static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
+6 −0
Original line number Diff line number Diff line
@@ -226,6 +226,12 @@ void sde_plane_restore(struct drm_plane *plane);
 */
void sde_plane_flush(struct drm_plane *plane);

/**
 * sde_plane_kickoff - final plane operations before commit kickoff
 * @plane: Pointer to drm plane structure
 */
void sde_plane_kickoff(struct drm_plane *plane);

/**
 * sde_plane_init - create new sde plane for the given pipe
 * @dev:   Pointer to DRM device