OSDN Git Service

drm/ast: Program display mode in CRTC's atomic_enable()
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 14 Sep 2020 07:22:35 +0000 (09:22 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 16 Sep 2020 11:08:05 +0000 (13:08 +0200)
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: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200914072236.19398-4-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_mode.c

index 5b45b57..fd0127f 100644 (file)
@@ -777,16 +777,9 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc,
        return 0;
 }
 
-static void ast_crtc_helper_atomic_begin(struct drm_crtc *crtc,
-                                        struct drm_crtc_state *old_crtc_state)
-{
-       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)
+static void
+ast_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+                             struct drm_crtc_state *old_crtc_state)
 {
        struct drm_device *dev = crtc->dev;
        struct ast_private *ast = to_ast_private(dev);
@@ -796,9 +789,6 @@ static void ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
                &ast_crtc_state->vbios_mode_info;
        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_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
        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,
        ast_set_dclk_reg(ast, adjusted_mode, vbios_mode_info);
        ast_set_crtthd_reg(ast);
        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);
 }
 
@@ -845,8 +830,6 @@ ast_crtc_helper_atomic_disable(struct drm_crtc *crtc,
 
 static const struct drm_crtc_helper_funcs ast_crtc_helper_funcs = {
        .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_disable = ast_crtc_helper_atomic_disable,
 };