-/*
- * Registers a debugfs file with a callback function for a vc4 component.
- *
- * This is like drm_debugfs_create_files(), but that can only be
- * called a given DRM minor, while the various VC4 components want to
- * register their debugfs files during the component bind process. We
- * track the request and delay it to be called on each minor during
- * vc4_debugfs_init().
- */
-void vc4_debugfs_add_file(struct drm_device *dev,
- const char *name,
- int (*show)(struct seq_file*, void*),
- void *data)
+struct vc5_gem_info_data {
+ struct drm_file *filp;
+ struct seq_file *m;
+};
+
+static int vc5_gem_one_info(int id, void *ptr, void *data)
+{
+
+ struct drm_gem_object *obj = (struct drm_gem_object *)ptr;
+ struct vc5_gem_info_data *gem_info_data = data;
+ struct vc4_file *vc4file = gem_info_data->filp->driver_priv;
+ struct drm_vc5_file_private *file_priv = &vc4file->priv;
+
+ if (!obj) {
+ DRM_ERROR("failed to get drm_gem_object\n");
+ return -EFAULT;
+ }
+
+ drm_gem_object_get(obj);
+
+ seq_printf(gem_info_data->m,
+ "%5d\t%5d\t%4d\t%4d\t\t%4d\t0x%08zx\t0x%x\t%4d\t%4d\t\t"
+ "%4d\t\t0x%p\t%6d\n",
+ file_priv->pid,
+ file_priv->tgid,
+ id,
+ kref_read(&obj->refcount) - 1,
+ obj->handle_count,
+ obj->size,
+ 0,
+ 0,
+ obj->dma_buf ? 1 : 0,
+ obj->import_attach ? 1 : 0,
+ obj,
+ obj->name);
+
+ drm_gem_object_put(obj);
+
+ return 0;
+}
+
+int vc5_debugfs_gem_info(struct seq_file *m, void *data)