@@ -36,6 +36,10 @@ struct vkms_config *vkms_config_alloc_default(bool enable_writeback, bool enable
goto err_alloc;
plane->type = DRM_PLANE_TYPE_PRIMARY;
+ plane->name = kzalloc(sizeof("primary"), GFP_KERNEL);
+ if (!plane->name)
+ goto err_alloc;
+ sprintf(plane->name, "primary");
if (enable_overlay) {
for (int i = 0; i < NUM_OVERLAY_PLANES; i++) {
@@ -43,6 +47,10 @@ struct vkms_config *vkms_config_alloc_default(bool enable_writeback, bool enable
if (!plane)
goto err_alloc;
plane->type = DRM_PLANE_TYPE_OVERLAY;
+ plane->name = kzalloc(10, GFP_KERNEL);
+ if (!plane->name)
+ goto err_alloc;
+ snprintf(plane->name, 10, "plane-%d", i);
}
}
if (enable_cursor) {
@@ -50,6 +58,10 @@ struct vkms_config *vkms_config_alloc_default(bool enable_writeback, bool enable
if (!plane)
goto err_alloc;
plane->type = DRM_PLANE_TYPE_CURSOR;
+ plane->name = kzalloc(sizeof("cursor"), GFP_KERNEL);
+ if (!plane->name)
+ goto err_alloc;
+ sprintf(plane->name, "cursor");
}
return vkms_config;
@@ -82,6 +94,7 @@ void vkms_config_delete_plane(struct vkms_config_plane *vkms_config_overlay)
if (!vkms_config_overlay)
return;
list_del(&vkms_config_overlay->link);
+ kfree(vkms_config_overlay->name);
kfree(vkms_config_overlay);
}
@@ -136,6 +149,7 @@ static int vkms_config_show(struct seq_file *m, void *data)
seq_printf(m, "writeback=%d\n", vkmsdev->config->writeback);
list_for_each_entry(config_plane, &vkmsdev->config->planes, link) {
seq_puts(m, "plane:\n");
+ seq_printf(m, "\tname: %s\n", config_plane->name);
seq_printf(m, "\ttype: %d\n", config_plane->type);
}
@@ -27,6 +27,7 @@ struct vkms_config {
* struct vkms_config_plane
*
* @link: Link to the others planes
+ * @name: Name of the plane
* @type: Type of the plane. The creator of configuration needs to ensures that at least one
* plane is primary.
* @plane: Internal usage. This pointer should never be considered as valid. It can be used to
@@ -36,6 +37,7 @@ struct vkms_config {
struct vkms_config_plane {
struct list_head link;
+ char *name;
enum drm_plane_type type;
/* Internal usage */
@@ -228,7 +228,7 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 0,
&vkms_plane_funcs,
vkms_formats, ARRAY_SIZE(vkms_formats),
- NULL, config->type, NULL);
+ NULL, config->type, config->name);
if (IS_ERR(plane))
return plane;
As a plane will be a folder in ConfigFS, add name configuration for plane so it will reflect the folder name. Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> --- drivers/gpu/drm/vkms/vkms_config.c | 14 ++++++++++++++ drivers/gpu/drm/vkms/vkms_config.h | 2 ++ drivers/gpu/drm/vkms/vkms_plane.c | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-)