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

Commit 6871047a authored by Jayaprakash's avatar Jayaprakash
Browse files

disp: msm: sde: Avoid releasing the committed RM reservations



RM allocated reservations for the ongoing commit are cleared when
there is a delay in ongoing commit scheduling and back to back
prepare comes. This clearing occurs in the subsequent checkonly
commit with modechange property set.

Timeline of the issue:
   --> C1 commit check_only + modeset, RM allocated resources
   --> C2 commit check_only scheduled before C1 commit with
       check_only + modeset, overridden C1 reservations with
       its own into rsvp_nxt
   --> C1 commit scheduled and RM committed reservations
       allocated by C2.

Change-Id: I46cc924fd6515590e32c8e97a82847d2bde97270
Signed-off-by: default avatarJayaprakash <jmadiset@codeaurora.org>
parent 86fa8f9f
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1995,6 +1995,7 @@ void sde_rm_release(struct sde_rm *rm, struct drm_encoder *enc, bool nxt)
	top_ctrl = sde_connector_get_property(conn->state,
			CONNECTOR_PROP_TOPOLOGY_CONTROL);

	SDE_EVT32(enc->base.id, conn->base.id, rsvp->seq, top_ctrl, nxt);
	if (top_ctrl & BIT(SDE_RM_TOPCTL_RESERVE_LOCK)) {
		SDE_DEBUG("rsvp[s%de%d] not releasing locked resources\n",
				rsvp->seq, rsvp->enc_id);
@@ -2084,6 +2085,23 @@ int sde_rm_reserve(
	rsvp_cur = _sde_rm_get_rsvp(rm, enc);
	rsvp_nxt = _sde_rm_get_rsvp_nxt(rm, enc);

	/*
	 * RM currently relies on rsvp_nxt assigned to the hw blocks to
	 * commit rsvps. This rsvp_nxt can be cleared by a back to back
	 * check_only commit with modeset when its predecessor atomic
	 * commit is delayed / not committed the reservation yet.
	 * Bail out in such cases so that check only commit
	 * comes again after earlier commit gets processed.
	 */

	if (test_only && rsvp_nxt) {
		SDE_ERROR("cur %d nxt %d enc %d conn %d\n", rsvp_cur->seq,
			 rsvp_nxt->seq, enc->base.id,
			 conn_state->connector->base.id);
		ret = -EINVAL;
		goto end;
	}

	if (!test_only && rsvp_nxt)
		goto commit_rsvp;