diff options
| author | Thomas Zimmermann <[email protected]> | 2025-02-04 13:26:40 +0000 |
|---|---|---|
| committer | Thomas Zimmermann <[email protected]> | 2025-02-11 07:29:54 +0000 |
| commit | e72bbabda32e1c521180ea7e2f4f3204de38014e (patch) | |
| tree | 3ad6b60572eba11728b0d477d26353e2f1619a50 | |
| parent | drm/ast: astdp: Store mode index in connector state (diff) | |
| download | kernel-e72bbabda32e1c521180ea7e2f4f3204de38014e.tar.gz kernel-e72bbabda32e1c521180ea7e2f4f3204de38014e.zip | |
drm/ast: astdp: Validate display modes
Validate each display mode against the astdp transmitter chips. Filters
out modes that the chip does not support.
Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
| -rw-r--r-- | drivers/gpu/drm/ast/ast_dp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c index b984a0f87f85..00d07a905fd5 100644 --- a/drivers/gpu/drm/ast/ast_dp.c +++ b/drivers/gpu/drm/ast/ast_dp.c @@ -300,6 +300,19 @@ static const struct drm_encoder_funcs ast_astdp_encoder_funcs = { .destroy = drm_encoder_cleanup, }; +static enum drm_mode_status +ast_astdp_encoder_helper_mode_valid(struct drm_encoder *encoder, + const struct drm_display_mode *mode) +{ + int res; + + res = ast_astdp_get_mode_index(mode->hdisplay, mode->vdisplay); + if (res < 0) + return MODE_NOMODE; + + return MODE_OK; +} + static void ast_astdp_encoder_helper_atomic_mode_set(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state) @@ -389,6 +402,7 @@ static int ast_astdp_encoder_helper_atomic_check(struct drm_encoder *encoder, } static const struct drm_encoder_helper_funcs ast_astdp_encoder_helper_funcs = { + .mode_valid = ast_astdp_encoder_helper_mode_valid, .atomic_mode_set = ast_astdp_encoder_helper_atomic_mode_set, .atomic_enable = ast_astdp_encoder_helper_atomic_enable, .atomic_disable = ast_astdp_encoder_helper_atomic_disable, |
