disp: msm: sde: use new connector state for topology checks

Use with the new connector state during validation phase for
checking the 3d-merge topology, since this is the state that
needs to be validated.

Change-Id: Ie212f948affa4dc439ef508363bac6713e560006
Signed-off-by: Veera Sundaram Sankaran <quic_veeras@quicinc.com>
This commit is contained in:
Veera Sundaram Sankaran
2022-08-22 14:29:16 -07:00
parent 51775dd093
commit d44f0ff715
2 changed files with 14 additions and 12 deletions

View File

@@ -1217,14 +1217,15 @@ static inline int sde_connector_state_get_compression_info(
return 0;
}
static inline bool sde_connector_is_quadpipe_3d_merge_enabled(struct drm_connector *conn)
static inline bool sde_connector_is_quadpipe_3d_merge_enabled(
struct drm_connector_state *conn_state)
{
enum sde_rm_topology_name topology;
if (!conn)
if (!conn_state)
return false;
topology = sde_connector_get_topology_name(conn);
topology = sde_connector_get_property(conn_state, CONNECTOR_PROP_TOPOLOGY_NAME);
if ((topology == SDE_RM_TOPOLOGY_QUADPIPE_3DMERGE)
|| (topology == SDE_RM_TOPOLOGY_QUADPIPE_3DMERGE_DSC))
return true;
@@ -1232,14 +1233,15 @@ static inline bool sde_connector_is_quadpipe_3d_merge_enabled(struct drm_connect
return false;
}
static inline bool sde_connector_is_dualpipe_3d_merge_enabled(struct drm_connector *conn)
static inline bool sde_connector_is_dualpipe_3d_merge_enabled(
struct drm_connector_state *conn_state)
{
enum sde_rm_topology_name topology;
if (!conn)
if (!conn_state)
return false;
topology = sde_connector_get_topology_name(conn);
topology = sde_connector_get_property(conn_state, CONNECTOR_PROP_TOPOLOGY_NAME);
if ((topology == SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE)
|| (topology == SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC)
|| (topology == SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_VDC))
@@ -1248,10 +1250,10 @@ static inline bool sde_connector_is_dualpipe_3d_merge_enabled(struct drm_connect
return false;
}
static inline bool sde_connector_is_3d_merge_enabled(struct drm_connector *conn)
static inline bool sde_connector_is_3d_merge_enabled(struct drm_connector_state *conn_state)
{
return sde_connector_is_dualpipe_3d_merge_enabled(conn)
|| sde_connector_is_quadpipe_3d_merge_enabled(conn);
return sde_connector_is_dualpipe_3d_merge_enabled(conn_state)
|| sde_connector_is_quadpipe_3d_merge_enabled(conn_state);
}
/**

View File

@@ -1391,9 +1391,9 @@ static int _sde_crtc_check_rois(struct drm_crtc *crtc,
} else if (state->state) {
for_each_new_connector_in_state(state->state, conn, conn_state, i) {
if (conn_state && (conn_state->crtc == crtc)
&& ((sde_connector_is_dualpipe_3d_merge_enabled(conn)
&& ((sde_connector_is_dualpipe_3d_merge_enabled(conn_state)
&& (crtc_width % 4))
|| (sde_connector_is_quadpipe_3d_merge_enabled(conn)
|| (sde_connector_is_quadpipe_3d_merge_enabled(conn_state)
&& (crtc_width % 8)))) {
SDE_ERROR(
"%s: invalid 3d-merge_w - mixer_w:%d, crtc_w:%d, num_mixers:%d\n",
@@ -1421,7 +1421,7 @@ static int _sde_crtc_check_rois(struct drm_crtc *crtc,
goto end;
}
if (sde_connector_is_3d_merge_enabled(conn) && (mixer_width % 2)) {
if (sde_connector_is_3d_merge_enabled(conn->state) && (mixer_width % 2)) {
SDE_ERROR(
"%s: invalid width w/ 3d-merge - mixer_w:%d, crtc_w:%d, num_mixers:%d\n",
sde_crtc->name, crtc_width, mixer_width, sde_crtc->num_mixers);