diff options
| author | Maíra Canal <[email protected]> | 2024-04-20 21:32:10 +0000 |
|---|---|---|
| committer | Maíra Canal <[email protected]> | 2024-04-23 22:32:46 +0000 |
| commit | b136b1953f201542ae5cdfee4b35e9a2e4aa16fa (patch) | |
| tree | 288713b26ffcd069669079e83f435c37e7dbcca6 /drivers/gpu/drm/v3d/v3d_sysfs.c | |
| parent | drm/v3d: Create two functions to update all GPU stats variables (diff) | |
| download | kernel-b136b1953f201542ae5cdfee4b35e9a2e4aa16fa.tar.gz kernel-b136b1953f201542ae5cdfee4b35e9a2e4aa16fa.zip | |
drm/v3d: Create a struct to store the GPU stats
This will make it easier to instantiate the GPU stats variables and it
will create a structure where we can store all the variables that refer
to GPU stats.
Note that, when we created the struct `v3d_stats`, we renamed
`jobs_sent` to `jobs_completed`. This better express the semantics of
the variable, as we are only accounting jobs that have been completed.
Signed-off-by: Maíra Canal <[email protected]>
Reviewed-by: Tvrtko Ursulin <[email protected]>
Reviewed-by: Jose Maria Casanova Crespo <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_sysfs.c')
| -rw-r--r-- | drivers/gpu/drm/v3d/v3d_sysfs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_sysfs.c b/drivers/gpu/drm/v3d/v3d_sysfs.c index d106845ba890..6a8e7acc8b82 100644 --- a/drivers/gpu/drm/v3d/v3d_sysfs.c +++ b/drivers/gpu/drm/v3d/v3d_sysfs.c @@ -21,8 +21,10 @@ gpu_stats_show(struct device *dev, struct device_attribute *attr, char *buf) len += sysfs_emit(buf, "queue\ttimestamp\tjobs\truntime\n"); for (queue = 0; queue < V3D_MAX_QUEUES; queue++) { - if (v3d->queue[queue].start_ns) - active_runtime = timestamp - v3d->queue[queue].start_ns; + struct v3d_stats *stats = &v3d->queue[queue].stats; + + if (stats->start_ns) + active_runtime = timestamp - stats->start_ns; else active_runtime = 0; @@ -39,8 +41,8 @@ gpu_stats_show(struct device *dev, struct device_attribute *attr, char *buf) len += sysfs_emit_at(buf, len, "%s\t%llu\t%llu\t%llu\n", v3d_queue_to_string(queue), timestamp, - v3d->queue[queue].jobs_sent, - v3d->queue[queue].enabled_ns + active_runtime); + stats->jobs_completed, + stats->enabled_ns + active_runtime); } return len; |
