[PATCH RFC v2 18/18] drm/vkms: Introduce config for encoder type
Louis Chauvet
louis.chauvet at bootlin.com
Fri Nov 22 17:20:22 UTC 2024
Signed-off-by: Louis Chauvet <louis.chauvet at 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(-)
diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c
index 1a1234d4f10fa8e5ea6bd649139ecc10c991f875..26280ad223208a978c44ef9c6c6eaadf1756818d 100644
--- a/drivers/gpu/drm/vkms/vkms_config.c
+++ b/drivers/gpu/drm/vkms/vkms_config.c
@@ -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);
diff --git a/drivers/gpu/drm/vkms/vkms_config.h b/drivers/gpu/drm/vkms/vkms_config.h
index 1220b16f6c98d1ebb0ae55d662a84fe25e1a6a02..c6fe0573abd899e4b44b5ad390ff72e12664973f 100644
--- a/drivers/gpu/drm/vkms/vkms_config.h
+++ b/drivers/gpu/drm/vkms/vkms_config.h
@@ -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;
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 56590afb33d75465971d10a282040690840cdbee..7c87da5757529b9a8dae880cd32272be7dd46a27 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -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;
--
2.47.0
More information about the dri-devel
mailing list