Commit f3901b5f authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/ast: Program display mode in CRTC's atomic_enable()

This change simplifies ast's modesetting code. The display mode
is now programmed from within the CRTC's atomic_enable(), which
only runs if we actually want to program the mode.

Corresponding code in atomic_flush() is being removed. Also removed
is atomic_begin(), which serves no purpose at all.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200914072236.19398-4-tzimmermann@suse.de
parent 39edb287
...@@ -777,15 +777,8 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc, ...@@ -777,15 +777,8 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc,
return 0; return 0;
} }
static void ast_crtc_helper_atomic_begin(struct drm_crtc *crtc, static void
struct drm_crtc_state *old_crtc_state) ast_crtc_helper_atomic_enable(struct drm_crtc *crtc,
{
struct ast_private *ast = to_ast_private(crtc->dev);
ast_open_key(ast);
}
static void ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state) struct drm_crtc_state *old_crtc_state)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
...@@ -796,9 +789,6 @@ static void ast_crtc_helper_atomic_flush(struct drm_crtc *crtc, ...@@ -796,9 +789,6 @@ static void ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
&ast_crtc_state->vbios_mode_info; &ast_crtc_state->vbios_mode_info;
struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode;
if (!drm_atomic_crtc_needs_modeset(crtc_state))
return;
ast_set_vbios_mode_reg(ast, adjusted_mode, vbios_mode_info); ast_set_vbios_mode_reg(ast, adjusted_mode, vbios_mode_info);
ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06); ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
ast_set_std_reg(ast, adjusted_mode, vbios_mode_info); ast_set_std_reg(ast, adjusted_mode, vbios_mode_info);
...@@ -806,12 +796,7 @@ static void ast_crtc_helper_atomic_flush(struct drm_crtc *crtc, ...@@ -806,12 +796,7 @@ static void ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
ast_set_dclk_reg(ast, adjusted_mode, vbios_mode_info); ast_set_dclk_reg(ast, adjusted_mode, vbios_mode_info);
ast_set_crtthd_reg(ast); ast_set_crtthd_reg(ast);
ast_set_sync_reg(ast, adjusted_mode, vbios_mode_info); ast_set_sync_reg(ast, adjusted_mode, vbios_mode_info);
}
static void
ast_crtc_helper_atomic_enable(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
ast_crtc_dpms(crtc, DRM_MODE_DPMS_ON); ast_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
} }
...@@ -845,8 +830,6 @@ ast_crtc_helper_atomic_disable(struct drm_crtc *crtc, ...@@ -845,8 +830,6 @@ ast_crtc_helper_atomic_disable(struct drm_crtc *crtc,
static const struct drm_crtc_helper_funcs ast_crtc_helper_funcs = { static const struct drm_crtc_helper_funcs ast_crtc_helper_funcs = {
.atomic_check = ast_crtc_helper_atomic_check, .atomic_check = ast_crtc_helper_atomic_check,
.atomic_begin = ast_crtc_helper_atomic_begin,
.atomic_flush = ast_crtc_helper_atomic_flush,
.atomic_enable = ast_crtc_helper_atomic_enable, .atomic_enable = ast_crtc_helper_atomic_enable,
.atomic_disable = ast_crtc_helper_atomic_disable, .atomic_disable = ast_crtc_helper_atomic_disable,
}; };
......
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