Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d5bf543 authored by Ping Li's avatar Ping Li Committed by Gerrit - the friendly Code Review server
Browse files

drm: msm: Update and correct AD setting for suspend/resume



Mark AD active property to dirty in suspend case so that
those AD properties can be re-programed after device resumes.
This change also corrects the code for AD interrupt and
customer event handling.

Change-Id: Iecf1a6ea8def5bd169e8ad040f8320176eed6904
Signed-off-by: default avatarPing Li <pingli@codeaurora.org>
parent aebe5ecd
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -1033,6 +1033,12 @@ void sde_cp_crtc_suspend(struct drm_crtc *crtc)
		sde_cp_update_list(prop_node, sde_crtc, true);
		sde_cp_update_list(prop_node, sde_crtc, true);
		list_del_init(&prop_node->active_list);
		list_del_init(&prop_node->active_list);
	}
	}

	list_for_each_entry_safe(prop_node, n, &sde_crtc->ad_active,
				 active_list) {
		sde_cp_update_list(prop_node, sde_crtc, true);
		list_del_init(&prop_node->active_list);
	}
}
}


void sde_cp_crtc_resume(struct drm_crtc *crtc)
void sde_cp_crtc_resume(struct drm_crtc *crtc)
@@ -1368,7 +1374,6 @@ int sde_cp_ad_interrupt(struct drm_crtc *crtc_drm, bool en,
		return -EINVAL;
		return -EINVAL;
	}
	}


	mutex_lock(&crtc->crtc_lock);
	kms = get_kms(crtc_drm);
	kms = get_kms(crtc_drm);
	num_mixers = crtc->num_mixers;
	num_mixers = crtc->num_mixers;


@@ -1422,6 +1427,5 @@ int sde_cp_ad_interrupt(struct drm_crtc *crtc_drm, bool en,
		sde_core_irq_unregister_callback(kms, irq_idx, ad_irq);
		sde_core_irq_unregister_callback(kms, irq_idx, ad_irq);
	}
	}
exit:
exit:
	mutex_unlock(&crtc->crtc_lock);
	return ret;
	return ret;
}
}
+11 −11
Original line number Original line Diff line number Diff line
@@ -2514,6 +2514,17 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
		atomic_set(&sde_crtc->frame_pending, 0);
		atomic_set(&sde_crtc->frame_pending, 0);
	}
	}


	spin_lock_irqsave(&sde_crtc->spin_lock, flags);
	list_for_each_entry(node, &sde_crtc->user_event_list, list) {
		ret = 0;
		if (node->func)
			ret = node->func(crtc, false, &node->irq);
		if (ret)
			SDE_ERROR("%s failed to disable event %x\n",
					sde_crtc->name, node->event);
	}
	spin_unlock_irqrestore(&sde_crtc->spin_lock, flags);

	sde_core_perf_crtc_update(crtc, 0, true);
	sde_core_perf_crtc_update(crtc, 0, true);


	drm_for_each_encoder(encoder, crtc->dev) {
	drm_for_each_encoder(encoder, crtc->dev) {
@@ -2535,17 +2546,6 @@ static void sde_crtc_disable(struct drm_crtc *crtc)
	cstate->bw_control = false;
	cstate->bw_control = false;
	cstate->bw_split_vote = false;
	cstate->bw_split_vote = false;


	spin_lock_irqsave(&sde_crtc->spin_lock, flags);
	list_for_each_entry(node, &sde_crtc->user_event_list, list) {
		ret = 0;
		if (node->func)
			ret = node->func(crtc, false, &node->irq);
		if (ret)
			SDE_ERROR("%s failed to disable event %x\n",
					sde_crtc->name, node->event);
	}
	spin_unlock_irqrestore(&sde_crtc->spin_lock, flags);

	mutex_unlock(&sde_crtc->crtc_lock);
	mutex_unlock(&sde_crtc->crtc_lock);
}
}