mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
drm/sun4i: Remove dependency on DRM simple helpers
Simple KMS helper are deprecated since they only add an intermediate layer between drivers and the atomic modesetting. This patch removes the dependency on drm simple helpers from sun4i DRM drivers. Signed-off-by: Diogo Silva <diogompaissilva@gmail.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20260623-sun4i_simple-v1-1-fa6696df1fad@gmail.com Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
This commit is contained in:
committed by
Chen-Yu Tsai
parent
b7fcb70162
commit
34d85c43b6
@@ -24,7 +24,6 @@
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_simple_kms_helper.h>
|
||||
|
||||
#include <drm/display/drm_hdmi_helper.h>
|
||||
#include <drm/display/drm_hdmi_state_helper.h>
|
||||
@@ -172,6 +171,10 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder,
|
||||
writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
|
||||
}
|
||||
|
||||
static const struct drm_encoder_funcs sun4i_hdmi_funcs = {
|
||||
.destroy = drm_encoder_cleanup,
|
||||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs sun4i_hdmi_helper_funcs = {
|
||||
.atomic_disable = sun4i_hdmi_disable,
|
||||
.atomic_enable = sun4i_hdmi_enable,
|
||||
@@ -624,8 +627,8 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,
|
||||
|
||||
drm_encoder_helper_add(&hdmi->encoder,
|
||||
&sun4i_hdmi_helper_funcs);
|
||||
ret = drm_simple_encoder_init(drm, &hdmi->encoder,
|
||||
DRM_MODE_ENCODER_TMDS);
|
||||
ret = drm_encoder_init(drm, &hdmi->encoder, &sun4i_hdmi_funcs,
|
||||
DRM_MODE_ENCODER_TMDS, NULL);
|
||||
if (ret) {
|
||||
dev_err(dev, "Couldn't initialise the HDMI encoder\n");
|
||||
goto err_put_ddc_i2c;
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_bridge.h>
|
||||
#include <drm/drm_encoder.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_simple_kms_helper.h>
|
||||
|
||||
#include "sun4i_crtc.h"
|
||||
#include "sun4i_tcon.h"
|
||||
@@ -89,6 +89,10 @@ static void sun4i_lvds_encoder_disable(struct drm_encoder *encoder)
|
||||
}
|
||||
}
|
||||
|
||||
static const struct drm_encoder_funcs sun4i_lvds_enc_funcs = {
|
||||
.destroy = drm_encoder_cleanup,
|
||||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs sun4i_lvds_enc_helper_funcs = {
|
||||
.disable = sun4i_lvds_encoder_disable,
|
||||
.enable = sun4i_lvds_encoder_enable,
|
||||
@@ -115,8 +119,8 @@ int sun4i_lvds_init(struct drm_device *drm, struct sun4i_tcon *tcon)
|
||||
|
||||
drm_encoder_helper_add(&lvds->encoder,
|
||||
&sun4i_lvds_enc_helper_funcs);
|
||||
ret = drm_simple_encoder_init(drm, &lvds->encoder,
|
||||
DRM_MODE_ENCODER_LVDS);
|
||||
ret = drm_encoder_init(drm, &lvds->encoder, &sun4i_lvds_enc_funcs,
|
||||
DRM_MODE_ENCODER_LVDS, NULL);
|
||||
if (ret) {
|
||||
dev_err(drm->dev, "Couldn't initialise the lvds encoder\n");
|
||||
goto err_out;
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_bridge.h>
|
||||
#include <drm/drm_encoder.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_simple_kms_helper.h>
|
||||
|
||||
#include "sun4i_crtc.h"
|
||||
#include "sun4i_tcon.h"
|
||||
@@ -180,6 +180,10 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
|
||||
}
|
||||
}
|
||||
|
||||
static const struct drm_encoder_funcs sun4i_rgb_enc_funcs = {
|
||||
.destroy = drm_encoder_cleanup,
|
||||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = {
|
||||
.disable = sun4i_rgb_encoder_disable,
|
||||
.enable = sun4i_rgb_encoder_enable,
|
||||
@@ -207,8 +211,8 @@ int sun4i_rgb_init(struct drm_device *drm, struct sun4i_tcon *tcon)
|
||||
|
||||
drm_encoder_helper_add(&rgb->encoder,
|
||||
&sun4i_rgb_enc_helper_funcs);
|
||||
ret = drm_simple_encoder_init(drm, &rgb->encoder,
|
||||
DRM_MODE_ENCODER_NONE);
|
||||
ret = drm_encoder_init(drm, &rgb->encoder, &sun4i_rgb_enc_funcs,
|
||||
DRM_MODE_ENCODER_NONE, NULL);
|
||||
if (ret) {
|
||||
dev_err(drm->dev, "Couldn't initialise the rgb encoder\n");
|
||||
goto err_out;
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_encoder.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_simple_kms_helper.h>
|
||||
|
||||
#include "sun4i_crtc.h"
|
||||
#include "sun4i_drv.h"
|
||||
@@ -391,6 +391,10 @@ static void sun4i_tv_enable(struct drm_encoder *encoder,
|
||||
SUN4I_TVE_EN_ENABLE);
|
||||
}
|
||||
|
||||
static const struct drm_encoder_funcs sun4i_tv_funcs = {
|
||||
.destroy = drm_encoder_cleanup,
|
||||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = {
|
||||
.atomic_disable = sun4i_tv_disable,
|
||||
.atomic_enable = sun4i_tv_enable,
|
||||
@@ -474,8 +478,8 @@ static int sun4i_tv_bind(struct device *dev, struct device *master,
|
||||
|
||||
drm_encoder_helper_add(&tv->encoder,
|
||||
&sun4i_tv_helper_funcs);
|
||||
ret = drm_simple_encoder_init(drm, &tv->encoder,
|
||||
DRM_MODE_ENCODER_TVDAC);
|
||||
ret = drm_encoder_init(drm, &tv->encoder, &sun4i_tv_funcs,
|
||||
DRM_MODE_ENCODER_TVDAC, NULL);
|
||||
if (ret) {
|
||||
dev_err(dev, "Couldn't initialise the TV encoder\n");
|
||||
goto err_disable_clk;
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_encoder.h>
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_simple_kms_helper.h>
|
||||
|
||||
#include "sun4i_crtc.h"
|
||||
#include "sun4i_tcon.h"
|
||||
@@ -842,6 +842,10 @@ static const struct drm_connector_funcs sun6i_dsi_connector_funcs = {
|
||||
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
|
||||
};
|
||||
|
||||
static const struct drm_encoder_funcs sun6i_dsi_enc_funcs = {
|
||||
.destroy = drm_encoder_cleanup,
|
||||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs sun6i_dsi_enc_helper_funcs = {
|
||||
.disable = sun6i_dsi_encoder_disable,
|
||||
.enable = sun6i_dsi_encoder_enable,
|
||||
@@ -1056,8 +1060,8 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master,
|
||||
|
||||
drm_encoder_helper_add(&dsi->encoder,
|
||||
&sun6i_dsi_enc_helper_funcs);
|
||||
ret = drm_simple_encoder_init(drm, &dsi->encoder,
|
||||
DRM_MODE_ENCODER_DSI);
|
||||
ret = drm_encoder_init(drm, &dsi->encoder, &sun6i_dsi_enc_funcs,
|
||||
DRM_MODE_ENCODER_DSI, NULL);
|
||||
if (ret) {
|
||||
dev_err(dsi->dev, "Couldn't initialise the DSI encoder\n");
|
||||
return ret;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <drm/drm_modeset_helper_vtables.h>
|
||||
#include <drm/drm_encoder.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_simple_kms_helper.h>
|
||||
|
||||
#include "sun8i_dw_hdmi.h"
|
||||
#include "sun8i_tcon_top.h"
|
||||
@@ -23,6 +23,9 @@ static void sun8i_dw_hdmi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
|
||||
clk_set_rate(hdmi->clk_tmds, mode->crtc_clock * 1000);
|
||||
}
|
||||
static const struct drm_encoder_funcs sun8i_dw_hdmi_encoder_funcs = {
|
||||
.destroy = drm_encoder_cleanup,
|
||||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs
|
||||
sun8i_dw_hdmi_encoder_helper_funcs = {
|
||||
@@ -180,7 +183,8 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
|
||||
goto err_disable_clk_tmds;
|
||||
|
||||
drm_encoder_helper_add(encoder, &sun8i_dw_hdmi_encoder_helper_funcs);
|
||||
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
|
||||
drm_encoder_init(drm, encoder, &sun8i_dw_hdmi_encoder_funcs,
|
||||
DRM_MODE_ENCODER_TMDS, NULL);
|
||||
|
||||
plat_data->mode_valid = hdmi->quirks->mode_valid;
|
||||
plat_data->use_drm_infoframe = hdmi->quirks->use_drm_infoframe;
|
||||
|
||||
Reference in New Issue
Block a user