diff options
author | Maxime Ripard <maxime@cerno.tech> | 2022-08-29 16:11:50 +0300 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-09-08 16:49:13 +0300 |
commit | ec491291dc94914cf962dcd399c3e9b43b00a770 (patch) | |
tree | 88d3d1c99ad098ac9911dbaac20fc8526758ea15 /drivers/gpu/drm/sun4i | |
parent | 622113b9f11fdaeff2cc17f684fb7e4968fd8a4e (diff) | |
download | linux-ec491291dc94914cf962dcd399c3e9b43b00a770.tar.xz |
drm/sun4i: tv: Merge mode_set into atomic_enable
Our mode_set implementation can be merged into our atomic_enable
implementation to simplify things, so let's do this.
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220728-rpi-analog-tv-properties-v2-36-459522d653a7@cerno.tech
Diffstat (limited to 'drivers/gpu/drm/sun4i')
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_tv.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c index 5965a0f72fc3..74ff5ad6a8b9 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tv.c +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c @@ -352,23 +352,13 @@ static void sun4i_tv_enable(struct drm_encoder *encoder, { struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); struct sun4i_crtc *crtc = drm_crtc_to_sun4i_crtc(encoder->crtc); + struct drm_crtc_state *crtc_state = + drm_atomic_get_new_crtc_state(state, encoder->crtc); + struct drm_display_mode *mode = &crtc_state->mode; + const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode); DRM_DEBUG_DRIVER("Enabling the TV Output\n"); - sunxi_engine_apply_color_correction(crtc->engine); - - regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, - SUN4I_TVE_EN_ENABLE, - SUN4I_TVE_EN_ENABLE); -} - -static void sun4i_tv_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) -{ - struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); - const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode); - /* Enable and map the DAC to the output */ regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, SUN4I_TVE_EN_DAC_MAP_MASK, @@ -461,12 +451,17 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder, SUN4I_TVE_RESYNC_FIELD : 0)); regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); + + sunxi_engine_apply_color_correction(crtc->engine); + + regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, + SUN4I_TVE_EN_ENABLE, + SUN4I_TVE_EN_ENABLE); } static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { .atomic_disable = sun4i_tv_disable, .atomic_enable = sun4i_tv_enable, - .mode_set = sun4i_tv_mode_set, }; static int sun4i_tv_comp_get_modes(struct drm_connector *connector) |