mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:19:34 +02:00
drm/bridge: rename drm_for_each_bridge_in_chain_scoped() to drm_for_each_bridge_in_chain()
drm_for_each_bridge_in_chain_scoped() was added in commite46efc6a7d("drm/bridge: add drm_for_each_bridge_in_chain_scoped()") to provide a safer alternative to drm_for_each_bridge_in_chain(). Following commits converted all users to the _scoped variant. Finally commit2f08387a44("drm/bridge: remove drm_for_each_bridge_in_chain()") removed the old drm_for_each_bridge_in_chain() macro. It's time to rename drm_for_each_bridge_in_chain_scoped() back to the original name. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Link: https://patch.msgid.link/20260630-drm-bridge-alloc-getput-for_each_bridge-2-v2-1-e0a1094cd1eb@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
+1
-1
@@ -167,7 +167,7 @@ ForEachMacros:
|
|||||||
- 'drm_connector_for_each_possible_encoder'
|
- 'drm_connector_for_each_possible_encoder'
|
||||||
- 'drm_exec_for_each_locked_object'
|
- 'drm_exec_for_each_locked_object'
|
||||||
- 'drm_exec_for_each_locked_object_reverse'
|
- 'drm_exec_for_each_locked_object_reverse'
|
||||||
- 'drm_for_each_bridge_in_chain_scoped'
|
- 'drm_for_each_bridge_in_chain'
|
||||||
- 'drm_for_each_connector_iter'
|
- 'drm_for_each_connector_iter'
|
||||||
- 'drm_for_each_crtc'
|
- 'drm_for_each_crtc'
|
||||||
- 'drm_for_each_crtc_reverse'
|
- 'drm_for_each_crtc_reverse'
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ static void drm_bridge_connector_hpd_notify(struct drm_connector *connector,
|
|||||||
to_drm_bridge_connector(connector);
|
to_drm_bridge_connector(connector);
|
||||||
|
|
||||||
/* Notify all bridges in the pipeline of hotplug events. */
|
/* Notify all bridges in the pipeline of hotplug events. */
|
||||||
drm_for_each_bridge_in_chain_scoped(bridge_connector->encoder, bridge) {
|
drm_for_each_bridge_in_chain(bridge_connector->encoder, bridge) {
|
||||||
if (bridge->funcs->hpd_notify)
|
if (bridge->funcs->hpd_notify)
|
||||||
bridge->funcs->hpd_notify(bridge, connector, status);
|
bridge->funcs->hpd_notify(bridge, connector, status);
|
||||||
}
|
}
|
||||||
@@ -854,7 +854,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
|
|||||||
* detection are available, we don't support hotplug detection at all.
|
* detection are available, we don't support hotplug detection at all.
|
||||||
*/
|
*/
|
||||||
connector_type = DRM_MODE_CONNECTOR_Unknown;
|
connector_type = DRM_MODE_CONNECTOR_Unknown;
|
||||||
drm_for_each_bridge_in_chain_scoped(encoder, bridge) {
|
drm_for_each_bridge_in_chain(encoder, bridge) {
|
||||||
if (!bridge->interlace_allowed)
|
if (!bridge->interlace_allowed)
|
||||||
connector->interlace_allowed = false;
|
connector->interlace_allowed = false;
|
||||||
if (!bridge->ycbcr_420_allowed)
|
if (!bridge->ycbcr_420_allowed)
|
||||||
|
|||||||
@@ -1554,7 +1554,7 @@ drm_atomic_add_encoder_bridges(struct drm_atomic_commit *state,
|
|||||||
"Adding all bridges for [encoder:%d:%s] to %p\n",
|
"Adding all bridges for [encoder:%d:%s] to %p\n",
|
||||||
encoder->base.id, encoder->name, state);
|
encoder->base.id, encoder->name, state);
|
||||||
|
|
||||||
drm_for_each_bridge_in_chain_scoped(encoder, bridge) {
|
drm_for_each_bridge_in_chain(encoder, bridge) {
|
||||||
/* Skip bridges that don't implement the atomic state hooks. */
|
/* Skip bridges that don't implement the atomic state hooks. */
|
||||||
if (!bridge->funcs->atomic_duplicate_state)
|
if (!bridge->funcs->atomic_duplicate_state)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -1817,7 +1817,7 @@ static int encoder_bridges_show(struct seq_file *m, void *data)
|
|||||||
struct drm_printer p = drm_seq_file_printer(m);
|
struct drm_printer p = drm_seq_file_printer(m);
|
||||||
unsigned int idx = 0;
|
unsigned int idx = 0;
|
||||||
|
|
||||||
drm_for_each_bridge_in_chain_scoped(encoder, bridge)
|
drm_for_each_bridge_in_chain(encoder, bridge)
|
||||||
drm_bridge_debugfs_show_bridge(&p, bridge, idx++, false, true);
|
drm_bridge_debugfs_show_bridge(&p, bridge, idx++, false, true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1071,7 +1071,7 @@ static void drm_test_bridge_chain_verify_fmt(struct kunit *test,
|
|||||||
struct drm_bridge_state *bstate;
|
struct drm_bridge_state *bstate;
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
||||||
drm_for_each_bridge_in_chain_scoped(&priv->encoder, bridge) {
|
drm_for_each_bridge_in_chain(&priv->encoder, bridge) {
|
||||||
KUNIT_ASSERT_LT(test, i, num_expected);
|
KUNIT_ASSERT_LT(test, i, num_expected);
|
||||||
|
|
||||||
bstate = drm_bridge_get_current_state(bridge);
|
bstate = drm_bridge_get_current_state(bridge);
|
||||||
|
|||||||
@@ -1474,9 +1474,9 @@ static inline struct drm_bridge *__drm_for_each_bridge_in_chain_next(struct drm_
|
|||||||
DEFINE_FREE(__drm_for_each_bridge_in_chain_cleanup, struct drm_bridge *,
|
DEFINE_FREE(__drm_for_each_bridge_in_chain_cleanup, struct drm_bridge *,
|
||||||
if (_T) { mutex_unlock(&_T->encoder->bridge_chain_mutex); drm_bridge_put(_T); })
|
if (_T) { mutex_unlock(&_T->encoder->bridge_chain_mutex); drm_bridge_put(_T); })
|
||||||
|
|
||||||
/* Internal to drm_for_each_bridge_in_chain_scoped() */
|
/* Internal to drm_for_each_bridge_in_chain() */
|
||||||
static inline struct drm_bridge *
|
static inline struct drm_bridge *
|
||||||
__drm_for_each_bridge_in_chain_scoped_start(struct drm_encoder *encoder)
|
__drm_for_each_bridge_in_chain_start(struct drm_encoder *encoder)
|
||||||
{
|
{
|
||||||
mutex_lock(&encoder->bridge_chain_mutex);
|
mutex_lock(&encoder->bridge_chain_mutex);
|
||||||
|
|
||||||
@@ -1489,8 +1489,7 @@ __drm_for_each_bridge_in_chain_scoped_start(struct drm_encoder *encoder)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_for_each_bridge_in_chain_scoped - iterate over all bridges attached
|
* drm_for_each_bridge_in_chain - iterate over all bridges attached to an encoder
|
||||||
* to an encoder
|
|
||||||
* @encoder: the encoder to iterate bridges on
|
* @encoder: the encoder to iterate bridges on
|
||||||
* @bridge: a bridge pointer updated to point to the current bridge at each
|
* @bridge: a bridge pointer updated to point to the current bridge at each
|
||||||
* iteration
|
* iteration
|
||||||
@@ -1500,9 +1499,9 @@ __drm_for_each_bridge_in_chain_scoped_start(struct drm_encoder *encoder)
|
|||||||
* Automatically gets/puts the bridge reference while iterating and locks
|
* Automatically gets/puts the bridge reference while iterating and locks
|
||||||
* the encoder chain mutex to prevent chain modifications while iterating.
|
* the encoder chain mutex to prevent chain modifications while iterating.
|
||||||
*/
|
*/
|
||||||
#define drm_for_each_bridge_in_chain_scoped(encoder, bridge) \
|
#define drm_for_each_bridge_in_chain(encoder, bridge) \
|
||||||
for (struct drm_bridge *bridge __free(__drm_for_each_bridge_in_chain_cleanup) = \
|
for (struct drm_bridge *bridge __free(__drm_for_each_bridge_in_chain_cleanup) = \
|
||||||
__drm_for_each_bridge_in_chain_scoped_start((encoder)); \
|
__drm_for_each_bridge_in_chain_start((encoder)); \
|
||||||
bridge; \
|
bridge; \
|
||||||
bridge = __drm_for_each_bridge_in_chain_next(bridge)) \
|
bridge = __drm_for_each_bridge_in_chain_next(bridge)) \
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user