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

Commit 5811cfa5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm: dispatch sync commit to display thread"

parents 4e1764fb efd65138
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ struct msm_commit {
	struct drm_device *dev;
	struct drm_atomic_state *state;
	uint32_t crtc_mask;
	bool nonblock;
	struct kthread_work commit_work;
};

@@ -62,6 +63,7 @@ static void end_atomic(struct msm_drm_private *priv, uint32_t crtc_mask)
static void commit_destroy(struct msm_commit *c)
{
	end_atomic(c->dev->dev_private, c->crtc_mask);
	if (c->nonblock)
		kfree(c);
}

@@ -449,7 +451,8 @@ static void _msm_drm_commit_work_cb(struct kthread_work *work)
	SDE_ATRACE_END("complete_commit");
}

static struct msm_commit *commit_init(struct drm_atomic_state *state)
static struct msm_commit *commit_init(struct drm_atomic_state *state,
		bool nonblock)
{
	struct msm_commit *c = kzalloc(sizeof(*c), GFP_KERNEL);

@@ -458,6 +461,7 @@ static struct msm_commit *commit_init(struct drm_atomic_state *state)

	c->dev = state->dev;
	c->state = state;
	c->nonblock = nonblock;

	kthread_init_work(&c->commit_work, _msm_drm_commit_work_cb);

@@ -502,6 +506,11 @@ static int msm_atomic_commit_dispatch(struct drm_device *dev,
			break;
	}

	if (!ret && !commit->nonblock) {
		kthread_flush_work(&commit->commit_work);
		kfree(commit);
	}

	return ret;
}

@@ -535,7 +544,7 @@ int msm_atomic_commit(struct drm_device *dev,
		return ret;
	}

	c = commit_init(state);
	c = commit_init(state, nonblock);
	if (!c) {
		ret = -ENOMEM;
		goto error;
@@ -603,7 +612,6 @@ int msm_atomic_commit(struct drm_device *dev,
	 * current layout.
	 */

	if (nonblock) {
	ret = msm_atomic_commit_dispatch(dev, state, c);
	if (ret) {
		DRM_ERROR("%s: atomic commit failed\n", __func__);
@@ -613,12 +621,6 @@ int msm_atomic_commit(struct drm_device *dev,
	}
	SDE_ATRACE_END("atomic_commit");
	return 0;
	}

	complete_commit(c);

	SDE_ATRACE_END("atomic_commit");
	return 0;

error:
	drm_atomic_helper_cleanup_planes(dev, state);