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

Commit e1e13d59 authored by Shubhraprakash Das's avatar Shubhraprakash Das Committed by Matt Wagantall
Browse files

msm: kgsl: Simplify taking context spinlock code



Simplify the spinlock code so we only have to check for
the spinlock flag once.

Change-Id: Ia973761a29c09f0ff5891ffcc3264baf26f25f62
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent 28aae37a
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -78,16 +78,17 @@ void adreno_drawctxt_dump(struct kgsl_device *device,
	struct adreno_context *drawctxt = ADRENO_CONTEXT(context);
	int index, pos;
	char buf[120];
	int fence_log;
	int locked = 0;

	kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_QUEUED, &queue);
	kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_CONSUMED, &start);
	kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_RETIRED, &retire);

	fence_log = test_bit(ADRENO_CONTEXT_CMDBATCH_FLAG_FENCE_LOG,
				&drawctxt->flags);
	if (!fence_log)
	if (!test_bit(ADRENO_CONTEXT_CMDBATCH_FLAG_FENCE_LOG,
			&drawctxt->flags)) {
		locked = 1;
		spin_lock(&drawctxt->lock);
	}
	dev_err(device->dev,
		"  context[%d]: queue=%d, submit=%d, start=%d, retire=%d\n",
		context->id, queue, drawctxt->submitted_timestamp,
@@ -141,7 +142,7 @@ stats:
	dev_err(device->dev, "  context[%d]: submit times: %s\n",
		context->id, buf);

	if (!fence_log)
	if (locked)
		spin_unlock(&drawctxt->lock);
}