]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/imx: Use simple encoder
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 5 Mar 2020 15:59:36 +0000 (16:59 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 2 Apr 2020 12:16:44 +0000 (14:16 +0200)
The imx driver uses empty implementations for its encoders. 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-9-tzimmermann@suse.de
drivers/gpu/drm/imx/dw_hdmi-imx.c
drivers/gpu/drm/imx/imx-drm-core.c
drivers/gpu/drm/imx/imx-drm.h
drivers/gpu/drm/imx/imx-ldb.c
drivers/gpu/drm/imx/imx-tve.c
drivers/gpu/drm/imx/parallel-display.c

index f22cfbf9353ede21121809335751130a9777217a..ba4ca17fd4d8507186261c2abffeb504fe165cc3 100644 (file)
@@ -18,6 +18,7 @@
 #include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_of.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "imx-drm.h"
 
@@ -143,10 +144,6 @@ static const struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs =
        .atomic_check = dw_hdmi_imx_atomic_check,
 };
 
-static const struct drm_encoder_funcs dw_hdmi_imx_encoder_funcs = {
-       .destroy = drm_encoder_cleanup,
-};
-
 static enum drm_mode_status
 imx6q_hdmi_mode_valid(struct drm_connector *con,
                      const struct drm_display_mode *mode)
@@ -236,8 +233,7 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master,
                return ret;
 
        drm_encoder_helper_add(encoder, &dw_hdmi_imx_encoder_helper_funcs);
-       drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs,
-                        DRM_MODE_ENCODER_TMDS, NULL);
+       drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
 
        platform_set_drvdata(pdev, hdmi);
 
index 9e8e0b70349885cd86d3a24af8576ffad8810176..2e38f1a5cf8da6a195a9a6ed85f9483960a69953 100644 (file)
@@ -42,12 +42,6 @@ void imx_drm_connector_destroy(struct drm_connector *connector)
 }
 EXPORT_SYMBOL_GPL(imx_drm_connector_destroy);
 
-void imx_drm_encoder_destroy(struct drm_encoder *encoder)
-{
-       drm_encoder_cleanup(encoder);
-}
-EXPORT_SYMBOL_GPL(imx_drm_encoder_destroy);
-
 static int imx_drm_atomic_check(struct drm_device *dev,
                                struct drm_atomic_state *state)
 {
index ab9c6f706eb3d8b87db9ac4bac336bf7cd3c9cd9..c3e1a3f14d30cd00de6bdb9352a9d29f90c853ac 100644 (file)
@@ -38,7 +38,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
        struct drm_encoder *encoder, struct device_node *np);
 
 void imx_drm_connector_destroy(struct drm_connector *connector);
-void imx_drm_encoder_destroy(struct drm_encoder *encoder);
 
 int ipu_planes_assign_pre(struct drm_device *dev,
                          struct drm_atomic_state *state);
index 4da22a94790cfca5059de6ab720067154e3cd9ba..66ea68e8da8757d23c33f345280e6c6c60f6beee 100644 (file)
@@ -26,6 +26,7 @@
 #include <drm/drm_panel.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "imx-drm.h"
 
@@ -393,10 +394,6 @@ static const struct drm_connector_helper_funcs imx_ldb_connector_helper_funcs =
        .best_encoder = imx_ldb_connector_best_encoder,
 };
 
-static const struct drm_encoder_funcs imx_ldb_encoder_funcs = {
-       .destroy = imx_drm_encoder_destroy,
-};
-
 static const struct drm_encoder_helper_funcs imx_ldb_encoder_helper_funcs = {
        .atomic_mode_set = imx_ldb_encoder_atomic_mode_set,
        .enable = imx_ldb_encoder_enable,
@@ -441,8 +438,7 @@ static int imx_ldb_register(struct drm_device *drm,
        }
 
        drm_encoder_helper_add(encoder, &imx_ldb_encoder_helper_funcs);
-       drm_encoder_init(drm, encoder, &imx_ldb_encoder_funcs,
-                        DRM_MODE_ENCODER_LVDS, NULL);
+       drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_LVDS);
 
        if (imx_ldb_ch->bridge) {
                ret = drm_bridge_attach(&imx_ldb_ch->encoder,
index 5bbfaa2cd0f47af15f0594f5001857ed5440dcbb..ee63782c77e9cc12db78c643e5f32dd7d7954470 100644 (file)
@@ -21,6 +21,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "imx-drm.h"
 
@@ -348,10 +349,6 @@ static const struct drm_connector_helper_funcs imx_tve_connector_helper_funcs =
        .mode_valid = imx_tve_connector_mode_valid,
 };
 
-static const struct drm_encoder_funcs imx_tve_encoder_funcs = {
-       .destroy = imx_drm_encoder_destroy,
-};
-
 static const struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = {
        .mode_set = imx_tve_encoder_mode_set,
        .enable = imx_tve_encoder_enable,
@@ -479,8 +476,7 @@ static int imx_tve_register(struct drm_device *drm, struct imx_tve *tve)
                return ret;
 
        drm_encoder_helper_add(&tve->encoder, &imx_tve_encoder_helper_funcs);
-       drm_encoder_init(drm, &tve->encoder, &imx_tve_encoder_funcs,
-                        encoder_type, NULL);
+       drm_simple_encoder_init(drm, &tve->encoder, encoder_type);
 
        drm_connector_helper_add(&tve->connector,
                        &imx_tve_connector_helper_funcs);
index 08fafa4bf8c21302d8d0e464081f6b29281f0291..ac916c84a63185ef584569ab5bba2c599d96c95d 100644 (file)
@@ -18,6 +18,7 @@
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "imx-drm.h"
 
@@ -256,10 +257,6 @@ static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = {
        .best_encoder = imx_pd_connector_best_encoder,
 };
 
-static const struct drm_encoder_funcs imx_pd_encoder_funcs = {
-       .destroy = imx_drm_encoder_destroy,
-};
-
 static const struct drm_bridge_funcs imx_pd_bridge_funcs = {
        .enable = imx_pd_bridge_enable,
        .disable = imx_pd_bridge_disable,
@@ -288,8 +285,7 @@ static int imx_pd_register(struct drm_device *drm,
         */
        imxpd->connector.dpms = DRM_MODE_DPMS_OFF;
 
-       drm_encoder_init(drm, encoder, &imx_pd_encoder_funcs,
-                        DRM_MODE_ENCODER_NONE, NULL);
+       drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_NONE);
 
        imxpd->bridge.funcs = &imx_pd_bridge_funcs;
        drm_bridge_attach(encoder, &imxpd->bridge, NULL, 0);