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

Commit 71d0f6ec authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: avoid deadlock by prepending connection_mutex"

parents fbd4d389 8747c3b2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -697,6 +697,16 @@ int msm_atomic_commit(struct drm_device *dev,
		c->plane_mask |= (1 << drm_plane_index(plane));
	}

	/* Protection for prepare_fence callback */
retry:
	ret = drm_modeset_lock(&state->dev->mode_config.connection_mutex,
		state->acquire_ctx);

	if (ret == -EDEADLK) {
		drm_modeset_backoff(state->acquire_ctx);
		goto retry;
	}

	/*
	 * Wait for pending updates on any of the same crtc's and then
	 * mark our set of crtc's as busy:
+1 −10
Original line number Diff line number Diff line
@@ -1267,7 +1267,7 @@ static void sde_kms_prepare_fence(struct msm_kms *kms,
{
	struct drm_crtc *crtc;
	struct drm_crtc_state *old_crtc_state;
	int i, rc;
	int i;

	if (!kms || !old_state || !old_state->dev || !old_state->acquire_ctx) {
		SDE_ERROR("invalid argument(s)\n");
@@ -1275,15 +1275,6 @@ static void sde_kms_prepare_fence(struct msm_kms *kms,
	}

	SDE_ATRACE_BEGIN("sde_kms_prepare_fence");
retry:
	/* attempt to acquire ww mutex for connection */
	rc = drm_modeset_lock(&old_state->dev->mode_config.connection_mutex,
			       old_state->acquire_ctx);

	if (rc == -EDEADLK) {
		drm_modeset_backoff(old_state->acquire_ctx);
		goto retry;
	}

	/* old_state actually contains updated crtc pointers */
	for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) {