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

Commit eca608a5 authored by Carter Cooper's avatar Carter Cooper
Browse files

msm: kgsl: Remove superfluous NULL checks when reading timestamps



There is no way for the UMD to pass in NULL pointers for reading
timestamps. The KGSL driver also always has valid pointers
for storing the readpointer. Remove the checks that are not needed.

Change-Id: Id5f244a57a2b991a10b603ef7236193d4282fd0f
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent 7cf3ab10
Loading
Loading
Loading
Loading
+4 −18
Original line number Diff line number Diff line
@@ -2463,13 +2463,6 @@ int adreno_rb_readtimestamp(struct adreno_device *adreno_dev,
	int status = 0;
	struct adreno_ringbuffer *rb = priv;

	/*
	 * If user passed in a NULL pointer for timestamp, return without
	 * doing anything.
	 */
	if (!timestamp)
		return status;

	if (KGSL_TIMESTAMP_QUEUED == type)
		*timestamp = rb->timestamp;
	else
@@ -2500,19 +2493,12 @@ static int adreno_readtimestamp(struct kgsl_device *device,
{
	int status = 0;
	struct kgsl_context *context = priv;
	unsigned int id = KGSL_CONTEXT_ID(context);

	BUG_ON(NULL == context || id >= KGSL_MEMSTORE_MAX);
	/*
	 * If user passed in a NULL pointer for timestamp, return without
	 * doing anything.
	 */
	if (!timestamp)
		return status;
	if (KGSL_TIMESTAMP_QUEUED == type) {
		struct adreno_context *ctxt = ADRENO_CONTEXT(context);

	if (KGSL_TIMESTAMP_QUEUED == type)
		*timestamp = adreno_context_timestamp(context);
	else
		*timestamp = ctxt->timestamp;
	} else
		status = __adreno_readtimestamp(ADRENO_DEVICE(device),
				context->id, type, timestamp);

+0 −12
Original line number Diff line number Diff line
@@ -982,18 +982,6 @@ static inline int adreno_is_a540v1(struct adreno_device *adreno_dev)
	return (ADRENO_GPUREV(adreno_dev) == ADRENO_REV_A540) &&
		(ADRENO_CHIPID_PATCH(adreno_dev->chipid) == 0);
}
/**
 * adreno_context_timestamp() - Return the last queued timestamp for the context
 * @k_ctxt: Pointer to the KGSL context to query
 *
 * Return the last queued context for the given context. This is used to verify
 * that incoming requests are not using an invalid (unsubmitted) timestamp
 */
static inline int adreno_context_timestamp(struct kgsl_context *k_ctxt)
{
	struct adreno_context *drawctxt = ADRENO_CONTEXT(k_ctxt);
	return drawctxt->timestamp;
}

/*
 * adreno_checkreg_off() - Checks the validity of a register enum