]> www.infradead.org Git - users/willy/linux.git/commitdiff
drm/hisilicon: Use simple encoder
authorTian Tao <tiantao6@hisilicon.com>
Mon, 28 Dec 2020 07:35:36 +0000 (15:35 +0800)
committerTian Tao <tiantao6@hisilicon.com>
Fri, 8 Jan 2021 00:42:21 +0000 (19:42 -0500)
The hibmc driver uses empty implementations for its encoders. Replace
the code with the generic simple encoder.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1609140936-57002-1-git-send-email-tiantao6@hisilicon.com
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c

index d35548dd7f654039c92ba74539224b7f25279362..c76f996a426c83c75451c2e170cf7678e0a42518 100644 (file)
@@ -14,6 +14,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_print.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "hibmc_drm_drv.h"
 #include "hibmc_drm_regs.h"
@@ -90,10 +91,6 @@ static const struct drm_encoder_helper_funcs hibmc_encoder_helper_funcs = {
        .mode_set = hibmc_encoder_mode_set,
 };
 
-static const struct drm_encoder_funcs hibmc_encoder_funcs = {
-       .destroy = drm_encoder_cleanup,
-};
-
 int hibmc_vdac_init(struct hibmc_drm_private *priv)
 {
        struct drm_device *dev = &priv->dev;
@@ -109,8 +106,7 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv)
        }
 
        encoder->possible_crtcs = 0x1;
-       ret = drm_encoder_init(dev, encoder, &hibmc_encoder_funcs,
-                              DRM_MODE_ENCODER_DAC, NULL);
+       ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_DAC);
        if (ret) {
                drm_err(dev, "failed to init encoder: %d\n", ret);
                return ret;