Selaa lähdekoodia

disp: msm: dp: Update vcpi start slot for MST single port plug/unplug

Update vcpi start slot for other connectors when an individual connector is unplugged.
Currently the driver is caching the previous start slot and doing the adjustment
in a single pass. When the connectors are removed and added in a specific order,
it is possible that the list of payloads are not sorted by start_slot and the
removed payload is not the first payload in the list.
The current logic does not support this case and will leave the start_slot of
the first payload unadjusted thereby resulting in an invalid slot allocation.

This change does the caching and adjustment in two separate passes to make sure
the start slot adjustment happens irrespective of the order of the payloads.

Change-Id: I5ca7ded263740590b0fe3cc31c8d67441a42c92f
Signed-off-by: Nisarg Bhavsar <[email protected]>
Nisarg Bhavsar 2 vuotta sitten
vanhempi
sitoutus
902ac9549a
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6 2
      msm/dp/dp_mst_drm.c

+ 6 - 2
msm/dp/dp_mst_drm.c

@@ -517,14 +517,18 @@ static void _dp_mst_update_timeslots(struct dp_mst_private *mst,
 				dp_bridge->num_slots = payload->time_slots;
 				dp_bridge->vcpi = payload->vcpi;
 			}
-		} else if ((payload->vc_start_slot < 0) && (dp_bridge->start_slot > prev_start)) {
-			dp_bridge->start_slot -= prev_slots;
 		}
 	}
 
 	// Now commit all the updated payloads
 	for (i = 0; i < MAX_DP_MST_DRM_BRIDGES; i++) {
 		dp_bridge = &mst->mst_bridge[i];
+
+		//Shift payloads to the left if there was a removed payload.
+		if ((payload->vc_start_slot < 0) && (dp_bridge->start_slot > prev_start)) {
+			dp_bridge->start_slot -= prev_slots;
+		}
+
 		mst->dp_display->set_stream_info(mst->dp_display, dp_bridge->dp_panel,
 				dp_bridge->id, dp_bridge->start_slot, dp_bridge->num_slots,
 				dp_bridge->pbn, dp_bridge->vcpi);