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

Commit ea632eb3 authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran
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 b278d157
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -3633,17 +3633,20 @@ static void _sde_encoder_kickoff_phys(struct sde_encoder_virt *sde_enc)
	u32 pending_kickoff_cnt;
	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;

	/* don't perform flush/start operations for slave encoders */
	for (i = 0; i < sde_enc->num_phys_encs; i++) {
		struct sde_encoder_phys *phys = sde_enc->phys_encs[i];
		enum sde_rm_topology_name topology = SDE_RM_TOPOLOGY_NONE;
		bool wait_for_dma = false;

		if (!phys || phys->enable_state == SDE_ENC_DISABLED)
			continue;
@@ -3652,13 +3655,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);

		if (phys->connector)
			topology = sde_connector_get_topology_name(