Lines Matching full:bridge
40 * A bridge is always attached to a single &drm_encoder at a time, but can be
41 * either connected to it directly, or through an intermediate bridge::
43 * encoder ---> bridge B ---> bridge A
45 * Here, the output of the encoder feeds to bridge B, and that furthers feeds to
46 * bridge A.
48 * The driver using the bridge is responsible to make the associations between
67 * drm_bridge_add - add the given bridge to the global bridge list
69 * @bridge: bridge control structure
71 void drm_bridge_add(struct drm_bridge *bridge) in drm_bridge_add() argument
74 list_add_tail(&bridge->list, &bridge_list); in drm_bridge_add()
80 * drm_bridge_remove - remove the given bridge from the global bridge list
82 * @bridge: bridge control structure
84 void drm_bridge_remove(struct drm_bridge *bridge) in drm_bridge_remove() argument
87 list_del_init(&bridge->list); in drm_bridge_remove()
93 * drm_bridge_attach - attach the bridge to an encoder's chain
96 * @bridge: bridge to attach
97 * @previous: previous bridge in the chain (optional)
99 * Called by a kms driver to link the bridge to an encoder's chain. The previous
100 * argument specifies the previous bridge in the chain. If NULL, the bridge is
102 * previous bridge's output.
104 * If non-NULL the previous bridge must be already attached by a call to this
110 int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, in drm_bridge_attach() argument
115 if (!encoder || !bridge) in drm_bridge_attach()
121 if (bridge->dev) in drm_bridge_attach()
124 bridge->dev = encoder->dev; in drm_bridge_attach()
125 bridge->encoder = encoder; in drm_bridge_attach()
127 if (bridge->funcs->attach) { in drm_bridge_attach()
128 ret = bridge->funcs->attach(bridge); in drm_bridge_attach()
130 bridge->dev = NULL; in drm_bridge_attach()
131 bridge->encoder = NULL; in drm_bridge_attach()
137 previous->next = bridge; in drm_bridge_attach()
139 encoder->bridge = bridge; in drm_bridge_attach()
145 void drm_bridge_detach(struct drm_bridge *bridge) in drm_bridge_detach() argument
147 if (WARN_ON(!bridge)) in drm_bridge_detach()
150 if (WARN_ON(!bridge->dev)) in drm_bridge_detach()
153 if (bridge->funcs->detach) in drm_bridge_detach()
154 bridge->funcs->detach(bridge); in drm_bridge_detach()
156 bridge->dev = NULL; in drm_bridge_detach()
160 * DOC: bridge callbacks
162 * The &drm_bridge_funcs ops are populated by the bridge driver. The DRM
167 * For detailed specification of the bridge callbacks see &drm_bridge_funcs.
173 * @bridge: bridge control structure
174 * @mode: desired mode to be set for the bridge
175 * @adjusted_mode: updated mode that works for this bridge
178 * encoder chain, starting from the first bridge to the last.
180 * Note: the bridge passed should be the one closest to the encoder
185 bool drm_bridge_mode_fixup(struct drm_bridge *bridge, in drm_bridge_mode_fixup() argument
191 if (!bridge) in drm_bridge_mode_fixup()
194 if (bridge->funcs->mode_fixup) in drm_bridge_mode_fixup()
195 ret = bridge->funcs->mode_fixup(bridge, mode, adjusted_mode); in drm_bridge_mode_fixup()
197 ret = ret && drm_bridge_mode_fixup(bridge->next, mode, adjusted_mode); in drm_bridge_mode_fixup()
206 * @bridge: bridge control structure
210 * chain, starting from the first bridge to the last. If at least one bridge
213 * Note: the bridge passed should be the one closest to the encoder.
218 enum drm_mode_status drm_bridge_mode_valid(struct drm_bridge *bridge, in drm_bridge_mode_valid() argument
223 if (!bridge) in drm_bridge_mode_valid()
226 if (bridge->funcs->mode_valid) in drm_bridge_mode_valid()
227 ret = bridge->funcs->mode_valid(bridge, mode); in drm_bridge_mode_valid()
232 return drm_bridge_mode_valid(bridge->next, mode); in drm_bridge_mode_valid()
238 * @bridge: bridge control structure
241 * chain, starting from the last bridge to the first. These are called before
244 * Note: the bridge passed should be the one closest to the encoder
246 void drm_bridge_disable(struct drm_bridge *bridge) in drm_bridge_disable() argument
248 if (!bridge) in drm_bridge_disable()
251 drm_bridge_disable(bridge->next); in drm_bridge_disable()
253 if (bridge->funcs->disable) in drm_bridge_disable()
254 bridge->funcs->disable(bridge); in drm_bridge_disable()
260 * @bridge: bridge control structure
263 * encoder chain, starting from the first bridge to the last. These are called
266 * Note: the bridge passed should be the one closest to the encoder
268 void drm_bridge_post_disable(struct drm_bridge *bridge) in drm_bridge_post_disable() argument
270 if (!bridge) in drm_bridge_post_disable()
273 if (bridge->funcs->post_disable) in drm_bridge_post_disable()
274 bridge->funcs->post_disable(bridge); in drm_bridge_post_disable()
276 drm_bridge_post_disable(bridge->next); in drm_bridge_post_disable()
283 * @bridge: bridge control structure
284 * @mode: desired mode to be set for the bridge
285 * @adjusted_mode: updated mode that works for this bridge
288 * encoder chain, starting from the first bridge to the last.
290 * Note: the bridge passed should be the one closest to the encoder
292 void drm_bridge_mode_set(struct drm_bridge *bridge, in drm_bridge_mode_set() argument
296 if (!bridge) in drm_bridge_mode_set()
299 if (bridge->funcs->mode_set) in drm_bridge_mode_set()
300 bridge->funcs->mode_set(bridge, mode, adjusted_mode); in drm_bridge_mode_set()
302 drm_bridge_mode_set(bridge->next, mode, adjusted_mode); in drm_bridge_mode_set()
309 * @bridge: bridge control structure
312 * chain, starting from the last bridge to the first. These are called
315 * Note: the bridge passed should be the one closest to the encoder
317 void drm_bridge_pre_enable(struct drm_bridge *bridge) in drm_bridge_pre_enable() argument
319 if (!bridge) in drm_bridge_pre_enable()
322 drm_bridge_pre_enable(bridge->next); in drm_bridge_pre_enable()
324 if (bridge->funcs->pre_enable) in drm_bridge_pre_enable()
325 bridge->funcs->pre_enable(bridge); in drm_bridge_pre_enable()
331 * @bridge: bridge control structure
334 * chain, starting from the first bridge to the last. These are called
337 * Note that the bridge passed should be the one closest to the encoder
339 void drm_bridge_enable(struct drm_bridge *bridge) in drm_bridge_enable() argument
341 if (!bridge) in drm_bridge_enable()
344 if (bridge->funcs->enable) in drm_bridge_enable()
345 bridge->funcs->enable(bridge); in drm_bridge_enable()
347 drm_bridge_enable(bridge->next); in drm_bridge_enable()
353 * of_drm_find_bridge - find the bridge corresponding to the device node in
354 * the global bridge list
363 struct drm_bridge *bridge; in of_drm_find_bridge() local
367 list_for_each_entry(bridge, &bridge_list, list) { in of_drm_find_bridge()
368 if (bridge->of_node == np) { in of_drm_find_bridge()
370 return bridge; in of_drm_find_bridge()
381 MODULE_DESCRIPTION("DRM bridge infrastructure");