Skip to content

Commit 7b8a74b

Browse files
committed
drm/ast: Program mode for AST DP in atomic_mode_set
The CRTC's atomic_flush function contains code to program the display mode to the AST DP chip. Move the code to the encoder's atomic_mode_set callback. The DRM atomic-modesetting code invoke this callback as part of the atomic commit. v2: - fix typos in commit message Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240627153638.8765-3-tzimmermann@suse.de
1 parent 2a7e5f4 commit 7b8a74b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,6 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
11901190
struct drm_device *dev = crtc->dev;
11911191
struct ast_device *ast = to_ast_device(dev);
11921192
struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state);
1193-
struct ast_vbios_mode_info *vbios_mode_info = &ast_crtc_state->vbios_mode_info;
11941193

11951194
/*
11961195
* The gamma LUT has to be reloaded after changing the primary
@@ -1204,10 +1203,6 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
12041203
else
12051204
ast_crtc_set_gamma_linear(ast, ast_crtc_state->format);
12061205
}
1207-
1208-
//Set Aspeed Display-Port
1209-
if (ast->tx_chip_types & AST_TX_ASTDP_BIT)
1210-
ast_dp_set_mode(crtc, vbios_mode_info);
12111206
}
12121207

12131208
static void ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state)
@@ -1635,6 +1630,17 @@ static const struct drm_encoder_funcs ast_astdp_encoder_funcs = {
16351630
.destroy = drm_encoder_cleanup,
16361631
};
16371632

1633+
static void ast_astdp_encoder_helper_atomic_mode_set(struct drm_encoder *encoder,
1634+
struct drm_crtc_state *crtc_state,
1635+
struct drm_connector_state *conn_state)
1636+
{
1637+
struct drm_crtc *crtc = crtc_state->crtc;
1638+
struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state);
1639+
struct ast_vbios_mode_info *vbios_mode_info = &ast_crtc_state->vbios_mode_info;
1640+
1641+
ast_dp_set_mode(crtc, vbios_mode_info);
1642+
}
1643+
16381644
static void ast_astdp_encoder_helper_atomic_enable(struct drm_encoder *encoder,
16391645
struct drm_atomic_state *state)
16401646
{
@@ -1656,6 +1662,7 @@ static void ast_astdp_encoder_helper_atomic_disable(struct drm_encoder *encoder,
16561662
}
16571663

16581664
static const struct drm_encoder_helper_funcs ast_astdp_encoder_helper_funcs = {
1665+
.atomic_mode_set = ast_astdp_encoder_helper_atomic_mode_set,
16591666
.atomic_enable = ast_astdp_encoder_helper_atomic_enable,
16601667
.atomic_disable = ast_astdp_encoder_helper_atomic_disable,
16611668
};

0 commit comments

Comments
 (0)