Explorar o código

disp: msm: sde: fix crtc_state iteration during vm release

Iterate over the crtc old/new state and decide which ones
to process by checking the active state of both during
the vm release in error cases.

Change-Id: Iab20e89792c53fb72e0c00f1fa5091616c7afbf3
Signed-off-by: Veera Sundaram Sankaran <[email protected]>
Veera Sundaram Sankaran %!s(int64=4) %!d(string=hai) anos
pai
achega
303c324c43
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      msm/sde/sde_kms.c

+ 8 - 5
msm/sde/sde_kms.c

@@ -2689,18 +2689,21 @@ static void sde_kms_vm_res_release(struct msm_kms *kms,
 		struct drm_atomic_state *state)
 {
 	struct drm_crtc *crtc;
-	struct drm_crtc_state *crtc_state;
+	struct drm_crtc_state *new_cstate, *old_cstate;
 	struct sde_vm_ops *vm_ops;
 	enum sde_crtc_vm_req vm_req;
 	struct sde_kms *sde_kms = to_sde_kms(kms);
 	int i;
 
-	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
-		struct sde_crtc_state *cstate;
+	for_each_oldnew_crtc_in_state(state, crtc, old_cstate, new_cstate, i) {
+		struct sde_crtc_state *new_state;
 
-		cstate = to_sde_crtc_state(state->crtcs[0].new_state);
+		if (!new_cstate->active && !old_cstate->active)
+			continue;
 
-		vm_req = sde_crtc_get_property(cstate, CRTC_PROP_VM_REQ_STATE);
+		new_state = to_sde_crtc_state(new_cstate);
+		vm_req = sde_crtc_get_property(new_state,
+					CRTC_PROP_VM_REQ_STATE);
 		if (vm_req != VM_REQ_ACQUIRE)
 			return;
 	}