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

This commit is contained in:
qctecmdr 2021-03-18 02:20:38 -07:00 • committed by Gerrit - the friendly Code Review server
commit 345b9593c8

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2014-2020 The Linux Foundation. All rights reserved.
* Copyright (C) 2014-2021 The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
*
@ -123,6 +123,7 @@ struct sde_plane {
struct sde_csc_cfg *csc_usr_ptr;
struct sde_csc_cfg *csc_ptr;
uint32_t cached_lut_flag;
struct sde_hw_scaler3_cfg scaler3_cfg;
struct sde_hw_pixel_ext pixel_ext;
@ -3178,6 +3179,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)
{
@ -3229,10 +3245,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;
}