disp: msm: sde: remove fb's attached to a drm_file in preclose

This change avoids upstream drm issuing drm_atomic_commit in
drm_fb_release which is leading to artifacts on screen or
atomic_check failures due to atomically unstaging each fb
from plane_state and committing remaining planes on hardware.

 a) This patch moves the state operations for setting crtc to
    connector state to a helper api.
 b) This patch clears any dim_layers present in the crtc_state
    as part of null commit.
 c) This patch removes any framebuffers attached to a drm_file
    in msm_preclose whose refcount is not managed by composer kill
    inadvertently and issues null flush to hardware in such cases.
 d) This patch handles msm_preclose as part of msm_release
    operation since legacy feature is not supported
    for msm_driver.

Change-Id: Ib2068d74d4b23b73b7c84544858c9f6bb6adfa67
Signed-off-by: Jayaprakash Madisetty <jmadiset@codeaurora.org>
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Tento commit je obsažen v:
Jayaprakash Madisetty
2020-12-21 16:48:50 +05:30
odevzdal Samantha Tran
rodič 2df01bf3aa
revize 0e3d422520
4 změnil soubory, kde provedl 111 přidání a 45 odebrání

Zobrazit soubor

@@ -2831,17 +2831,16 @@ static void _sde_crtc_set_input_fence_timeout(struct sde_crtc_state *cstate)
cstate->input_fence_timeout_ns *= NSEC_PER_MSEC;
}
/**
* _sde_crtc_clear_dim_layers_v1 - clear all dim layer settings
* @cstate: Pointer to sde crtc state
*/
static void _sde_crtc_clear_dim_layers_v1(struct sde_crtc_state *cstate)
void _sde_crtc_clear_dim_layers_v1(struct drm_crtc_state *state)
{
u32 i;
struct sde_crtc_state *cstate;
if (!cstate)
if (!state)
return;
cstate = to_sde_crtc_state(state);
for (i = 0; i < cstate->num_dim_layers; i++)
memset(&cstate->dim_layer[i], 0, sizeof(cstate->dim_layer[i]));
@@ -2870,7 +2869,7 @@ static void _sde_crtc_set_dim_layer_v1(struct drm_crtc *crtc,
if (!usr_ptr) {
/* usr_ptr is null when setting the default property value */
_sde_crtc_clear_dim_layers_v1(cstate);
_sde_crtc_clear_dim_layers_v1(&cstate->base);
SDE_DEBUG("dim_layer data removed\n");
goto clear;
}