Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef02fe23 authored by Gerd Hoffmann's avatar Gerd Hoffmann Committed by Alistair Delva
Browse files

UPSTREAM: drm/virtio: add virtio-gpu-features debugfs file.



This file prints which features the virtio-gpu device has.

Also add "virtio-gpu-" prefix to the existing fence file,
to make clear this is a driver-specific debugfs file.

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Acked-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20190320083612.32067-1-kraxel@redhat.com


(cherry picked from commit 6bbeae35b67b339b81e42c9ab56789788491dc00)
Signed-off-by: default avatarGreg Hartman <ghartman@google.com>
BUG: 139386237
Change-Id: I35c5b4baadc240bbe0a452a1ee265be1dc2cd53c
parent eb76c4cc
Loading
Loading
Loading
Loading
+26 −1
Original line number Original line Diff line number Diff line
@@ -28,6 +28,30 @@


#include "virtgpu_drv.h"
#include "virtgpu_drv.h"


static void virtio_add_bool(struct seq_file *m, const char *name,
				    bool value)
{
	seq_printf(m, "%-16s : %s\n", name, value ? "yes" : "no");
}

static void virtio_add_int(struct seq_file *m, const char *name,
				   int value)
{
	seq_printf(m, "%-16s : %d\n", name, value);
}

static int virtio_gpu_features(struct seq_file *m, void *data)
{
	struct drm_info_node *node = (struct drm_info_node *) m->private;
	struct virtio_gpu_device *vgdev = node->minor->dev->dev_private;

	virtio_add_bool(m, "virgl", vgdev->has_virgl_3d);
	virtio_add_bool(m, "edid", vgdev->has_edid);
	virtio_add_int(m, "cap sets", vgdev->num_capsets);
	virtio_add_int(m, "scanouts", vgdev->num_scanouts);
	return 0;
}

static int
static int
virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data)
virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data)
{
{
@@ -41,7 +65,8 @@ virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data)
}
}


static struct drm_info_list virtio_gpu_debugfs_list[] = {
static struct drm_info_list virtio_gpu_debugfs_list[] = {
	{ "irq_fence", virtio_gpu_debugfs_irq_info, 0, NULL },
	{ "virtio-gpu-features", virtio_gpu_features },
	{ "virtio-gpu-irq-fence", virtio_gpu_debugfs_irq_info, 0, NULL },
};
};


#define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(virtio_gpu_debugfs_list)
#define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(virtio_gpu_debugfs_list)