Commit 45bb564d authored by Umesh Nerlige Ramappa's avatar Umesh Nerlige Ramappa

drm/xe: Use run_ticks instead of runtime for client stats

Note that runtime is also used in the pm context, so it is confusing to
use the same name to denote run time of the drm client. Use a more
appropriate name for the client utilization.

While at it, drop the incorrect multi-lrc comment in the helper
description

v2: s/show_runtime/show_run_ticks/ (Rodrigo)
Signed-off-by: default avatarUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240524234744.1352543-1-umesh.nerlige.ramappa@intel.com
parent 50e52592
...@@ -559,8 +559,8 @@ struct xe_file { ...@@ -559,8 +559,8 @@ struct xe_file {
struct mutex lock; struct mutex lock;
} exec_queue; } exec_queue;
/** @runtime: hw engine class runtime in ticks for this drm client */ /** @run_ticks: hw engine class run time in ticks for this drm client */
u64 runtime[XE_ENGINE_CLASS_MAX]; u64 run_ticks[XE_ENGINE_CLASS_MAX];
/** @client: drm client */ /** @client: drm client */
struct xe_drm_client *client; struct xe_drm_client *client;
......
...@@ -237,7 +237,7 @@ static void show_meminfo(struct drm_printer *p, struct drm_file *file) ...@@ -237,7 +237,7 @@ static void show_meminfo(struct drm_printer *p, struct drm_file *file)
} }
} }
static void show_runtime(struct drm_printer *p, struct drm_file *file) static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
{ {
unsigned long class, i, gt_id, capacity[XE_ENGINE_CLASS_MAX] = { }; unsigned long class, i, gt_id, capacity[XE_ENGINE_CLASS_MAX] = { };
struct xe_file *xef = file->driver_priv; struct xe_file *xef = file->driver_priv;
...@@ -252,7 +252,7 @@ static void show_runtime(struct drm_printer *p, struct drm_file *file) ...@@ -252,7 +252,7 @@ static void show_runtime(struct drm_printer *p, struct drm_file *file)
/* Accumulate all the exec queues from this client */ /* Accumulate all the exec queues from this client */
mutex_lock(&xef->exec_queue.lock); mutex_lock(&xef->exec_queue.lock);
xa_for_each(&xef->exec_queue.xa, i, q) xa_for_each(&xef->exec_queue.xa, i, q)
xe_exec_queue_update_runtime(q); xe_exec_queue_update_run_ticks(q);
mutex_unlock(&xef->exec_queue.lock); mutex_unlock(&xef->exec_queue.lock);
/* Get the total GPU cycles */ /* Get the total GPU cycles */
...@@ -287,7 +287,7 @@ static void show_runtime(struct drm_printer *p, struct drm_file *file) ...@@ -287,7 +287,7 @@ static void show_runtime(struct drm_printer *p, struct drm_file *file)
class_name = xe_hw_engine_class_to_str(class); class_name = xe_hw_engine_class_to_str(class);
drm_printf(p, "drm-cycles-%s:\t%llu\n", drm_printf(p, "drm-cycles-%s:\t%llu\n",
class_name, xef->runtime[class]); class_name, xef->run_ticks[class]);
drm_printf(p, "drm-total-cycles-%s:\t%llu\n", drm_printf(p, "drm-total-cycles-%s:\t%llu\n",
class_name, gpu_timestamp); class_name, gpu_timestamp);
...@@ -310,6 +310,6 @@ static void show_runtime(struct drm_printer *p, struct drm_file *file) ...@@ -310,6 +310,6 @@ static void show_runtime(struct drm_printer *p, struct drm_file *file)
void xe_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file) void xe_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file)
{ {
show_meminfo(p, file); show_meminfo(p, file);
show_runtime(p, file); show_run_ticks(p, file);
} }
#endif #endif
...@@ -751,14 +751,14 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q) ...@@ -751,14 +751,14 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
} }
/** /**
* xe_exec_queue_update_runtime() - Update runtime for this exec queue from hw * xe_exec_queue_update_run_ticks() - Update run time in ticks for this exec queue
* from hw
* @q: The exec queue * @q: The exec queue
* *
* Update the timestamp saved by HW for this exec queue and save runtime * Update the timestamp saved by HW for this exec queue and save run ticks
* calculated by using the delta from last update. On multi-lrc case, only the * calculated by using the delta from last update.
* first is considered.
*/ */
void xe_exec_queue_update_runtime(struct xe_exec_queue *q) void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
{ {
struct xe_file *xef; struct xe_file *xef;
struct xe_lrc *lrc; struct xe_lrc *lrc;
...@@ -784,7 +784,7 @@ void xe_exec_queue_update_runtime(struct xe_exec_queue *q) ...@@ -784,7 +784,7 @@ void xe_exec_queue_update_runtime(struct xe_exec_queue *q)
*/ */
lrc = &q->lrc[0]; lrc = &q->lrc[0];
new_ts = xe_lrc_update_timestamp(lrc, &old_ts); new_ts = xe_lrc_update_timestamp(lrc, &old_ts);
xef->runtime[q->class] += (new_ts - old_ts) * q->width; xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;
} }
void xe_exec_queue_kill(struct xe_exec_queue *q) void xe_exec_queue_kill(struct xe_exec_queue *q)
......
...@@ -75,6 +75,6 @@ struct dma_fence *xe_exec_queue_last_fence_get(struct xe_exec_queue *e, ...@@ -75,6 +75,6 @@ struct dma_fence *xe_exec_queue_last_fence_get(struct xe_exec_queue *e,
struct xe_vm *vm); struct xe_vm *vm);
void xe_exec_queue_last_fence_set(struct xe_exec_queue *e, struct xe_vm *vm, void xe_exec_queue_last_fence_set(struct xe_exec_queue *e, struct xe_vm *vm,
struct dma_fence *fence); struct dma_fence *fence);
void xe_exec_queue_update_runtime(struct xe_exec_queue *q); void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q);
#endif #endif
...@@ -306,7 +306,7 @@ static void execlist_job_free(struct drm_sched_job *drm_job) ...@@ -306,7 +306,7 @@ static void execlist_job_free(struct drm_sched_job *drm_job)
{ {
struct xe_sched_job *job = to_xe_sched_job(drm_job); struct xe_sched_job *job = to_xe_sched_job(drm_job);
xe_exec_queue_update_runtime(job->q); xe_exec_queue_update_run_ticks(job->q);
xe_sched_job_put(job); xe_sched_job_put(job);
} }
......
...@@ -763,7 +763,7 @@ static void guc_exec_queue_free_job(struct drm_sched_job *drm_job) ...@@ -763,7 +763,7 @@ static void guc_exec_queue_free_job(struct drm_sched_job *drm_job)
{ {
struct xe_sched_job *job = to_xe_sched_job(drm_job); struct xe_sched_job *job = to_xe_sched_job(drm_job);
xe_exec_queue_update_runtime(job->q); xe_exec_queue_update_run_ticks(job->q);
trace_xe_sched_job_free(job); trace_xe_sched_job_free(job);
xe_sched_job_put(job); xe_sched_job_put(job);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment