drm/virtgpu: Use simple encoder
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 5 Mar 2020 15:59:47 +0000 (16:59 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 2 Apr 2020 12:16:46 +0000 (14:16 +0200)
The virtgpu driver uses an empty implementation for its encoder. Replace
the code with the generic simple encoder.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-20-tzimmermann@suse.de
drivers/gpu/drm/virtio/virtgpu_display.c

index 2b7e6ae..cc7fd95 100644 (file)
@@ -30,6 +30,7 @@
 #include <drm/drm_fourcc.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "virtgpu_drv.h"
 
@@ -240,10 +241,6 @@ static const struct drm_connector_funcs virtio_gpu_connector_funcs = {
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
-static const struct drm_encoder_funcs virtio_gpu_enc_funcs = {
-       .destroy = drm_encoder_cleanup,
-};
-
 static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
 {
        struct drm_device *dev = vgdev->ddev;
@@ -276,8 +273,7 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
        if (vgdev->has_edid)
                drm_connector_attach_edid_property(connector);
 
-       drm_encoder_init(dev, encoder, &virtio_gpu_enc_funcs,
-                        DRM_MODE_ENCODER_VIRTUAL, NULL);
+       drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
        drm_encoder_helper_add(encoder, &virtio_gpu_enc_helper_funcs);
        encoder->possible_crtcs = 1 << index;