mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
drm/imx: atomic phase 3 step 2: Legacy callback fixups
Now that we can use atomic configurations, all the legacy callbacks of CRTCs, encoders and connectors can be switched to the atomic version. For the imx-ldb driver, there is a clock parent setting mismatch bewteen ->enable and ->disable after the switch, so a fixup is added. For the imx-tve driver, since the encoder's callback ->dpms is replaced by ->disable, we need to move the setting for the IPU_CLK_EN bit(in register TVE_COM_CONF_REG) from ->enable/->disable to ->mode_set, otherwise, the relevant CRTC cannot be disabled correctly with a warning on DC stop timeout. Signed-off-by: Liu Ying <gnuiyl@gmail.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
parent
6b7279e13e
commit
f6e396e509
5 changed files with 27 additions and 82 deletions
|
@ -147,8 +147,7 @@ static void tve_enable(struct imx_tve *tve)
|
|||
tve->enabled = true;
|
||||
clk_prepare_enable(tve->clk);
|
||||
ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
|
||||
TVE_IPU_CLK_EN | TVE_EN,
|
||||
TVE_IPU_CLK_EN | TVE_EN);
|
||||
TVE_EN, TVE_EN);
|
||||
}
|
||||
|
||||
/* clear interrupt status register */
|
||||
|
@ -171,7 +170,7 @@ static void tve_disable(struct imx_tve *tve)
|
|||
if (tve->enabled) {
|
||||
tve->enabled = false;
|
||||
ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
|
||||
TVE_IPU_CLK_EN | TVE_EN, 0);
|
||||
TVE_EN, 0);
|
||||
clk_disable_unprepare(tve->clk);
|
||||
}
|
||||
}
|
||||
|
@ -274,18 +273,6 @@ static struct drm_encoder *imx_tve_connector_best_encoder(
|
|||
return &tve->imx_encoder.encoder;
|
||||
}
|
||||
|
||||
static void imx_tve_encoder_dpms(struct drm_encoder *encoder, int mode)
|
||||
{
|
||||
struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder);
|
||||
struct imx_tve *tve = imx_enc_to_tve(imx_encoder);
|
||||
int ret;
|
||||
|
||||
ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
|
||||
TVE_TV_OUT_MODE_MASK, TVE_TV_OUT_DISABLE);
|
||||
if (ret < 0)
|
||||
dev_err(tve->dev, "failed to disable TVOUT: %d\n", ret);
|
||||
}
|
||||
|
||||
static void imx_tve_encoder_mode_set(struct drm_encoder *encoder,
|
||||
struct drm_display_mode *orig_mode,
|
||||
struct drm_display_mode *mode)
|
||||
|
@ -315,6 +302,9 @@ static void imx_tve_encoder_mode_set(struct drm_encoder *encoder,
|
|||
ret);
|
||||
}
|
||||
|
||||
regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
|
||||
TVE_IPU_CLK_EN, TVE_IPU_CLK_EN);
|
||||
|
||||
if (tve->mode == TVE_MODE_VGA)
|
||||
ret = tve_setup_vga(tve);
|
||||
else
|
||||
|
@ -323,7 +313,7 @@ static void imx_tve_encoder_mode_set(struct drm_encoder *encoder,
|
|||
dev_err(tve->dev, "failed to set configuration: %d\n", ret);
|
||||
}
|
||||
|
||||
static void imx_tve_encoder_commit(struct drm_encoder *encoder)
|
||||
static void imx_tve_encoder_enable(struct drm_encoder *encoder)
|
||||
{
|
||||
struct imx_drm_encoder *imx_encoder = enc_to_imx_enc(encoder);
|
||||
struct imx_tve *tve = imx_enc_to_tve(imx_encoder);
|
||||
|
@ -340,7 +330,7 @@ static void imx_tve_encoder_disable(struct drm_encoder *encoder)
|
|||
}
|
||||
|
||||
static const struct drm_connector_funcs imx_tve_connector_funcs = {
|
||||
.dpms = drm_helper_connector_dpms,
|
||||
.dpms = drm_atomic_helper_connector_dpms,
|
||||
.fill_modes = drm_helper_probe_single_connector_modes,
|
||||
.detect = imx_tve_connector_detect,
|
||||
.destroy = imx_drm_connector_destroy,
|
||||
|
@ -360,9 +350,8 @@ static const struct drm_encoder_funcs imx_tve_encoder_funcs = {
|
|||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = {
|
||||
.dpms = imx_tve_encoder_dpms,
|
||||
.mode_set = imx_tve_encoder_mode_set,
|
||||
.commit = imx_tve_encoder_commit,
|
||||
.enable = imx_tve_encoder_enable,
|
||||
.disable = imx_tve_encoder_disable,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue