Skip to content

Commit 2658d0d

Browse files
committed
Revert "drm/etnaviv: export client GPU usage statistics via fdinfo"
This reverts commit 97804a1, as it builds on top of df62272 ("drm/scheduler: track GPU active time per entity") which needs to be reverted, as it introduces a use-after-free. Signed-off-by: Lucas Stach <[email protected]>
1 parent 963b2e8 commit 2658d0d

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

drivers/gpu/drm/etnaviv/etnaviv_drv.c

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "etnaviv_gem.h"
2323
#include "etnaviv_mmu.h"
2424
#include "etnaviv_perfmon.h"
25-
#include "common.xml.h"
2625

2726
/*
2827
* DRM operations:
@@ -476,47 +475,7 @@ static const struct drm_ioctl_desc etnaviv_ioctls[] = {
476475
ETNA_IOCTL(PM_QUERY_SIG, pm_query_sig, DRM_RENDER_ALLOW),
477476
};
478477

479-
static void etnaviv_fop_show_fdinfo(struct seq_file *m, struct file *f)
480-
{
481-
struct drm_file *file = f->private_data;
482-
struct drm_device *dev = file->minor->dev;
483-
struct etnaviv_drm_private *priv = dev->dev_private;
484-
struct etnaviv_file_private *ctx = file->driver_priv;
485-
486-
/*
487-
* For a description of the text output format used here, see
488-
* Documentation/gpu/drm-usage-stats.rst.
489-
*/
490-
seq_printf(m, "drm-driver:\t%s\n", dev->driver->name);
491-
seq_printf(m, "drm-client-id:\t%u\n", ctx->id);
492-
493-
for (int i = 0; i < ETNA_MAX_PIPES; i++) {
494-
struct etnaviv_gpu *gpu = priv->gpu[i];
495-
char engine[10] = "UNK";
496-
int cur = 0;
497-
498-
if (!gpu)
499-
continue;
500-
501-
if (gpu->identity.features & chipFeatures_PIPE_2D)
502-
cur = snprintf(engine, sizeof(engine), "2D");
503-
if (gpu->identity.features & chipFeatures_PIPE_3D)
504-
cur = snprintf(engine + cur, sizeof(engine) - cur,
505-
"%s3D", cur ? "/" : "");
506-
if (gpu->identity.nn_core_count > 0)
507-
cur = snprintf(engine + cur, sizeof(engine) - cur,
508-
"%sNN", cur ? "/" : "");
509-
510-
seq_printf(m, "drm-engine-%s:\t%llu ns\n", engine,
511-
ctx->sched_entity[i].elapsed_ns);
512-
}
513-
}
514-
515-
static const struct file_operations fops = {
516-
.owner = THIS_MODULE,
517-
DRM_GEM_FOPS,
518-
.show_fdinfo = etnaviv_fop_show_fdinfo,
519-
};
478+
DEFINE_DRM_GEM_FOPS(fops);
520479

521480
static const struct drm_driver etnaviv_drm_driver = {
522481
.driver_features = DRIVER_GEM | DRIVER_RENDER,

0 commit comments

Comments
 (0)