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

Commit f77b7c53 authored by Lei Chen's avatar Lei Chen Committed by Jayaprakash Madisetty
Browse files

disp: msm: sde: remove clearing cur_master in encoder enable function



SDE IRQ callback can run in parallel thread to modeset after removing
pp_done wait before pre_modeset.
If cur_master is cleared in encoder enable function and irq callback
is triggered at the same time, the irq callback could not be handled
properly as cur_master is NULL.So remove clearing cur_master in
encoder enable function to avoid the race condition between modeset
and irq callback.

Change-Id: I2059c699a68838b3c9f6a7dd658a35f178b18c42
Signed-off-by: default avatarLei Chen <quic_chenlei@quicinc.com>
Signed-off-by: default avatarJayaprakash Madisetty <quic_jmadiset@quicinc.com>
parent 8d57f083
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2733,6 +2733,7 @@ static void sde_encoder_off_work(struct kthread_work *work)
static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)
{
	struct sde_encoder_virt *sde_enc = NULL;
	bool has_master_enc = false;
	int i, ret = 0;
	struct msm_compression_info *comp_info = NULL;
	struct drm_display_mode *cur_mode = NULL;
@@ -2759,18 +2760,19 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)
	SDE_DEBUG_ENC(sde_enc, "\n");
	SDE_EVT32(DRMID(drm_enc), cur_mode->hdisplay, cur_mode->vdisplay);

	sde_enc->cur_master = NULL;
	for (i = 0; i < sde_enc->num_phys_encs; i++) {
		struct sde_encoder_phys *phys = sde_enc->phys_encs[i];

		if (phys && phys->ops.is_master && phys->ops.is_master(phys)) {
			SDE_DEBUG_ENC(sde_enc, "master is now idx %d\n", i);
			sde_enc->cur_master = phys;
			has_master_enc = true;
			break;
		}
	}

	if (!sde_enc->cur_master) {
	if (!has_master_enc) {
		sde_enc->cur_master = NULL;
		SDE_ERROR("virt encoder has no master! num_phys %d\n", i);
		return;
	}