summaryrefslogtreecommitdiffstats
path: root/kernel/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 3da7dc6..a47fe23 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -96,12 +96,27 @@ static unsigned int nv_vgpu_get_available(struct mdev_type *mtype)
return active >= max ? 0 : max - active;
}
+/*
+ * show_description - mdev type description for management tools.
+ *
+ * / parses "framebuffer=<n>M" from this string for EVERY
+ * supported type before creating an mdev, so the field is mandatory
+ * (missing description file -> readFile failure -> no vGPU).
+ * 256M matches the vGPU BAR1 (VRAM aperture) size we expose to guests.
+ */
+static ssize_t nv_vgpu_show_description(struct mdev_type *mtype, char *buf)
+{
+ return sysfs_emit(buf, "num_heads=1, frl_config=60, framebuffer=256M, "
+ "max_resolution=5120x2880, max_instance=1\n");
+}
+
struct mdev_driver nv_vgpu_mdev_driver = {
.device_api = VFIO_DEVICE_API_PCI_STRING,
.max_instances = 8,
.probe = nv_vgpu_mdev_create,
.remove = nv_vgpu_mdev_remove,
.get_available = nv_vgpu_get_available,
+ .show_description = nv_vgpu_show_description,
.driver = {
.name = "nvidia-vgpu-vfio-mdev",
},