@@ -41,6 +41,10 @@ struct vkms_config *vkms_config_alloc_default(bool enable_writeback, bool enable
encoder = vkms_config_create_encoder(vkms_config);
if (!encoder)
goto err_alloc;
+ encoder->name = kzalloc(sizeof("Main Encoder"), GFP_KERNEL);
+ if (!encoder->name)
+ goto err_alloc;
+ sprintf(encoder->name, "Main Encoder");
if (vkms_config_encoder_attach_crtc(encoder, crtc))
goto err_alloc;
@@ -238,6 +242,7 @@ void vkms_config_delete_encoder(struct vkms_config_encoder *vkms_config_encoder,
}
}
+ kfree(vkms_config_encoder->name);
kfree(vkms_config_encoder);
}
@@ -403,6 +408,7 @@ static int vkms_config_show(struct seq_file *m, void *data)
list_for_each_entry(config_encoder, &vkmsdev->config->encoders, link) {
seq_puts(m, "encoder:\n");
+ seq_printf(m, "\tname: %s\n", config_encoder->name);
}
list_for_each_entry(config_crtc, &vkmsdev->config->crtcs, link) {
@@ -50,6 +50,7 @@ struct vkms_config_crtc {
* struct vkms_config_encoder
*
* @link: Link to the others encoders
+ * @name: Name of the encoder
* @possible_crtcs: List of CRTC that can be used with this encoder
* @encoder: Internal usage. This pointer should never be considered as valid. It can be used to
* store a temporary reference to a vkms encoder during device creation. This pointer is
@@ -58,6 +59,7 @@ struct vkms_config_crtc {
struct vkms_config_encoder {
struct list_head link;
+ char *name;
struct xarray possible_crtcs;
/* Internal usage */
@@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev)
if (!config_encoder->encoder)
return -ENOMEM;
ret = drmm_encoder_init(dev, config_encoder->encoder, NULL,
- DRM_MODE_ENCODER_VIRTUAL, NULL);
+ DRM_MODE_ENCODER_VIRTUAL, config_encoder->name);
if (ret) {
DRM_ERROR("Failed to init encoder\n");
return ret;
As an encoder will be a directory in ConfigFS, add the configuration for encoder name so we will be able to reflect the configfs directory name in the drm name. Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> --- drivers/gpu/drm/vkms/vkms_config.c | 6 ++++++ drivers/gpu/drm/vkms/vkms_config.h | 2 ++ drivers/gpu/drm/vkms/vkms_output.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-)