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

Commit 2f39b1a7 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: sde: add cached lut flag in sde plane"

parents 5134cb67 681404ac
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ struct sde_plane {
	struct sde_csc_cfg *csc_usr_ptr;
	struct sde_csc_cfg *csc_ptr;

	uint32_t cached_lut_flag;
	const struct sde_sspp_sub_blks *pipe_sblk;

	char pipe_name[SDE_NAME_SIZE];
@@ -3201,6 +3202,21 @@ static void _sde_plane_update_properties(struct drm_plane *plane,
	pstate->dirty = 0x0;
}

static void _sde_plane_check_lut_dirty(struct sde_plane *psde,
			struct sde_plane_state *pstate)
{
	/**
	 * Valid configuration if scaler is not enabled or
	 * lut flag is set
	 */
	if (pstate->scaler3_cfg.lut_flag || !pstate->scaler3_cfg.enable)
		return;

	pstate->scaler3_cfg.lut_flag = psde->cached_lut_flag;
	SDE_EVT32(DRMID(&psde->base), pstate->scaler3_cfg.lut_flag,
		SDE_EVTLOG_ERROR);
}

static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
				struct drm_plane_state *old_state)
{
@@ -3251,10 +3267,16 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
			state->crtc_w, state->crtc_h,
			state->crtc_x, state->crtc_y);

	/* Caching the valid lut flag in sde plane */
	if (pstate->scaler3_cfg.enable &&
			pstate->scaler3_cfg.lut_flag)
		psde->cached_lut_flag = pstate->scaler3_cfg.lut_flag;

	/* force reprogramming of all the parameters, if the flag is set */
	if (psde->revalidate) {
		SDE_DEBUG("plane:%d - reconfigure all the parameters\n",
				plane->base.id);
		_sde_plane_check_lut_dirty(psde, pstate);
		pstate->dirty = SDE_PLANE_DIRTY_ALL | SDE_PLANE_DIRTY_CP;
		psde->revalidate = false;
	}