drivers/gpu/drm/drm_bridge_helper.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/drm_bridge_helper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/drm_bridge_helper.c- Extension
.c- Size
- 1524 bytes
- Lines
- 61
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_bridge_helper.hdrm/drm_modeset_lock.h
Detected Declarations
function drm_atomic_helper_reset_crtcexport drm_bridge_helper_reset_crtc
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
#include <linux/export.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_bridge_helper.h>
#include <drm/drm_modeset_lock.h>
/**
* drm_bridge_helper_reset_crtc - Reset the pipeline feeding a bridge
* @bridge: DRM bridge to reset
* @ctx: lock acquisition context
*
* Reset a @bridge pipeline. It will power-cycle all active components
* between the CRTC and connector that bridge is connected to.
*
* As it relies on drm_atomic_helper_reset_crtc(), the same limitations
* apply.
*
* Returns:
*
* 0 on success or a negative error code on failure. If the error
* returned is EDEADLK, the whole atomic sequence must be restarted.
*/
int drm_bridge_helper_reset_crtc(struct drm_bridge *bridge,
struct drm_modeset_acquire_ctx *ctx)
{
struct drm_connector *connector;
struct drm_encoder *encoder = bridge->encoder;
struct drm_device *dev = encoder->dev;
struct drm_crtc *crtc;
int ret;
ret = drm_modeset_lock(&dev->mode_config.connection_mutex, ctx);
if (ret)
return ret;
connector = drm_atomic_get_connector_for_encoder(encoder, ctx);
if (IS_ERR(connector)) {
ret = PTR_ERR(connector);
goto out;
}
if (!connector->state) {
ret = -EINVAL;
goto out;
}
crtc = connector->state->crtc;
ret = drm_atomic_helper_reset_crtc(crtc, ctx);
if (ret)
goto out;
out:
drm_modeset_unlock(&dev->mode_config.connection_mutex);
return ret;
}
EXPORT_SYMBOL(drm_bridge_helper_reset_crtc);
Annotation
- Immediate include surface: `linux/export.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_bridge.h`, `drm/drm_bridge_helper.h`, `drm/drm_modeset_lock.h`.
- Detected declarations: `function drm_atomic_helper_reset_crtc`, `export drm_bridge_helper_reset_crtc`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.