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

Commit 7e5f0002 authored by Clarence Ip's avatar Clarence Ip
Browse files

drm/msm/sde: insert extra inline rotator flush



Set the rotator flush mask for the first frame after an
inline rotation operation to allow the hardware to
transition out of inline rotation mode correctly.

CRs-Fixed: 2056550
Change-Id: I993565a1850031a29b7079fe25c72d6f1ba48dcf
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent 0b5f4419
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1112,7 +1112,7 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
	struct sde_hw_stage_cfg *stage_cfg;
	struct sde_rect plane_crtc_roi;

	u32 flush_mask = 0;
	u32 flush_mask, flush_sbuf, flush_tmp;
	uint32_t lm_idx = LEFT_MIXER, stage_idx;
	bool bg_alpha_enable[CRTC_DUAL_MIXERS] = {false};
	int zpos_cnt[CRTC_DUAL_MIXERS][SDE_STAGE_MAX + 1] = { {0} };
@@ -1129,6 +1129,7 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
	lm = mixer->hw_lm;
	stage_cfg = &sde_crtc->stage_cfg;
	cstate = to_sde_crtc_state(crtc->state);
	flush_sbuf = 0x0;

	drm_atomic_crtc_for_each_plane(plane, crtc) {
		state = plane->state;
@@ -1146,8 +1147,11 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
		if (sde_plane_is_sbuf_mode(plane, &prefill))
			sbuf_mode = true;

		sde_plane_get_ctl_flush(plane, ctl, &flush_mask);
		sde_plane_get_ctl_flush(plane, ctl, &flush_mask, &flush_tmp);

		/* persist rotator flush bit(s) for one more commit */
		flush_mask |= cstate->sbuf_flush_mask | flush_tmp;
		flush_sbuf |= flush_tmp;

		SDE_DEBUG("crtc %d stage:%d - plane %d sspp %d fb %d\n",
				crtc->base.id,
@@ -1208,6 +1212,8 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
		}
	}

	cstate->sbuf_flush_mask = flush_sbuf;

	if (lm && lm->ops.setup_dim_layer) {
		cstate = to_sde_crtc_state(crtc->state);
		for (i = 0; i < cstate->num_dim_layers; i++)
+2 −0
Original line number Diff line number Diff line
@@ -272,6 +272,7 @@ struct sde_crtc_respool {
 * @new_perf: new performance state
 * @sbuf_cfg: stream buffer configuration
 * @sbuf_prefill_line: number of line for inline rotator prefetch
 * @sbuf_flush_mask: flush mask for inline rotator
 */
struct sde_crtc_state {
	struct drm_crtc_state base;
@@ -299,6 +300,7 @@ struct sde_crtc_state {
	struct sde_core_perf_params new_perf;
	struct sde_ctl_sbuf_cfg sbuf_cfg;
	u64 sbuf_prefill_line;
	u32 sbuf_flush_mask;

	struct sde_crtc_respool rp;
};
+10 −8
Original line number Diff line number Diff line
@@ -2447,16 +2447,16 @@ int sde_plane_validate_multirect_v2(struct sde_multirect_plane_states *plane)
 * sde_plane_get_ctl_flush - get control flush for the given plane
 * @plane: Pointer to drm plane structure
 * @ctl: Pointer to hardware control driver
 * @flush: Pointer to flush control word
 * @flush_sspp: Pointer to sspp flush control word
 * @flush_rot: Pointer to rotator flush control word
 */
void sde_plane_get_ctl_flush(struct drm_plane *plane, struct sde_hw_ctl *ctl,
		u32 *flush)
		u32 *flush_sspp, u32 *flush_rot)
{
	struct sde_plane_state *pstate;
	struct sde_plane_rot_state *rstate;
	u32 bitmask;

	if (!plane || !flush) {
	if (!plane || !flush_sspp) {
		SDE_ERROR("invalid parameters\n");
		return;
	}
@@ -2464,13 +2464,15 @@ void sde_plane_get_ctl_flush(struct drm_plane *plane, struct sde_hw_ctl *ctl,
	pstate = to_sde_plane_state(plane->state);
	rstate = &pstate->rot;

	bitmask = ctl->ops.get_bitmask_sspp(ctl, sde_plane_pipe(plane));
	*flush_sspp = ctl->ops.get_bitmask_sspp(ctl, sde_plane_pipe(plane));

	if (!flush_rot)
		return;

	*flush_rot = 0x0;
	if (sde_plane_is_sbuf_mode(plane, NULL) && rstate->rot_hw &&
			ctl->ops.get_bitmask_rot)
		ctl->ops.get_bitmask_rot(ctl, &bitmask, rstate->rot_hw->idx);

	*flush = bitmask;
		ctl->ops.get_bitmask_rot(ctl, flush_rot, rstate->rot_hw->idx);
}

static int sde_plane_prepare_fb(struct drm_plane *plane,
+3 −2
Original line number Diff line number Diff line
@@ -169,10 +169,11 @@ bool is_sde_plane_virtual(struct drm_plane *plane);
 * sde_plane_get_ctl_flush - get control flush mask
 * @plane:   Pointer to DRM plane object
 * @ctl: Pointer to control hardware
 * @flush: Pointer to updated flush mask
 * @flush_sspp: Pointer to sspp flush control word
 * @flush_rot: Pointer to rotator flush control word
 */
void sde_plane_get_ctl_flush(struct drm_plane *plane, struct sde_hw_ctl *ctl,
		u32 *flush);
		u32 *flush_sspp, u32 *flush_rot);

/**
 * sde_plane_is_sbuf_mode - return status of stream buffer mode