Skip to content

Commit 2fc0434

Browse files
tombalinusw
authored andcommitted
drm/tidss: Fix enable/disable order
TI's OLDI and DSI encoders need to be set up before the crtc is enabled, but the DRM helpers will enable the crtc first. This causes various issues on TI platforms, like visual artifacts or crtc sync lost warnings. Thus drm_atomic_helper_commit_modeset_enables() and drm_atomic_helper_commit_modeset_disables() cannot be used, as they enable the crtc before bridges' pre-enable, and disable the crtc after bridges' post-disable. Open code the drm_atomic_helper_commit_modeset_enables() and drm_atomic_helper_commit_modeset_disables(), and first call the bridges' pre-enables, then crtc enable, then bridges' post-enable (and vice versa for disable). Signed-off-by: Tomi Valkeinen <[email protected]> Cc: [email protected] # v6.17+ Fixes: c9b1150 ("drm/atomic-helper: Re-order bridge chain pre-enable and post-disable") Reviewed-by: Aradhya Bhatia <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Tested-by: Linus Walleij <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent d1c7dc5 commit 2fc0434

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

drivers/gpu/drm/tidss/tidss_kms.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,33 @@ static void tidss_atomic_commit_tail(struct drm_atomic_state *old_state)
2626

2727
tidss_runtime_get(tidss);
2828

29-
drm_atomic_helper_commit_modeset_disables(ddev, old_state);
30-
drm_atomic_helper_commit_planes(ddev, old_state, DRM_PLANE_COMMIT_ACTIVE_ONLY);
31-
drm_atomic_helper_commit_modeset_enables(ddev, old_state);
29+
/*
30+
* TI's OLDI and DSI encoders need to be set up before the crtc is
31+
* enabled. Thus drm_atomic_helper_commit_modeset_enables() and
32+
* drm_atomic_helper_commit_modeset_disables() cannot be used here, as
33+
* they enable the crtc before bridges' pre-enable, and disable the crtc
34+
* after bridges' post-disable.
35+
*
36+
* Open code the functions here and first call the bridges' pre-enables,
37+
* then crtc enable, then bridges' post-enable (and vice versa for
38+
* disable).
39+
*/
40+
41+
drm_atomic_helper_commit_encoder_bridge_disable(ddev, old_state);
42+
drm_atomic_helper_commit_crtc_disable(ddev, old_state);
43+
drm_atomic_helper_commit_encoder_bridge_post_disable(ddev, old_state);
44+
45+
drm_atomic_helper_update_legacy_modeset_state(ddev, old_state);
46+
drm_atomic_helper_calc_timestamping_constants(old_state);
47+
drm_atomic_helper_commit_crtc_set_mode(ddev, old_state);
48+
49+
drm_atomic_helper_commit_planes(ddev, old_state,
50+
DRM_PLANE_COMMIT_ACTIVE_ONLY);
51+
52+
drm_atomic_helper_commit_encoder_bridge_pre_enable(ddev, old_state);
53+
drm_atomic_helper_commit_crtc_enable(ddev, old_state);
54+
drm_atomic_helper_commit_encoder_bridge_enable(ddev, old_state);
55+
drm_atomic_helper_commit_writebacks(ddev, old_state);
3256

3357
drm_atomic_helper_commit_hw_done(old_state);
3458
drm_atomic_helper_wait_for_flip_done(ddev, old_state);

0 commit comments

Comments
 (0)