disp: msm: add connector state along with crtc state to detect modeset

During modeset, private mode changed is detected from
msm_display_mode which is present in sde_connector_state.
In the current code, sde_connector_state is found from the
drm_connector variable which will not be valid
during atomic check phase and new connector state is
required here. To handle this, drm_connector_state is passed
along with the drm_crtc_state while detecting
msm_atomic_needs_modeset condition.

Change-Id: I62c162eff6e1c091cb05b3f049a40a0f25b710ba
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
This commit is contained in:
Yashwanth
2021-04-29 17:14:15 +05:30
committed by Raviteja Tamatam
vanhempi 807f03d2c9
commit ffc7cdbe08
5 muutettua tiedostoa jossa 60 lisäystä ja 20 poistoa

Näytä tiedosto

@@ -70,7 +70,7 @@ struct msm_kms_funcs {
void (*complete_commit)(struct msm_kms *kms,
struct drm_atomic_state *state);
struct msm_display_mode *(*get_msm_mode)(
struct drm_crtc_state *c_state);
struct drm_connector_state *c_state);
/* functions to wait for atomic commit completed on each CRTC */
void (*wait_for_crtc_commit_done)(struct msm_kms *kms,
struct drm_crtc *crtc);
@@ -268,16 +268,16 @@ static inline bool msm_needs_vblank_pre_modeset(
}
static inline bool msm_is_private_mode_changed(
struct drm_crtc_state *state)
struct drm_connector_state *conn_state)
{
struct msm_display_mode *msm_mode = NULL;
struct msm_drm_private *priv = NULL;
struct msm_kms *kms;
if (!state || !state->crtc)
if (!conn_state || !conn_state->connector || !conn_state->connector->dev)
return false;
priv = state->crtc->dev->dev_private;
priv = conn_state->connector->dev->dev_private;
if (!priv)
return false;
@@ -285,7 +285,7 @@ static inline bool msm_is_private_mode_changed(
if (!kms || !kms->funcs->get_msm_mode)
return false;
msm_mode = kms->funcs->get_msm_mode(state);
msm_mode = kms->funcs->get_msm_mode(conn_state);
if (!msm_mode)
return false;
@@ -298,12 +298,13 @@ static inline bool msm_is_private_mode_changed(
return false;
}
static inline bool msm_atomic_needs_modeset(struct drm_crtc_state *state)
static inline bool msm_atomic_needs_modeset(struct drm_crtc_state *state,
struct drm_connector_state *conn_state)
{
if (drm_atomic_crtc_needs_modeset(state))
return true;
if (msm_is_private_mode_changed(state))
if (msm_is_private_mode_changed(conn_state))
return true;
return false;
}