Thread (3 messages) flat view 3 messages, 3 authors, 6d ago
COOLING6d

[PATCH] drm/virtio: Replace deprecated drm_simple_encoder_init()

From: Davide Bonatto <hidden>
Date: 2026-09-09 07:35:04
Also in: dri-devel, lkml
Subsystem: drm drivers, drm drivers and misc gpu patches, the rest, virtio gpu driver · Maintainers: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Linus Torvalds, David Airlie, Gerd Hoffmann, Dmitry Osipenko

drm_simple_encoder_init() is deprecated as it introduces an unnecessary
intermediate layer between atomic modesetting and DRM drivers.

Inline the helper call in virtgpu_display by defining
virtio_gpu_encoder_funcs with the default drm_encoder_cleanup callback,
and migrate directly to drm_encoder_init()

Signed-off-by: Davide Bonatto <redacted>
---
 drivers/gpu/drm/virtio/virtgpu_display.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index a1a875a0c706..85986578001f 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -67,6 +67,10 @@ static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = {
 	.dirty = drm_atomic_helper_dirtyfb,
 };
 
+static const struct drm_encoder_funcs virtio_gpu_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
 static int
 virtio_gpu_framebuffer_init(struct drm_device *dev,
 			    struct virtio_gpu_framebuffer *vgfb,
@@ -306,7 +310,9 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
 	if (vgdev->has_edid)
 		drm_connector_attach_edid_property(connector);
 
-	drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
+	drm_encoder_init(dev, encoder, &virtio_gpu_encoder_funcs,
+		DRM_MODE_ENCODER_VIRTUAL, NULL);
+
 	drm_encoder_helper_add(encoder, &virtio_gpu_enc_helper_funcs);
 	encoder->possible_crtcs = 1 << index;
 
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help