Commit f3fdbc72 authored by Boris Brezillon's avatar Boris Brezillon

drm/bridge: Clarify the atomic enable/disable hooks semantics

The [pre_]enable/[post_]disable hooks are passed the old atomic state.
Update the doc and rename the arguments to make it clear.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191203141515.3597631-8-boris.brezillon@collabora.com
parent ac877c64
...@@ -389,7 +389,7 @@ EXPORT_SYMBOL(drm_bridge_chain_enable); ...@@ -389,7 +389,7 @@ EXPORT_SYMBOL(drm_bridge_chain_enable);
/** /**
* drm_atomic_bridge_chain_disable - disables all bridges in the encoder chain * drm_atomic_bridge_chain_disable - disables all bridges in the encoder chain
* @bridge: bridge control structure * @bridge: bridge control structure
* @state: atomic state being committed * @old_state: old atomic state
* *
* Calls &drm_bridge_funcs.atomic_disable (falls back on * Calls &drm_bridge_funcs.atomic_disable (falls back on
* &drm_bridge_funcs.disable) op for all the bridges in the encoder chain, * &drm_bridge_funcs.disable) op for all the bridges in the encoder chain,
...@@ -399,7 +399,7 @@ EXPORT_SYMBOL(drm_bridge_chain_enable); ...@@ -399,7 +399,7 @@ EXPORT_SYMBOL(drm_bridge_chain_enable);
* Note: the bridge passed should be the one closest to the encoder * Note: the bridge passed should be the one closest to the encoder
*/ */
void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge, void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge,
struct drm_atomic_state *state) struct drm_atomic_state *old_state)
{ {
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_bridge *iter; struct drm_bridge *iter;
...@@ -410,7 +410,7 @@ void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge, ...@@ -410,7 +410,7 @@ void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge,
encoder = bridge->encoder; encoder = bridge->encoder;
list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) {
if (iter->funcs->atomic_disable) if (iter->funcs->atomic_disable)
iter->funcs->atomic_disable(iter, state); iter->funcs->atomic_disable(iter, old_state);
else if (iter->funcs->disable) else if (iter->funcs->disable)
iter->funcs->disable(iter); iter->funcs->disable(iter);
...@@ -424,7 +424,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable); ...@@ -424,7 +424,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable);
* drm_atomic_bridge_chain_post_disable - cleans up after disabling all bridges * drm_atomic_bridge_chain_post_disable - cleans up after disabling all bridges
* in the encoder chain * in the encoder chain
* @bridge: bridge control structure * @bridge: bridge control structure
* @state: atomic state being committed * @old_state: old atomic state
* *
* Calls &drm_bridge_funcs.atomic_post_disable (falls back on * Calls &drm_bridge_funcs.atomic_post_disable (falls back on
* &drm_bridge_funcs.post_disable) op for all the bridges in the encoder chain, * &drm_bridge_funcs.post_disable) op for all the bridges in the encoder chain,
...@@ -434,7 +434,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable); ...@@ -434,7 +434,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable);
* Note: the bridge passed should be the one closest to the encoder * Note: the bridge passed should be the one closest to the encoder
*/ */
void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge,
struct drm_atomic_state *state) struct drm_atomic_state *old_state)
{ {
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -444,7 +444,7 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, ...@@ -444,7 +444,7 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge,
encoder = bridge->encoder; encoder = bridge->encoder;
list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) { list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) {
if (bridge->funcs->atomic_post_disable) if (bridge->funcs->atomic_post_disable)
bridge->funcs->atomic_post_disable(bridge, state); bridge->funcs->atomic_post_disable(bridge, old_state);
else if (bridge->funcs->post_disable) else if (bridge->funcs->post_disable)
bridge->funcs->post_disable(bridge); bridge->funcs->post_disable(bridge);
} }
...@@ -455,7 +455,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable); ...@@ -455,7 +455,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable);
* drm_atomic_bridge_chain_pre_enable - prepares for enabling all bridges in * drm_atomic_bridge_chain_pre_enable - prepares for enabling all bridges in
* the encoder chain * the encoder chain
* @bridge: bridge control structure * @bridge: bridge control structure
* @state: atomic state being committed * @old_state: old atomic state
* *
* Calls &drm_bridge_funcs.atomic_pre_enable (falls back on * Calls &drm_bridge_funcs.atomic_pre_enable (falls back on
* &drm_bridge_funcs.pre_enable) op for all the bridges in the encoder chain, * &drm_bridge_funcs.pre_enable) op for all the bridges in the encoder chain,
...@@ -465,7 +465,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable); ...@@ -465,7 +465,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable);
* Note: the bridge passed should be the one closest to the encoder * Note: the bridge passed should be the one closest to the encoder
*/ */
void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge, void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge,
struct drm_atomic_state *state) struct drm_atomic_state *old_state)
{ {
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_bridge *iter; struct drm_bridge *iter;
...@@ -476,7 +476,7 @@ void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge, ...@@ -476,7 +476,7 @@ void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge,
encoder = bridge->encoder; encoder = bridge->encoder;
list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) {
if (iter->funcs->atomic_pre_enable) if (iter->funcs->atomic_pre_enable)
iter->funcs->atomic_pre_enable(iter, state); iter->funcs->atomic_pre_enable(iter, old_state);
else if (iter->funcs->pre_enable) else if (iter->funcs->pre_enable)
iter->funcs->pre_enable(iter); iter->funcs->pre_enable(iter);
...@@ -489,7 +489,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_pre_enable); ...@@ -489,7 +489,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_pre_enable);
/** /**
* drm_atomic_bridge_chain_enable - enables all bridges in the encoder chain * drm_atomic_bridge_chain_enable - enables all bridges in the encoder chain
* @bridge: bridge control structure * @bridge: bridge control structure
* @state: atomic state being committed * @old_state: old atomic state
* *
* Calls &drm_bridge_funcs.atomic_enable (falls back on * Calls &drm_bridge_funcs.atomic_enable (falls back on
* &drm_bridge_funcs.enable) op for all the bridges in the encoder chain, * &drm_bridge_funcs.enable) op for all the bridges in the encoder chain,
...@@ -499,7 +499,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_pre_enable); ...@@ -499,7 +499,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_pre_enable);
* Note: the bridge passed should be the one closest to the encoder * Note: the bridge passed should be the one closest to the encoder
*/ */
void drm_atomic_bridge_chain_enable(struct drm_bridge *bridge, void drm_atomic_bridge_chain_enable(struct drm_bridge *bridge,
struct drm_atomic_state *state) struct drm_atomic_state *old_state)
{ {
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -509,7 +509,7 @@ void drm_atomic_bridge_chain_enable(struct drm_bridge *bridge, ...@@ -509,7 +509,7 @@ void drm_atomic_bridge_chain_enable(struct drm_bridge *bridge,
encoder = bridge->encoder; encoder = bridge->encoder;
list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) { list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) {
if (bridge->funcs->atomic_enable) if (bridge->funcs->atomic_enable)
bridge->funcs->atomic_enable(bridge, state); bridge->funcs->atomic_enable(bridge, old_state);
else if (bridge->funcs->enable) else if (bridge->funcs->enable)
bridge->funcs->enable(bridge); bridge->funcs->enable(bridge);
} }
......
...@@ -263,7 +263,7 @@ struct drm_bridge_funcs { ...@@ -263,7 +263,7 @@ struct drm_bridge_funcs {
* The @atomic_pre_enable callback is optional. * The @atomic_pre_enable callback is optional.
*/ */
void (*atomic_pre_enable)(struct drm_bridge *bridge, void (*atomic_pre_enable)(struct drm_bridge *bridge,
struct drm_atomic_state *state); struct drm_atomic_state *old_state);
/** /**
* @atomic_enable: * @atomic_enable:
...@@ -288,7 +288,7 @@ struct drm_bridge_funcs { ...@@ -288,7 +288,7 @@ struct drm_bridge_funcs {
* The @atomic_enable callback is optional. * The @atomic_enable callback is optional.
*/ */
void (*atomic_enable)(struct drm_bridge *bridge, void (*atomic_enable)(struct drm_bridge *bridge,
struct drm_atomic_state *state); struct drm_atomic_state *old_state);
/** /**
* @atomic_disable: * @atomic_disable:
* *
...@@ -311,7 +311,7 @@ struct drm_bridge_funcs { ...@@ -311,7 +311,7 @@ struct drm_bridge_funcs {
* The @atomic_disable callback is optional. * The @atomic_disable callback is optional.
*/ */
void (*atomic_disable)(struct drm_bridge *bridge, void (*atomic_disable)(struct drm_bridge *bridge,
struct drm_atomic_state *state); struct drm_atomic_state *old_state);
/** /**
* @atomic_post_disable: * @atomic_post_disable:
...@@ -337,7 +337,7 @@ struct drm_bridge_funcs { ...@@ -337,7 +337,7 @@ struct drm_bridge_funcs {
* The @atomic_post_disable callback is optional. * The @atomic_post_disable callback is optional.
*/ */
void (*atomic_post_disable)(struct drm_bridge *bridge, void (*atomic_post_disable)(struct drm_bridge *bridge,
struct drm_atomic_state *state); struct drm_atomic_state *old_state);
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment