drm bridge: drop drm_bridge_chain_mode_fixup.
Subsystems (5)
cover drm bridge: drop drm_bridge_chain_mode_fixup.
I had a few bridge related patches in an old branch.
They were last posted here almost one year ago:
https://lore.kernel.org/dri-devel/[email protected]/
The following two patches gets rid of drm_bridge_chain_mode_fixup. The patches was already rb / ab - but due to the age a repost is due before applying the patches.
Sam
---
Sam Ravnborg (2):
drm/mediatek: Drop chain_mode_fixup call in mode_valid() drm/bridge: Drop drm_bridge_chain_mode_fixup
drivers/gpu/drm/drm_bridge.c | 37 ------------------------------------- drivers/gpu/drm/mediatek/mtk_hdmi.c | 11 ----------- include/drm/drm_bridge.h | 3 --- 3 files changed, 51 deletions(-)
---
base-commit: c9402efe492bb46ccbf94fedc4783eb8f8747567
change-id: 20240531-bridge_chain_mode-9ed8528e92cd
Best regards,
Signature · 1 line
Sam Ravnborg <[email protected]>
PATCH 1/2 drm/mediatek: Drop chain_mode_fixup call in mode_valid()
The mode_valid implementation had a call to drm_bridge_chain_mode_fixup() which would be wrong as the mode_valid is not allowed to change anything - only to validate the mode.
As the next bridge is often/always a connector the call had no effect anyway. So drop it.
From the git history I could see this call was included in the original version of the driver so there was no help there to find out why it was added in the first place. But a lot has changed since the initial driver were added and is seems safe to remove the call now.
v4:
- Link to v3: https://lore.kernel.org/dri-devel/[email protected]/
- Rebase, and added acks/rb
v3:
- Link to v2: https://lore.kernel.org/dri-devel/[email protected]/
v2:
- Link to v1: https://lore.kernel.org/dri-devel/[email protected]/
--- drivers/gpu/drm/mediatek/mtk_hdmi.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/gpu/drm/mediatek/mtk_hdmi.c +0 -11
@@ -1208,22 +1208,11 @@ mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_mode *mode) {struct mtk_hdmi *hdmi =hdmi_ctx_from_bridge (bridge); -struct drm_bridge *next_bridge;dev_dbg (hdmi->dev,"xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n" , mode->hdisplay, mode->vdisplay,drm_mode_vrefresh (mode), !!(mode->flags &DRM_MODE_FLAG_INTERLACE ), mode->clock *1000 ); - next_bridge =drm_bridge_get_next_bridge (&hdmi->bridge); -if (next_bridge) { -struct drm_display_mode adjusted_mode; - -drm_mode_init (&adjusted_mode, mode); -if (!drm_bridge_chain_mode_fixup (next_bridge, mode, - &adjusted_mode)) -return MODE_BAD ; - } -if (hdmi->conf) {if (hdmi->conf->cea_modes_only && !drm_match_cea_mode (mode))return MODE_BAD ;
Signature · 1 line
2.34.1
PATCH 2/2 drm/bridge: Drop drm_bridge_chain_mode_fixup
In reply to Sam RavnborgThere are no users left of drm_bridge_chain_mode_fixup() and we do not want to have this function available, so drop it.
--- drivers/gpu/drm/drm_bridge.c | 37 ------------------------------------- include/drm/drm_bridge.h | 3 --- 2 files changed, 40 deletions(-)
drivers/gpu/drm/drm_bridge.c +0 -37
@@ -467,43 +467,6 @@ void drm_bridge_detach(struct drm_bridge *bridge)* needed, in order to gradually transition to the new model. */ -/** -* drm_bridge_chain_mode_fixup - fixup proposed mode for all bridges in the -* encoder chain -* @bridge: bridge control structure -* @mode: desired mode to be set for the bridge -* @adjusted_mode: updated mode that works for this bridge -* -* Calls &drm_bridge_funcs.mode_fixup for all the bridges in the -* encoder chain, starting from the first bridge to the last. -* -* Note: the bridge passed should be the one closest to the encoder -* -* RETURNS: -* true on success, false on failure -*/ -bool drm_bridge_chain_mode_fixup (struct drm_bridge *bridge, -const struct drm_display_mode *mode, -struct drm_display_mode *adjusted_mode) -{ -struct drm_encoder *encoder; - -if (!bridge) -return true; - - encoder = bridge->encoder; -list_for_each_entry_from (bridge, &encoder->bridge_chain, chain_node) { -if (!bridge->funcs->mode_fixup) -continue ; - -if (!bridge->funcs->mode_fixup (bridge, mode, adjusted_mode)) -return false; - } - -return true; -} -EXPORT_SYMBOL (drm_bridge_chain_mode_fixup); -/** * drm_bridge_chain_mode_valid - validate the mode against all bridges in the * encoder chain.
include/drm/drm_bridge.h +0 -3
@@ -855,9 +855,6 @@ drm_bridge_chain_get_first_bridge(struct drm_encoder *encoder)#define drm_for_each_bridge_in_chain (encoder, bridge) \ list_for_each_entry(bridge, &(encoder)->bridge_chain, chain_node) -bool drm_bridge_chain_mode_fixup (struct drm_bridge *bridge, -const struct drm_display_mode *mode, -struct drm_display_mode *adjusted_mode); enum drm_mode_status drm_bridge_chain_mode_valid(struct drm_bridge *bridge, const struct drm_display_info *info,
Signature · 1 line
2.34.1
Quoted 10 lines · Sam Ravnborg
I had a few bridge related patches in an old branch.
They were last posted here almost one year ago:
https://lore.kernel.org/dri-devel/[email protected]/The following two patches gets rid of
drm_bridge_chain_mode_fixup. The patches was already rb / ab - but due to the age a repost is due before applying the patches.[...]
Applied, thanks!
[1/2] drm/mediatek: Drop chain_mode_fixup call in mode_valid()
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=ac4be1e50165 [2/2] drm/bridge: Drop drm_bridge_chain_mode_fixup https://cgit.freedesktop.org/drm/drm-misc/commit/?id=1f0204954583
Rob
Hi Robert,
Quoted 14 lines · Robert Foss
Quoted 10 lines · Sam Ravnborg
I had a few bridge related patches in an old branch.
They were last posted here almost one year ago:
https://lore.kernel.org/dri-devel/[email protected]/The following two patches gets rid of
drm_bridge_chain_mode_fixup. The patches was already rb / ab - but due to the age a repost is due before applying the patches.[...]
Applied, thanks!
Quoted 8 lines
[1/2] drm/mediatek: Drop
chain_mode_fixupcall inmode_valid()https://cgit.freedesktop.org/drm/drm-misc/commit/?id=ac4be1e50165 [2/2] drm/bridge: Drop drm_bridge_chain_mode_fixup https://cgit.freedesktop.org/drm/drm-misc/commit/?id=1f0204954583Rob
Thanks!
Next step will be to address use of other deprecated operations in drm_bridge_funcs.
Sam