disp: msm: sde: add line insertion support for sspp

Add line insertion support for sspp, this is used to support
display with external splitter. Line insertion logic checks
the difference between screen logical height and physical
height. If any difference is observed adds dummy and active
lines on screen.

Change-Id: Ieec322273df000a53fb39e05174c2d67c3c2da81
Signed-off-by: Rajesh kv <quic_kvrajesh@quicinc.com>
This commit is contained in:
Rajesh kv
2022-04-01 08:59:25 +05:30
förälder fdcfe00b0b
incheckning 03aad2fdf9
16 ändrade filer med 420 tillägg och 1 borttagningar

Visa fil

@@ -188,6 +188,45 @@ static struct sde_hw_ctl *_sde_plane_get_hw_ctl(const struct drm_plane *plane)
return ctl;
}
static void _sde_plane_setup_panel_stacking(struct sde_plane *psde,
struct sde_plane_state *pstate)
{
struct sde_hw_pipe_line_insertion_cfg *cfg;
struct sde_crtc_state *cstate;
u32 h_start = 0, h_total = 0, y_start = 0;
struct drm_plane_state *dpstate = NULL;
struct drm_crtc *drm_crtc = NULL;
if (!psde || !psde->base.state || !psde->base.state->crtc) {
SDE_ERROR("Invalid plane psde %p or drm plane state or drm crtc\n", psde);
return;
}
dpstate = psde->base.state;
drm_crtc = dpstate->crtc;
cstate = to_sde_crtc_state(drm_crtc->state);
pstate->lineinsertion_feature = cstate->line_insertion.panel_line_insertion_enable;
if ((!test_bit(SDE_SSPP_LINE_INSERTION, (unsigned long *)&psde->features)) ||
!cstate->line_insertion.panel_line_insertion_enable)
return;
cfg = &pstate->line_insertion_cfg;
memset(cfg, 0, sizeof(*cfg));
if (!cstate->line_insertion.padding_height)
return;
sde_crtc_calc_vpadding_param(psde->base.state->crtc->state,
pstate->base.crtc_y, pstate->base.crtc_h,
&y_start, &h_start, &h_total);
cfg->enable = true;
cfg->dummy_lines = cstate->line_insertion.padding_dummy;
cfg->active_lines = cstate->line_insertion.padding_active;
cfg->first_active_lines = h_start;
cfg->dst_h = h_total;
psde->pipe_cfg.dst_rect.y += y_start - pstate->base.crtc_y;
}
static bool sde_plane_enabled(const struct drm_plane_state *state)
{
return state && state->fb && state->crtc;
@@ -3094,6 +3133,8 @@ static void _sde_plane_update_roi_config(struct drm_plane *plane,
_sde_plane_setup_scaler(psde, pstate, fmt, false);
_sde_plane_setup_panel_stacking(psde, pstate);
/* check for color fill */
psde->color_fill = (uint32_t)sde_plane_get_property(pstate,
PLANE_PROP_COLOR_FILL);
@@ -3137,6 +3178,11 @@ static void _sde_plane_update_roi_config(struct drm_plane *plane,
true,
pstate->multirect_index,
pstate->multirect_mode);
/* update line insertion */
if (pstate->lineinsertion_feature && psde->pipe_hw->ops.setup_line_insertion)
psde->pipe_hw->ops.setup_line_insertion(psde->pipe_hw,
pstate->multirect_index,
&pstate->line_insertion_cfg);
}
static void _sde_plane_update_format_and_rects(struct sde_plane *psde,