summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarter Cooper <ccooper@codeaurora.org>2016-04-29 09:20:49 -0600
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-05 15:05:56 -0700
commitb7e6436cad55506bcaec2d8405b0891a0fd9d76c (patch)
tree805dadb5f9ea6782137e953efdf754f41bfef79d
parent7607922db460859d1862f97be63db4f1471ef248 (diff)
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: Carter Cooper <ccooper@codeaurora.org>
-rw-r--r--drivers/gpu/msm/adreno.c22
-rw-r--r--drivers/gpu/msm/adreno.h12
2 files changed, 4 insertions, 30 deletions
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index 24c5186340e5..fa981cf575a6 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -2437,13 +2437,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
@@ -2474,19 +2467,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 (type == KGSL_TIMESTAMP_QUEUED) {
+ 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);
diff --git a/drivers/gpu/msm/adreno.h b/drivers/gpu/msm/adreno.h
index 875b186cde3f..b8029178f932 100644
--- a/drivers/gpu/msm/adreno.h
+++ b/drivers/gpu/msm/adreno.h
@@ -968,18 +968,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