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

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

Merge "msm: kgsl: Allow sync points to be created on the submitter's context"

parents 9aa79549 5f0c3f08
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -1634,13 +1634,24 @@ static int kgsl_cmdbatch_add_sync_timestamp(struct kgsl_device *device,
	if (context == NULL)
		return -EINVAL;

	/* Sanity check - you can't create a sync point on your own context */
	/*
	 * We allow somebody to create a sync point on their own context.
	 * This has the effect of delaying a command from submitting until the
	 * dependent command has cleared.  That said we obviously can't let them
	 * create a sync point on a future timestamp.
	 */

	if (context == cmdbatch->context) {
		unsigned int queued = kgsl_readtimestamp(device, context,
			KGSL_TIMESTAMP_QUEUED);

		if (timestamp_cmp(sync->timestamp, queued) > 0) {
			KGSL_DRV_ERR(device,
			"Cannot create a sync point on your own context %d\n",
			context->id);
			"Cannot create syncpoint for future timestamp %d (current %d)\n",
				sync->timestamp, queued);
			goto done;
		}
	}

	event = kzalloc(sizeof(*event), GFP_KERNEL);
	if (event == NULL) {