forked from rubenslte/android_kernel_samsung_msm8226
msm: kgsl: add a kgsl_readtimestamp() wrapper
Calling this device function directly from the function table is unnecessarily verbose, and done fairly often. Change-Id: Ib9d75b31dfab8fb4ccced46fe62a08a98da8c94f Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
This commit is contained in:
@@ -725,8 +725,8 @@ static int adreno_dump(struct kgsl_device *device)
|
||||
current_context));
|
||||
context = idr_find(&device->context_idr, context_id);
|
||||
if (context) {
|
||||
ts_processed = device->ftbl->readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
ts_processed = kgsl_readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
KGSL_LOG_DUMP(device, "CTXT: %d TIMESTM RTRD: %08X\n",
|
||||
context->id, ts_processed);
|
||||
} else
|
||||
|
||||
@@ -928,8 +928,8 @@ int adreno_ringbuffer_extract(struct adreno_ringbuffer *rb,
|
||||
" context id is invalid.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
retired_timestamp = device->ftbl->readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
retired_timestamp = kgsl_readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
KGSL_DRV_ERR(device, "GPU successfully executed till ts: %x\n",
|
||||
retired_timestamp);
|
||||
/*
|
||||
|
||||
+9
-12
@@ -78,8 +78,7 @@ static int kgsl_add_event(struct kgsl_device *device, u32 id, u32 ts,
|
||||
if (context == NULL)
|
||||
return -EINVAL;
|
||||
}
|
||||
cur_ts = device->ftbl->readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
cur_ts = kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_RETIRED);
|
||||
|
||||
/* Check to see if the requested timestamp has already fired */
|
||||
|
||||
@@ -135,8 +134,7 @@ static void kgsl_cancel_events_ctxt(struct kgsl_device *device,
|
||||
struct kgsl_event *event, *event_tmp;
|
||||
unsigned int id, cur;
|
||||
|
||||
cur = device->ftbl->readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
cur = kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_RETIRED);
|
||||
id = context->id;
|
||||
|
||||
list_for_each_entry_safe(event, event_tmp, &device->events, list) {
|
||||
@@ -173,8 +171,8 @@ static void kgsl_cancel_events(struct kgsl_device *device,
|
||||
if (event->owner != owner)
|
||||
continue;
|
||||
|
||||
cur = device->ftbl->readtimestamp(device, event->context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
cur = kgsl_readtimestamp(device, event->context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
|
||||
id = event->context ? event->context->id : KGSL_MEMSTORE_GLOBAL;
|
||||
/*
|
||||
@@ -425,8 +423,8 @@ void kgsl_timestamp_expired(struct work_struct *work)
|
||||
|
||||
/* Process expired events */
|
||||
list_for_each_entry_safe(event, event_tmp, &device->events, list) {
|
||||
ts_processed = device->ftbl->readtimestamp(device,
|
||||
event->context, KGSL_TIMESTAMP_RETIRED);
|
||||
ts_processed = kgsl_readtimestamp(device, event->context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
if (timestamp_cmp(ts_processed, event->timestamp) < 0)
|
||||
continue;
|
||||
|
||||
@@ -521,8 +519,8 @@ int kgsl_check_timestamp(struct kgsl_device *device,
|
||||
{
|
||||
unsigned int ts_processed;
|
||||
|
||||
ts_processed = device->ftbl->readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
ts_processed = kgsl_readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
|
||||
return (timestamp_cmp(ts_processed, timestamp) >= 0);
|
||||
}
|
||||
@@ -1164,8 +1162,7 @@ static long _cmdstream_readtimestamp(struct kgsl_device_private *dev_priv,
|
||||
struct kgsl_context *context, unsigned int type,
|
||||
unsigned int *timestamp)
|
||||
{
|
||||
*timestamp = dev_priv->device->ftbl->readtimestamp(dev_priv->device,
|
||||
context, type);
|
||||
*timestamp = kgsl_readtimestamp(dev_priv->device, context, type);
|
||||
|
||||
trace_kgsl_readtimestamp(dev_priv->device,
|
||||
context ? context->id : KGSL_MEMSTORE_GLOBAL,
|
||||
|
||||
@@ -294,6 +294,13 @@ static inline unsigned int kgsl_gpuid(struct kgsl_device *device)
|
||||
return device->ftbl->gpuid(device);
|
||||
}
|
||||
|
||||
static inline unsigned int kgsl_readtimestamp(struct kgsl_device *device,
|
||||
struct kgsl_context *context,
|
||||
enum kgsl_timestamp_type type)
|
||||
{
|
||||
return device->ftbl->readtimestamp(device, context, type);
|
||||
}
|
||||
|
||||
static inline int kgsl_create_device_sysfs_files(struct device *root,
|
||||
const struct device_attribute **list)
|
||||
{
|
||||
|
||||
@@ -63,10 +63,10 @@ static int snapshot_context_info(int id, void *ptr, void *data)
|
||||
* return the global timestamp for all contexts
|
||||
*/
|
||||
|
||||
header->timestamp_queued = device->ftbl->readtimestamp(device,
|
||||
context, KGSL_TIMESTAMP_QUEUED);
|
||||
header->timestamp_retired = device->ftbl->readtimestamp(device,
|
||||
context, KGSL_TIMESTAMP_RETIRED);
|
||||
header->timestamp_queued = kgsl_readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_QUEUED);
|
||||
header->timestamp_retired = kgsl_readtimestamp(device, context,
|
||||
KGSL_TIMESTAMP_RETIRED);
|
||||
|
||||
_ctxtptr += sizeof(struct kgsl_snapshot_linux_context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user