Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux into drm-fixes

- revert gpu time fdinfo support
- reference leak fix on imported buffers

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
From: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/de8e08c2599ec0e22456ae36e9757b9ff14c2124.camel@pengutronix.de
This commit is contained in:
Daniel Vetter 2023-03-30 20:15:06 +02:00
commit 7af63e079a
4 changed files with 10 additions and 56 deletions

View File

@ -22,7 +22,6 @@
#include "etnaviv_gem.h"
#include "etnaviv_mmu.h"
#include "etnaviv_perfmon.h"
#include "common.xml.h"
/*
* DRM operations:
@ -476,47 +475,7 @@ static const struct drm_ioctl_desc etnaviv_ioctls[] = {
ETNA_IOCTL(PM_QUERY_SIG, pm_query_sig, DRM_RENDER_ALLOW),
};
static void etnaviv_fop_show_fdinfo(struct seq_file *m, struct file *f)
{
struct drm_file *file = f->private_data;
struct drm_device *dev = file->minor->dev;
struct etnaviv_drm_private *priv = dev->dev_private;
struct etnaviv_file_private *ctx = file->driver_priv;
/*
* For a description of the text output format used here, see
* Documentation/gpu/drm-usage-stats.rst.
*/
seq_printf(m, "drm-driver:\t%s\n", dev->driver->name);
seq_printf(m, "drm-client-id:\t%u\n", ctx->id);
for (int i = 0; i < ETNA_MAX_PIPES; i++) {
struct etnaviv_gpu *gpu = priv->gpu[i];
char engine[10] = "UNK";
int cur = 0;
if (!gpu)
continue;
if (gpu->identity.features & chipFeatures_PIPE_2D)
cur = snprintf(engine, sizeof(engine), "2D");
if (gpu->identity.features & chipFeatures_PIPE_3D)
cur = snprintf(engine + cur, sizeof(engine) - cur,
"%s3D", cur ? "/" : "");
if (gpu->identity.nn_core_count > 0)
cur = snprintf(engine + cur, sizeof(engine) - cur,
"%sNN", cur ? "/" : "");
seq_printf(m, "drm-engine-%s:\t%llu ns\n", engine,
ctx->sched_entity[i].elapsed_ns);
}
}
static const struct file_operations fops = {
.owner = THIS_MODULE,
DRM_GEM_FOPS,
.show_fdinfo = etnaviv_fop_show_fdinfo,
};
DEFINE_DRM_GEM_FOPS(fops);
static const struct drm_driver etnaviv_drm_driver = {
.driver_features = DRIVER_GEM | DRIVER_RENDER,

View File

@ -91,7 +91,15 @@ static void *etnaviv_gem_prime_vmap_impl(struct etnaviv_gem_object *etnaviv_obj)
static int etnaviv_gem_prime_mmap_obj(struct etnaviv_gem_object *etnaviv_obj,
struct vm_area_struct *vma)
{
return dma_buf_mmap(etnaviv_obj->base.dma_buf, vma, 0);
int ret;
ret = dma_buf_mmap(etnaviv_obj->base.dma_buf, vma, 0);
if (!ret) {
/* Drop the reference acquired by drm_gem_mmap_obj(). */
drm_gem_object_put(&etnaviv_obj->base);
}
return ret;
}
static const struct etnaviv_gem_ops etnaviv_gem_prime_ops = {

View File

@ -906,12 +906,6 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
spin_unlock(&sched->job_list_lock);
if (job) {
job->entity->elapsed_ns += ktime_to_ns(
ktime_sub(job->s_fence->finished.timestamp,
job->s_fence->scheduled.timestamp));
}
return job;
}

View File

@ -228,13 +228,6 @@ struct drm_sched_entity {
*/
struct rb_node rb_tree_node;
/**
* @elapsed_ns:
*
* Records the amount of time where jobs from this entity were active
* on the GPU.
*/
uint64_t elapsed_ns;
};
/**