drivers/gpu/drm/display/drm_dp_tunnel.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/display/drm_dp_tunnel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/display/drm_dp_tunnel.c- Extension
.c- Size
- 52471 bytes
- Lines
- 1976
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/ref_tracker.hlinux/types.hdrm/drm_atomic_state_helper.hdrm/drm_atomic.hdrm/drm_print.hdrm/display/drm_dp.hdrm/display/drm_dp_helper.hdrm/display/drm_dp_tunnel.h
Detected Declarations
struct drm_dp_tunnel_regsstruct drm_dp_tunnel_groupstruct drm_dp_tunnelstruct drm_dp_tunnel_group_statestruct drm_dp_tunnel_statestruct drm_dp_tunnel_group_statestruct drm_dp_tunnel_groupstruct drm_dp_tunnel_mgrfunction transfersfunction read_tunnel_regsfunction tunnel_regfunction tunnel_reg_drv_group_idfunction tunnel_reg_bw_granularityfunction tunnel_reg_max_dprx_ratefunction tunnel_reg_max_dprx_lane_countfunction tunnel_reg_bw_alloc_supportedfunction tunnel_reg_bw_alloc_enabledfunction tunnel_group_drv_idfunction tunnel_group_idfunction lookup_or_alloc_groupfunction free_groupfunction tunnel_getfunction free_tunnelfunction tunnel_putfunction track_tunnel_reffunction untrack_tunnel_reffunction track_tunnel_reffunction drm_dp_tunnel_getfunction add_tunnel_to_groupfunction create_tunnelfunction destroy_tunnelfunction drm_dp_tunnel_set_io_errorfunction tunnel_regs_are_validfunction tunnel_allocated_bwfunction tunnel_info_changes_are_validfunction read_and_verify_tunnel_regsfunction update_dprx_capsfunction dev_id_lenfunction get_max_dprx_bwfunction get_max_tunnel_bwfunction drm_dp_tunnel_detectfunction drm_dp_tunnel_destroyfunction check_tunnelfunction group_allocated_bwfunction for_each_tunnel_in_groupfunction group_free_bwfunction calc_group_available_bwfunction update_group_available_bw
Annotated Snippet
struct drm_dp_tunnel_regs {
u8 buf[HWEIGHT64(DPTUN_INFO_REG_MASK)];
};
struct drm_dp_tunnel_group;
struct drm_dp_tunnel {
struct drm_dp_tunnel_group *group;
struct list_head node;
struct kref kref;
struct ref_tracker *tracker;
struct drm_dp_aux *aux;
char name[8];
int bw_granularity;
int estimated_bw;
int allocated_bw;
int max_dprx_rate;
u8 max_dprx_lane_count;
u8 adapter_id;
bool bw_alloc_supported:1;
bool bw_alloc_enabled:1;
bool has_io_error:1;
bool destroyed:1;
bool pr_optimization_support:1;
};
struct drm_dp_tunnel_group_state;
struct drm_dp_tunnel_state {
struct drm_dp_tunnel_group_state *group_state;
struct drm_dp_tunnel_ref tunnel_ref;
struct list_head node;
u32 stream_mask;
int *stream_bw;
};
struct drm_dp_tunnel_group_state {
struct drm_private_state base;
struct list_head tunnel_states;
};
struct drm_dp_tunnel_group {
struct drm_private_obj base;
struct drm_dp_tunnel_mgr *mgr;
struct list_head tunnels;
/* available BW including the allocated_bw of all tunnels in the group */
int available_bw;
u8 drv_group_id;
char name[8];
bool active:1;
};
struct drm_dp_tunnel_mgr {
struct drm_device *dev;
int group_count;
struct drm_dp_tunnel_group *groups;
wait_queue_head_t bw_req_queue;
#ifdef CONFIG_DRM_DISPLAY_DP_TUNNEL_STATE_DEBUG
struct ref_tracker_dir ref_tracker;
#endif
};
/*
* The following helpers provide a way to read out the tunneling DPCD
* registers with a minimal amount of AUX transfers (1 transfer per contiguous
* range, as permitted by the 16 byte per transfer AUX limit), not accessing
* other registers to avoid any read side-effects.
*/
static int next_reg_area(int *offset)
{
*offset = find_next_bit(dptun_info_regs, 64, *offset);
return find_next_zero_bit(dptun_info_regs, 64, *offset + 1) - *offset;
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/ref_tracker.h`, `linux/types.h`, `drm/drm_atomic_state_helper.h`, `drm/drm_atomic.h`, `drm/drm_print.h`, `drm/display/drm_dp.h`, `drm/display/drm_dp_helper.h`.
- Detected declarations: `struct drm_dp_tunnel_regs`, `struct drm_dp_tunnel_group`, `struct drm_dp_tunnel`, `struct drm_dp_tunnel_group_state`, `struct drm_dp_tunnel_state`, `struct drm_dp_tunnel_group_state`, `struct drm_dp_tunnel_group`, `struct drm_dp_tunnel_mgr`, `function transfers`, `function read_tunnel_regs`.
- 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.