Skip to contentSkip to conversation

drm: bridge: Mark mode_fixup deprecated

PATCH In review Sam Ravnborg 3 participants 3 messages Jul 13, 2021 – Jul 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: bridge: Mark mode_fixup deprecated

Make it obvious that mode_fixup is deprecated and new drivers shall use atomic_check.

Cc Laurent Pinchart <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 include/drm/drm_bridge.h | 3 +++
 1 file changed, 3 insertions(+)
include/drm/drm_bridge.h +3 -0
index 46bdfa48c413..668f14234459 100644
@@ -136,6 +136,9 @@ struct drm_bridge_funcs {
 	 *
 	 * NOTE:
 	 *
+	 * This is deprecated, do not use!
+	 * New drivers shall use &drm_bridge_funcs.atomic_check.
+	 *
 	 * This function is called in the check phase of atomic modesets, which
 	 * can be aborted for any reason (including on userspace's request to
 	 * just check whether a configuration would be possible). Drivers MUST
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Sam Ravnborg

Make it obvious that mode_fixup is deprecated and new drivers shall use atomic_check.

Cc Laurent Pinchart <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 include/drm/drm_bridge.h | 3 +++
 1 file changed, 3 insertions(+)
include/drm/drm_bridge.h +0 -0
index 46bdfa48c413..668f14234459 100644

include/drm/drm_bridge.h struct drm_bridge_funcs { · line 140

Quoted 5 lines
include/drm/drm_bridge.h +2 -0
@@ -136,6 +136,9 @@ struct drm_bridge_funcs {
         *
         * NOTE:
         *
+        * This is deprecated, do not use!
+        * New drivers shall use &drm_bridge_funcs.atomic_check.

Bit a bikeshed, but in the rendered text this will be one line, I'd just merge it. Also since this is a reference within the same struct just use @atomic_check.

Now the real review: There's a pile more of these in drm_modeset_helper_vtables.h (well in crtc and encoder funcs, so only two, a small pile). Can you pls fix those up too? With that:

Quoted 7 lines
include/drm/drm_bridge.h +1 -1
+        *
         * This function is called in the check phase of atomic modesets, which
         * can be aborted for any reason (including on userspace's request to
         * just check whether a configuration would be possible). Drivers MUST
--

2.30.2

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#2 lore raw
In reply to Sam Ravnborg

Hi Sam,

Thank you for the patch.

Quoted 2 lines · Sam Ravnborg

Make it obvious that mode_fixup is deprecated and new drivers shall use atomic_check.

Could you also mark drm_bridge_chain_mode_fixup() as deprecated ?

Regarding usage of .atomic_check(), while I agree that's the way to go, we have more work to do. .mode_fixup() was created a long time ago, when we were supposed to have a single bridge at the output of the CRTC. The bridge could then instruct the CRTC to output a different mode than what the display requires. Now that we have support for multiple bridges, it's not as straightforward, and we've so far just pretended to ignore the problem. The .mode_fixup() operation is used and abused, and just telling people to use .atomic_check() will likely make things worse as that operation has access to the full atomic commit and can alter the mode of pretty much anything. We need to define clear semantics for .atomic_check() in bridges.

Quoted 26 lines
Cc Laurent Pinchart <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 include/drm/drm_bridge.h | 3 +++
 1 file changed, 3 insertions(+)
include/drm/drm_bridge.h +3 -0
index 46bdfa48c413..668f14234459 100644
@@ -136,6 +136,9 @@ struct drm_bridge_funcs {
 	 *
 	 * NOTE:
 	 *
+	 * This is deprecated, do not use!
+	 * New drivers shall use &drm_bridge_funcs.atomic_check.
+	 *
 	 * This function is called in the check phase of atomic modesets, which
 	 * can be aborted for any reason (including on userspace's request to
 	 * just check whether a configuration would be possible). Drivers MUST
Signature · 3 lines
Regards,

Laurent Pinchart