From: Tianyi Liu <[email protected]>

Remove the deprecated trivial helper drm_simple_encoder_init(). Inline
the call to drm_encoder_init and add instance of
drm_encoder_funcs.

Signed-off-by: Tianyi Liu <[email protected]>
---
 drivers/gpu/drm/virtio/virtgpu_display.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c 
b/drivers/gpu/drm/virtio/virtgpu_display.c
index 44ffffec550f..048c19543218 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -32,7 +32,7 @@
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_encoder.h>
 #include <drm/drm_vblank.h>
 #include <drm/drm_vblank_helper.h>
 
@@ -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_cleanup = {
+       .destroy = drm_encoder_cleanup,
+};
+
 static int
 virtio_gpu_framebuffer_init(struct drm_device *dev,
                            struct virtio_gpu_framebuffer *vgfb,
@@ -306,7 +310,8 @@ 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_cleanup,
+                               DRM_MODE_ENCODER_VIRTUAL, NULL);
        drm_encoder_helper_add(encoder, &virtio_gpu_enc_helper_funcs);
        encoder->possible_crtcs = 1 << index;
 
-- 
2.43.0


Reply via email to