Browse Source

disp: msm: dp: update the definition of atomic_check function

Update the definition of the atomic_check function for
DisplayPort connectors to align with the DRM upstream changes.

Change-Id: Id942c8ef16ae773540c4bc7221e0b784354a527c
Signed-off-by: Tatenda Chipeperekwa <[email protected]>
Tatenda Chipeperekwa 5 years ago
parent
commit
cf71a83fba
2 changed files with 12 additions and 8 deletions
  1. 6 4
      msm/dp/dp_drm.c
  2. 6 4
      msm/dp/dp_mst_drm.c

+ 6 - 4
msm/dp/dp_drm.c

@@ -498,18 +498,20 @@ void dp_connector_post_open(struct drm_connector *connector, void *display)
 
 int dp_connector_atomic_check(struct drm_connector *connector,
 	void *display,
-	struct drm_connector_state *c_state)
+	struct drm_atomic_state *a_state)
 {
 	struct sde_connector *sde_conn;
 	struct drm_connector_state *old_state;
+	struct drm_connector_state *c_state;
 
-	if (!connector || !display)
+	if (!connector || !display || a_state)
 		return -EINVAL;
 
+	c_state = drm_atomic_get_new_connector_state(a_state, connector);
 	old_state =
-		drm_atomic_get_old_connector_state(c_state->state, connector);
+		drm_atomic_get_old_connector_state(a_state, connector);
 
-	if (!old_state)
+	if (!old_state || !c_state)
 		return -EINVAL;
 
 	sde_conn = to_sde_connector(connector);

+ 6 - 4
msm/dp/dp_mst_drm.c

@@ -1390,11 +1390,11 @@ static struct dp_mst_bridge *_dp_mst_get_bridge_from_encoder(
 }
 
 static int dp_mst_connector_atomic_check(struct drm_connector *connector,
-		void *display, struct drm_connector_state *new_conn_state)
+		void *display, struct drm_atomic_state *state)
 {
 	int rc = 0, slots, i;
-	struct drm_atomic_state *state;
 	struct drm_connector_state *old_conn_state;
+	struct drm_connector_state *new_conn_state;
 	struct drm_crtc *old_crtc;
 	struct drm_crtc_state *crtc_state;
 	struct dp_mst_bridge *bridge = NULL;
@@ -1412,13 +1412,15 @@ static int dp_mst_connector_atomic_check(struct drm_connector *connector,
 	if (mst->state == PM_SUSPEND)
 		return rc;
 
+	if (!state)
+		return rc;
+
+	new_conn_state = drm_atomic_get_new_connector_state(state, connector);
 	if (!new_conn_state)
 		return rc;
 
 	mutex_lock(&mst->mst_lock);
 
-	state = new_conn_state->state;
-
 	old_conn_state = drm_atomic_get_old_connector_state(state, connector);
 	if (!old_conn_state)
 		goto mode_set;