Merge "msm: kgsl: Add new tracepoints for command batch ready and done"
This commit is contained in:
commit
f553034de9
@ -737,6 +737,7 @@ static int dispatcher_context_sendcmds(struct adreno_device *adreno_dev,
|
||||
(dispatch_q->inflight < inflight)) {
|
||||
struct kgsl_drawobj *drawobj;
|
||||
struct kgsl_drawobj_cmd *cmdobj;
|
||||
struct kgsl_context *context;
|
||||
|
||||
if (adreno_gpu_fault(adreno_dev) != 0)
|
||||
break;
|
||||
@ -762,6 +763,9 @@ static int dispatcher_context_sendcmds(struct adreno_device *adreno_dev,
|
||||
|
||||
timestamp = drawobj->timestamp;
|
||||
cmdobj = CMDOBJ(drawobj);
|
||||
context = drawobj->context;
|
||||
trace_adreno_cmdbatch_ready(context->id, context->priority,
|
||||
drawobj->timestamp, cmdobj->requeue_cnt);
|
||||
ret = sendcmd(adreno_dev, cmdobj);
|
||||
|
||||
/*
|
||||
@ -782,6 +786,7 @@ static int dispatcher_context_sendcmds(struct adreno_device *adreno_dev,
|
||||
drawctxt, cmdobj);
|
||||
if (r)
|
||||
ret = r;
|
||||
cmdobj->requeue_cnt++;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -2282,6 +2287,8 @@ static void retire_cmdobj(struct adreno_device *adreno_dev,
|
||||
drawctxt->ticks_index = (drawctxt->ticks_index + 1) %
|
||||
SUBMIT_RETIRE_TICKS_SIZE;
|
||||
|
||||
trace_adreno_cmdbatch_done(drawobj->context->id,
|
||||
drawobj->context->priority, drawobj->timestamp);
|
||||
kgsl_drawobj_destroy(drawobj);
|
||||
}
|
||||
|
||||
|
@ -455,6 +455,7 @@ static int hwsched_sendcmds(struct adreno_device *adreno_dev,
|
||||
while (1) {
|
||||
struct kgsl_drawobj *drawobj;
|
||||
struct kgsl_drawobj_cmd *cmdobj;
|
||||
struct kgsl_context *context;
|
||||
|
||||
spin_lock(&drawctxt->lock);
|
||||
drawobj = _process_drawqueue_get_next_drawobj(adreno_dev,
|
||||
@ -478,6 +479,9 @@ static int hwsched_sendcmds(struct adreno_device *adreno_dev,
|
||||
|
||||
timestamp = drawobj->timestamp;
|
||||
cmdobj = CMDOBJ(drawobj);
|
||||
context = drawobj->context;
|
||||
trace_adreno_cmdbatch_ready(context->id, context->priority,
|
||||
drawobj->timestamp, cmdobj->requeue_cnt);
|
||||
ret = hwsched_sendcmd(adreno_dev, cmdobj);
|
||||
|
||||
/*
|
||||
@ -498,6 +502,7 @@ static int hwsched_sendcmds(struct adreno_device *adreno_dev,
|
||||
drawctxt, cmdobj);
|
||||
if (r)
|
||||
ret = r;
|
||||
cmdobj->requeue_cnt++;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -1026,26 +1031,28 @@ static int adreno_hwsched_queue_cmds(struct kgsl_device_private *dev_priv,
|
||||
static void retire_cmdobj(struct adreno_hwsched *hwsched,
|
||||
struct kgsl_drawobj_cmd *cmdobj)
|
||||
{
|
||||
struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj);
|
||||
struct kgsl_drawobj *drawobj;
|
||||
struct kgsl_mem_entry *entry;
|
||||
struct kgsl_drawobj_profiling_buffer *profile_buffer;
|
||||
|
||||
if (cmdobj != NULL) {
|
||||
if (drawobj->flags & KGSL_DRAWOBJ_END_OF_FRAME)
|
||||
atomic64_inc(&drawobj->context->proc_priv->frame_count);
|
||||
drawobj = DRAWOBJ(cmdobj);
|
||||
if (drawobj->flags & KGSL_DRAWOBJ_END_OF_FRAME)
|
||||
atomic64_inc(&drawobj->context->proc_priv->frame_count);
|
||||
|
||||
entry = cmdobj->profiling_buf_entry;
|
||||
if (entry) {
|
||||
profile_buffer = kgsl_gpuaddr_to_vaddr(&entry->memdesc,
|
||||
cmdobj->profiling_buffer_gpuaddr);
|
||||
entry = cmdobj->profiling_buf_entry;
|
||||
if (entry) {
|
||||
profile_buffer = kgsl_gpuaddr_to_vaddr(&entry->memdesc,
|
||||
cmdobj->profiling_buffer_gpuaddr);
|
||||
|
||||
if (profile_buffer == NULL)
|
||||
return;
|
||||
if (profile_buffer == NULL)
|
||||
return;
|
||||
|
||||
kgsl_memdesc_unmap(&entry->memdesc);
|
||||
}
|
||||
kgsl_memdesc_unmap(&entry->memdesc);
|
||||
}
|
||||
|
||||
trace_adreno_cmdbatch_done(drawobj->context->id,
|
||||
drawobj->context->priority, drawobj->timestamp);
|
||||
|
||||
if (hwsched->big_cmdobj == cmdobj) {
|
||||
hwsched->big_cmdobj = NULL;
|
||||
kgsl_drawobj_put(drawobj);
|
||||
|
@ -218,6 +218,49 @@ TRACE_EVENT(adreno_cmdbatch_sync,
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(adreno_cmdbatch_ready,
|
||||
TP_PROTO(unsigned int ctx_id, unsigned int ctx_prio,
|
||||
unsigned int timestamp, unsigned int requeue_cnt),
|
||||
TP_ARGS(ctx_id, ctx_prio, timestamp, requeue_cnt),
|
||||
TP_STRUCT__entry(
|
||||
__field(unsigned int, id)
|
||||
__field(int, prio)
|
||||
__field(unsigned int, timestamp)
|
||||
__field(unsigned int, requeue_cnt)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->id = ctx_id;
|
||||
__entry->prio = ctx_prio;
|
||||
__entry->timestamp = timestamp;
|
||||
__entry->requeue_cnt = requeue_cnt;
|
||||
),
|
||||
TP_printk(
|
||||
"ctx=%u ctx_prio=%d ts=%u requeue_cnt=%u",
|
||||
__entry->id, __entry->prio, __entry->timestamp,
|
||||
__entry->requeue_cnt
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(adreno_cmdbatch_done,
|
||||
TP_PROTO(unsigned int ctx_id, unsigned int ctx_prio,
|
||||
unsigned int timestamp),
|
||||
TP_ARGS(ctx_id, ctx_prio, timestamp),
|
||||
TP_STRUCT__entry(
|
||||
__field(unsigned int, id)
|
||||
__field(unsigned int, prio)
|
||||
__field(unsigned int, timestamp)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->id = ctx_id;
|
||||
__entry->prio = ctx_prio;
|
||||
__entry->timestamp = timestamp;
|
||||
),
|
||||
TP_printk(
|
||||
"ctx=%u ctx_prio=%u ts=%u",
|
||||
__entry->id, __entry->prio, __entry->timestamp
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(adreno_cmdbatch_fault,
|
||||
TP_PROTO(struct kgsl_drawobj_cmd *cmdobj, unsigned int fault),
|
||||
TP_ARGS(cmdobj, fault),
|
||||
|
@ -1130,6 +1130,7 @@ struct kgsl_drawobj_cmd *kgsl_drawobj_cmd_create(struct kgsl_device *device,
|
||||
|
||||
INIT_LIST_HEAD(&cmdobj->cmdlist);
|
||||
INIT_LIST_HEAD(&cmdobj->memlist);
|
||||
cmdobj->requeue_cnt = 0;
|
||||
|
||||
if (type & CMDOBJ_TYPE)
|
||||
atomic_inc(&context->proc_priv->cmd_count);
|
||||
|
@ -85,6 +85,8 @@ struct kgsl_drawobj_cmd {
|
||||
uint64_t submit_ticks;
|
||||
/* @numibs: Number of ibs in this cmdobj */
|
||||
u32 numibs;
|
||||
/* @requeue_cnt: Number of times cmdobj was requeued before submission to dq succeeded */
|
||||
u32 requeue_cnt;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user