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

Commit 2b64edf2 authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: make LUTDMA kickoff as blocking for video mode



Currently LUTDMA kickoff is immediately followed by CTL flush,
immaterial of the LUTDMA DONE status. If LUTDMA kickoff happens
too close to the VSYNC, it might cause a race condition between
LUTDMA & CTL flush, due to a HW issue. Serialize LUTDMA & CTL flush
by making the LUTDMA kickoff as blocking to avoid the race condition.
This issue is applicable only for video-mode as it has to update
on every VSYNC.

Change-Id: I4ebe442045c918c7b4d46fa3f550b4b2c109715d
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent 14ecd08f
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -3329,12 +3329,17 @@ static void _sde_encoder_kickoff_phys(struct sde_encoder_virt *sde_enc)
	unsigned long lock_flags;
	struct msm_drm_private *priv = NULL;
	struct sde_kms *sde_kms = NULL;
	bool is_vid_mode = false;

	if (!sde_enc) {
		SDE_ERROR("invalid encoder\n");
		return;
	}

	is_vid_mode = sde_enc->disp_info.capabilities &
					MSM_DISPLAY_CAP_VID_MODE;


	pending_flush = 0x0;

	/*
@@ -3343,7 +3348,6 @@ static void _sde_encoder_kickoff_phys(struct sde_encoder_virt *sde_enc)
	 */
	for (i = 0; i < sde_enc->num_phys_encs; i++) {
		struct sde_encoder_phys *phys = sde_enc->phys_encs[i];
		bool wait_for_dma = false;

		if (!phys || phys->enable_state == SDE_ENC_DISABLED)
			continue;
@@ -3352,12 +3356,10 @@ static void _sde_encoder_kickoff_phys(struct sde_encoder_virt *sde_enc)
		if (!ctl)
			continue;

		if (phys->ops.wait_dma_trigger)
			wait_for_dma = phys->ops.wait_dma_trigger(phys);

		/* make reg dma kickoff as blocking for vidoe-mode */
		if (phys->hw_ctl->ops.reg_dma_flush)
			phys->hw_ctl->ops.reg_dma_flush(phys->hw_ctl,
					wait_for_dma);
					is_vid_mode);
	}

	/* update pending counts and trigger kickoff ctl flush atomically */