@@ -242,6 +242,7 @@ struct vkms_config_encoder *vkms_config_create_encoder(struct vkms_config *vkms_
if (!vkms_config_encoder)
return NULL;
+ vkms_config_encoder->type = DRM_MODE_ENCODER_VIRTUAL;
list_add(&vkms_config_encoder->link, &vkms_config->encoders);
xa_init_flags(&vkms_config_encoder->possible_crtcs, XA_FLAGS_ALLOC);
@@ -55,6 +55,7 @@ struct vkms_config_crtc {
* @link: Link to the others encoders
* @name: Name of the encoder
* @possible_crtcs: List of CRTC that can be used with this encoder
+ * @type: Type of encoder, see drm_mode.h, DRM_MODE_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
* not managed by the configuration and must be managed by other means.
@@ -64,6 +65,7 @@ struct vkms_config_encoder {
char *name;
struct xarray possible_crtcs;
+ char type;
/* Internal usage */
struct drm_encoder *encoder;
@@ -125,7 +125,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, config_encoder->name);
+ config_encoder->type, config_encoder->name);
if (ret) {
DRM_ERROR("Failed to init encoder\n");
return ret;
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> --- drivers/gpu/drm/vkms/vkms_config.c | 1 + drivers/gpu/drm/vkms/vkms_config.h | 2 ++ drivers/gpu/drm/vkms/vkms_output.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-)