提交 62fbddda 编写于 作者: T Thomas Zimmermann

drm/imx: Use simple encoder

The imx driver uses empty implementations for its encoders. Replace
the code with the generic simple encoder.
Signed-off-by: NThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-9-tzimmermann@suse.de
上级 a1170f90
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <drm/drm_edid.h> #include <drm/drm_edid.h>
#include <drm/drm_encoder.h> #include <drm/drm_encoder.h>
#include <drm/drm_of.h> #include <drm/drm_of.h>
#include <drm/drm_simple_kms_helper.h>
#include "imx-drm.h" #include "imx-drm.h"
...@@ -143,10 +144,6 @@ static const struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = ...@@ -143,10 +144,6 @@ static const struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs =
.atomic_check = dw_hdmi_imx_atomic_check, .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 static enum drm_mode_status
imx6q_hdmi_mode_valid(struct drm_connector *con, imx6q_hdmi_mode_valid(struct drm_connector *con,
const struct drm_display_mode *mode) const struct drm_display_mode *mode)
...@@ -236,8 +233,7 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master, ...@@ -236,8 +233,7 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master,
return ret; return ret;
drm_encoder_helper_add(encoder, &dw_hdmi_imx_encoder_helper_funcs); drm_encoder_helper_add(encoder, &dw_hdmi_imx_encoder_helper_funcs);
drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs, drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
DRM_MODE_ENCODER_TMDS, NULL);
platform_set_drvdata(pdev, hdmi); platform_set_drvdata(pdev, hdmi);
......
...@@ -42,12 +42,6 @@ void imx_drm_connector_destroy(struct drm_connector *connector) ...@@ -42,12 +42,6 @@ void imx_drm_connector_destroy(struct drm_connector *connector)
} }
EXPORT_SYMBOL_GPL(imx_drm_connector_destroy); 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, static int imx_drm_atomic_check(struct drm_device *dev,
struct drm_atomic_state *state) struct drm_atomic_state *state)
{ {
......
...@@ -38,7 +38,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm, ...@@ -38,7 +38,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
struct drm_encoder *encoder, struct device_node *np); struct drm_encoder *encoder, struct device_node *np);
void imx_drm_connector_destroy(struct drm_connector *connector); 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, int ipu_planes_assign_pre(struct drm_device *dev,
struct drm_atomic_state *state); struct drm_atomic_state *state);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_print.h> #include <drm/drm_print.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include "imx-drm.h" #include "imx-drm.h"
...@@ -393,10 +394,6 @@ static const struct drm_connector_helper_funcs imx_ldb_connector_helper_funcs = ...@@ -393,10 +394,6 @@ static const struct drm_connector_helper_funcs imx_ldb_connector_helper_funcs =
.best_encoder = imx_ldb_connector_best_encoder, .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 = { static const struct drm_encoder_helper_funcs imx_ldb_encoder_helper_funcs = {
.atomic_mode_set = imx_ldb_encoder_atomic_mode_set, .atomic_mode_set = imx_ldb_encoder_atomic_mode_set,
.enable = imx_ldb_encoder_enable, .enable = imx_ldb_encoder_enable,
...@@ -441,8 +438,7 @@ static int imx_ldb_register(struct drm_device *drm, ...@@ -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_helper_add(encoder, &imx_ldb_encoder_helper_funcs);
drm_encoder_init(drm, encoder, &imx_ldb_encoder_funcs, drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_LVDS);
DRM_MODE_ENCODER_LVDS, NULL);
if (imx_ldb_ch->bridge) { if (imx_ldb_ch->bridge) {
ret = drm_bridge_attach(&imx_ldb_ch->encoder, ret = drm_bridge_attach(&imx_ldb_ch->encoder,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_fb_helper.h> #include <drm/drm_fb_helper.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include "imx-drm.h" #include "imx-drm.h"
...@@ -348,10 +349,6 @@ static const struct drm_connector_helper_funcs imx_tve_connector_helper_funcs = ...@@ -348,10 +349,6 @@ static const struct drm_connector_helper_funcs imx_tve_connector_helper_funcs =
.mode_valid = imx_tve_connector_mode_valid, .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 = { static const struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = {
.mode_set = imx_tve_encoder_mode_set, .mode_set = imx_tve_encoder_mode_set,
.enable = imx_tve_encoder_enable, .enable = imx_tve_encoder_enable,
...@@ -479,8 +476,7 @@ static int imx_tve_register(struct drm_device *drm, struct imx_tve *tve) ...@@ -479,8 +476,7 @@ static int imx_tve_register(struct drm_device *drm, struct imx_tve *tve)
return ret; return ret;
drm_encoder_helper_add(&tve->encoder, &imx_tve_encoder_helper_funcs); drm_encoder_helper_add(&tve->encoder, &imx_tve_encoder_helper_funcs);
drm_encoder_init(drm, &tve->encoder, &imx_tve_encoder_funcs, drm_simple_encoder_init(drm, &tve->encoder, encoder_type);
encoder_type, NULL);
drm_connector_helper_add(&tve->connector, drm_connector_helper_add(&tve->connector,
&imx_tve_connector_helper_funcs); &imx_tve_connector_helper_funcs);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <drm/drm_of.h> #include <drm/drm_of.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include "imx-drm.h" #include "imx-drm.h"
...@@ -256,10 +257,6 @@ static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = { ...@@ -256,10 +257,6 @@ static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = {
.best_encoder = imx_pd_connector_best_encoder, .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 = { static const struct drm_bridge_funcs imx_pd_bridge_funcs = {
.enable = imx_pd_bridge_enable, .enable = imx_pd_bridge_enable,
.disable = imx_pd_bridge_disable, .disable = imx_pd_bridge_disable,
...@@ -288,8 +285,7 @@ static int imx_pd_register(struct drm_device *drm, ...@@ -288,8 +285,7 @@ static int imx_pd_register(struct drm_device *drm,
*/ */
imxpd->connector.dpms = DRM_MODE_DPMS_OFF; imxpd->connector.dpms = DRM_MODE_DPMS_OFF;
drm_encoder_init(drm, encoder, &imx_pd_encoder_funcs, drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_NONE);
DRM_MODE_ENCODER_NONE, NULL);
imxpd->bridge.funcs = &imx_pd_bridge_funcs; imxpd->bridge.funcs = &imx_pd_bridge_funcs;
drm_bridge_attach(encoder, &imxpd->bridge, NULL, 0); drm_bridge_attach(encoder, &imxpd->bridge, NULL, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册