Commit 4d0e95e0 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/tegra: Use simple encoder

The tegra driver uses empty implementations for its encoders. Replace
the code with the generic simple encoder.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-16-tzimmermann@suse.de
parent f9f3a38d
...@@ -152,8 +152,6 @@ enum drm_connector_status ...@@ -152,8 +152,6 @@ enum drm_connector_status
tegra_output_connector_detect(struct drm_connector *connector, bool force); tegra_output_connector_detect(struct drm_connector *connector, bool force);
void tegra_output_connector_destroy(struct drm_connector *connector); void tegra_output_connector_destroy(struct drm_connector *connector);
void tegra_output_encoder_destroy(struct drm_encoder *encoder);
/* from dpaux.c */ /* from dpaux.c */
struct drm_dp_aux *drm_dp_aux_find_by_of_node(struct device_node *np); struct drm_dp_aux *drm_dp_aux_find_by_of_node(struct device_node *np);
enum drm_connector_status drm_dp_aux_detect(struct drm_dp_aux *aux); enum drm_connector_status drm_dp_aux_detect(struct drm_dp_aux *aux);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <drm/drm_file.h> #include <drm/drm_file.h>
#include <drm/drm_mipi_dsi.h> #include <drm/drm_mipi_dsi.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_simple_kms_helper.h>
#include "dc.h" #include "dc.h"
#include "drm.h" #include "drm.h"
...@@ -815,10 +816,6 @@ static const struct drm_connector_helper_funcs tegra_dsi_connector_helper_funcs ...@@ -815,10 +816,6 @@ static const struct drm_connector_helper_funcs tegra_dsi_connector_helper_funcs
.mode_valid = tegra_dsi_connector_mode_valid, .mode_valid = tegra_dsi_connector_mode_valid,
}; };
static const struct drm_encoder_funcs tegra_dsi_encoder_funcs = {
.destroy = tegra_output_encoder_destroy,
};
static void tegra_dsi_unprepare(struct tegra_dsi *dsi) static void tegra_dsi_unprepare(struct tegra_dsi *dsi)
{ {
int err; int err;
...@@ -1049,9 +1046,8 @@ static int tegra_dsi_init(struct host1x_client *client) ...@@ -1049,9 +1046,8 @@ static int tegra_dsi_init(struct host1x_client *client)
&tegra_dsi_connector_helper_funcs); &tegra_dsi_connector_helper_funcs);
dsi->output.connector.dpms = DRM_MODE_DPMS_OFF; dsi->output.connector.dpms = DRM_MODE_DPMS_OFF;
drm_encoder_init(drm, &dsi->output.encoder, drm_simple_encoder_init(drm, &dsi->output.encoder,
&tegra_dsi_encoder_funcs, DRM_MODE_ENCODER_DSI);
DRM_MODE_ENCODER_DSI, NULL);
drm_encoder_helper_add(&dsi->output.encoder, drm_encoder_helper_add(&dsi->output.encoder,
&tegra_dsi_encoder_helper_funcs); &tegra_dsi_encoder_helper_funcs);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <drm/drm_file.h> #include <drm/drm_file.h>
#include <drm/drm_fourcc.h> #include <drm/drm_fourcc.h>
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include "hda.h" #include "hda.h"
#include "hdmi.h" #include "hdmi.h"
...@@ -1127,10 +1128,6 @@ tegra_hdmi_connector_helper_funcs = { ...@@ -1127,10 +1128,6 @@ tegra_hdmi_connector_helper_funcs = {
.mode_valid = tegra_hdmi_connector_mode_valid, .mode_valid = tegra_hdmi_connector_mode_valid,
}; };
static const struct drm_encoder_funcs tegra_hdmi_encoder_funcs = {
.destroy = tegra_output_encoder_destroy,
};
static void tegra_hdmi_encoder_disable(struct drm_encoder *encoder) static void tegra_hdmi_encoder_disable(struct drm_encoder *encoder)
{ {
struct tegra_output *output = encoder_to_output(encoder); struct tegra_output *output = encoder_to_output(encoder);
...@@ -1436,8 +1433,8 @@ static int tegra_hdmi_init(struct host1x_client *client) ...@@ -1436,8 +1433,8 @@ static int tegra_hdmi_init(struct host1x_client *client)
&tegra_hdmi_connector_helper_funcs); &tegra_hdmi_connector_helper_funcs);
hdmi->output.connector.dpms = DRM_MODE_DPMS_OFF; hdmi->output.connector.dpms = DRM_MODE_DPMS_OFF;
drm_encoder_init(drm, &hdmi->output.encoder, &tegra_hdmi_encoder_funcs, drm_simple_encoder_init(drm, &hdmi->output.encoder,
DRM_MODE_ENCODER_TMDS, NULL); DRM_MODE_ENCODER_TMDS);
drm_encoder_helper_add(&hdmi->output.encoder, drm_encoder_helper_add(&hdmi->output.encoder,
&tegra_hdmi_encoder_helper_funcs); &tegra_hdmi_encoder_helper_funcs);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_simple_kms_helper.h>
#include "drm.h" #include "drm.h"
#include "dc.h" #include "dc.h"
...@@ -79,11 +80,6 @@ void tegra_output_connector_destroy(struct drm_connector *connector) ...@@ -79,11 +80,6 @@ void tegra_output_connector_destroy(struct drm_connector *connector)
drm_connector_cleanup(connector); drm_connector_cleanup(connector);
} }
void tegra_output_encoder_destroy(struct drm_encoder *encoder)
{
drm_encoder_cleanup(encoder);
}
static irqreturn_t hpd_irq(int irq, void *data) static irqreturn_t hpd_irq(int irq, void *data)
{ {
struct tegra_output *output = data; struct tegra_output *output = data;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_simple_kms_helper.h>
#include "drm.h" #include "drm.h"
#include "dc.h" #include "dc.h"
...@@ -110,10 +111,6 @@ static const struct drm_connector_helper_funcs tegra_rgb_connector_helper_funcs ...@@ -110,10 +111,6 @@ static const struct drm_connector_helper_funcs tegra_rgb_connector_helper_funcs
.mode_valid = tegra_rgb_connector_mode_valid, .mode_valid = tegra_rgb_connector_mode_valid,
}; };
static const struct drm_encoder_funcs tegra_rgb_encoder_funcs = {
.destroy = tegra_output_encoder_destroy,
};
static void tegra_rgb_encoder_disable(struct drm_encoder *encoder) static void tegra_rgb_encoder_disable(struct drm_encoder *encoder)
{ {
struct tegra_output *output = encoder_to_output(encoder); struct tegra_output *output = encoder_to_output(encoder);
...@@ -281,8 +278,7 @@ int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc) ...@@ -281,8 +278,7 @@ int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc)
&tegra_rgb_connector_helper_funcs); &tegra_rgb_connector_helper_funcs);
output->connector.dpms = DRM_MODE_DPMS_OFF; output->connector.dpms = DRM_MODE_DPMS_OFF;
drm_encoder_init(drm, &output->encoder, &tegra_rgb_encoder_funcs, drm_simple_encoder_init(drm, &output->encoder, DRM_MODE_ENCODER_LVDS);
DRM_MODE_ENCODER_LVDS, NULL);
drm_encoder_helper_add(&output->encoder, drm_encoder_helper_add(&output->encoder,
&tegra_rgb_encoder_helper_funcs); &tegra_rgb_encoder_helper_funcs);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <drm/drm_file.h> #include <drm/drm_file.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
#include <drm/drm_scdc_helper.h> #include <drm/drm_scdc_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include "dc.h" #include "dc.h"
#include "dp.h" #include "dp.h"
...@@ -1796,10 +1797,6 @@ static const struct drm_connector_helper_funcs tegra_sor_connector_helper_funcs ...@@ -1796,10 +1797,6 @@ static const struct drm_connector_helper_funcs tegra_sor_connector_helper_funcs
.mode_valid = tegra_sor_connector_mode_valid, .mode_valid = tegra_sor_connector_mode_valid,
}; };
static const struct drm_encoder_funcs tegra_sor_encoder_funcs = {
.destroy = tegra_output_encoder_destroy,
};
static int static int
tegra_sor_encoder_atomic_check(struct drm_encoder *encoder, tegra_sor_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state, struct drm_crtc_state *crtc_state,
...@@ -3093,8 +3090,7 @@ static int tegra_sor_init(struct host1x_client *client) ...@@ -3093,8 +3090,7 @@ static int tegra_sor_init(struct host1x_client *client)
&tegra_sor_connector_helper_funcs); &tegra_sor_connector_helper_funcs);
sor->output.connector.dpms = DRM_MODE_DPMS_OFF; sor->output.connector.dpms = DRM_MODE_DPMS_OFF;
drm_encoder_init(drm, &sor->output.encoder, &tegra_sor_encoder_funcs, drm_simple_encoder_init(drm, &sor->output.encoder, encoder);
encoder, NULL);
drm_encoder_helper_add(&sor->output.encoder, helpers); drm_encoder_helper_add(&sor->output.encoder, helpers);
drm_connector_attach_encoder(&sor->output.connector, drm_connector_attach_encoder(&sor->output.connector,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment