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

Commit 12def592 authored by Alan Kwong's avatar Alan Kwong
Browse files

drm/msm/sde: prepare only affected encoder for commit



Currently all connected encoders are prepared on each
commit even though it is for crtc not specified in the
commit state. This causes these extra encoders to be
prepared incorrectly. Correct prepare commit to loop
thru only those crtcs specified in the commit state,
and only prepare those encoders connected.

Change-Id: Id14380b33882787a6b5f8affcd8ffcbc3e86bbec
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 1cc4edf0
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -498,6 +498,9 @@ static void sde_kms_prepare_commit(struct msm_kms *kms,
	struct msm_drm_private *priv;
	struct drm_device *dev;
	struct drm_encoder *encoder;
	struct drm_crtc *crtc;
	struct drm_crtc_state *crtc_state;
	int i;

	if (!kms)
		return;
@@ -510,9 +513,15 @@ static void sde_kms_prepare_commit(struct msm_kms *kms,

	sde_power_resource_enable(&priv->phandle, sde_kms->core_client, true);

	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
		if (encoder->crtc != NULL)
	for_each_crtc_in_state(state, crtc, crtc_state, i) {
		list_for_each_entry(encoder, &dev->mode_config.encoder_list,
				head) {
			if (encoder->crtc != crtc)
				continue;

			sde_encoder_prepare_commit(encoder);
		}
	}

	/*
	 * NOTE: for secure use cases we want to apply the new HW