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>
This commit is contained in:
parent
7607922db4
commit
b7e6436cad
2 changed files with 4 additions and 30 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue