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

Commit 5bd6756a authored by Ingrid Gallardo's avatar Ingrid Gallardo Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: fix refcount issue with ctl start cnt



For some scenarios HW does not trigger the CTL START
interrupt; in those cases current driver takes care of
signaling the ctl retire fence during the PP DONE irq,
however driver is missing to update the ctl start count.
This fix makes sure driver also updates the ctl start
refcount if the interrupt is not triggered by HW.

Change-Id: I7c8846b95411632e5c2039aca836138c081f785c
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent af05a7db
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -179,10 +179,21 @@ static void sde_encoder_phys_cmd_pp_tx_done_irq(void *arg, int irq_idx)
	SDE_ATRACE_BEGIN("pp_done_irq");

	/* handle rare cases where the ctl_start_irq is not received */
	if (sde_encoder_phys_cmd_is_master(phys_enc)
	    && atomic_add_unless(&phys_enc->pending_retire_fence_cnt, -1, 0))
		phys_enc->parent_ops.handle_frame_done(phys_enc->parent,
			phys_enc, SDE_ENCODER_FRAME_EVENT_SIGNAL_RETIRE_FENCE);
	if (sde_encoder_phys_cmd_is_master(phys_enc)) {
		/*
		 * Reduce the refcount for the retire fence as well
		 * as for the ctl_start if the counters are greater
		 * than zero. If there was a retire fence count pending,
		 * then signal the RETIRE FENCE here.
		 */
		if (atomic_add_unless(&phys_enc->pending_retire_fence_cnt,
				-1, 0))
			phys_enc->parent_ops.handle_frame_done(
				phys_enc->parent,
				phys_enc,
				SDE_ENCODER_FRAME_EVENT_SIGNAL_RETIRE_FENCE);
		atomic_add_unless(&phys_enc->pending_ctlstart_cnt, -1, 0);
	}

	/* notify all synchronous clients first, then asynchronous clients */
	if (phys_enc->parent_ops.handle_frame_done)