drivers/gpu/drm/display/drm_dp_helper.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/display/drm_dp_helper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/display/drm_dp_helper.c- Extension
.c- Size
- 143006 bytes
- Lines
- 4903
- 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/backlight.hlinux/delay.hlinux/dynamic_debug.hlinux/errno.hlinux/export.hlinux/i2c.hlinux/init.hlinux/iopoll.hlinux/kernel.hlinux/minmax.hlinux/module.hlinux/sched.hlinux/seq_file.hlinux/string_helpers.hdrm/display/drm_dp_helper.hdrm/display/drm_dp_mst_helper.hdrm/drm_edid.hdrm/drm_fixed.hdrm/drm_print.hdrm/drm_vblank.hdrm/drm_panel.hdrm_dp_helper_internal.h
Detected Declarations
struct dp_aux_backlightstruct dpcd_quirkfunction dp_link_statusfunction dp_get_lane_statusfunction drm_dp_channel_eq_okfunction drm_dp_clock_recovery_okfunction drm_dp_post_lt_adj_req_in_progressfunction drm_dp_get_adjust_request_voltagefunction drm_dp_get_adjust_request_pre_emphasisfunction drm_dp_get_adjust_tx_ffe_presetfunction drm_dp_128b132b_lane_channel_eq_donefunction drm_dp_128b132b_lane_symbol_lockedfunction drm_dp_128b132b_eq_interlane_align_donefunction drm_dp_128b132b_cds_interlane_align_donefunction drm_dp_128b132b_link_training_failedfunction __8b10b_clock_recovery_delay_usfunction __8b10b_channel_eq_delay_usfunction __128b132b_channel_eq_delay_usfunction __read_delayfunction drm_dp_read_clock_recovery_delayfunction drm_dp_read_channel_eq_delayfunction drm_dp_128b132b_read_aux_rd_intervalfunction drm_dp_link_train_clock_recovery_delayfunction __drm_dp_link_train_channel_eq_delayfunction drm_dp_link_train_channel_eq_delayfunction drm_dp_phy_namefunction drm_dp_lttpr_link_train_clock_recovery_delayfunction dp_lttpr_phy_capfunction drm_dp_lttpr_link_train_channel_eq_delayfunction drm_dp_lttpr_wake_timeout_setupfunction drm_dp_link_rate_to_bw_codefunction drm_dp_bw_code_to_link_ratefunction drm_dp_dump_accessfunction drm_dp_dpcd_accessfunction drm_dp_dpcd_probefunction drm_dp_dpcd_set_poweredfunction drm_dp_dpcd_set_probefunction dpcd_access_needs_probefunction drm_dp_dpcd_readfunction drm_dp_dpcd_writefunction drm_dp_dpcd_read_link_statusfunction drm_dp_dpcd_read_phy_link_statusfunction drm_dp_link_power_upfunction drm_dp_link_power_downfunction read_payload_update_statusfunction drm_dp_dpcd_write_payloadfunction drm_dp_dpcd_clear_payloadfunction drm_dp_dpcd_poll_act_handled
Annotated Snippet
struct dp_aux_backlight {
struct backlight_device *base;
struct drm_dp_aux *aux;
struct drm_edp_backlight_info info;
bool enabled;
};
/**
* DOC: dp helpers
*
* These functions contain some common logic and helpers at various abstraction
* levels to deal with Display Port sink devices and related things like DP aux
* channel transfers, EDID reading over DP aux channels, decoding certain DPCD
* blocks, ...
*/
/* Helpers for DP link training */
static u8 dp_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r)
{
return link_status[r - DP_LANE0_1_STATUS];
}
static u8 dp_get_lane_status(const u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{
int i = DP_LANE0_1_STATUS + (lane >> 1);
int s = (lane & 1) * 4;
u8 l = dp_link_status(link_status, i);
return (l >> s) & 0xf;
}
bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
int lane_count)
{
u8 lane_align;
u8 lane_status;
int lane;
lane_align = dp_link_status(link_status,
DP_LANE_ALIGN_STATUS_UPDATED);
if ((lane_align & DP_INTERLANE_ALIGN_DONE) == 0)
return false;
for (lane = 0; lane < lane_count; lane++) {
lane_status = dp_get_lane_status(link_status, lane);
if ((lane_status & DP_CHANNEL_EQ_BITS) != DP_CHANNEL_EQ_BITS)
return false;
}
return true;
}
EXPORT_SYMBOL(drm_dp_channel_eq_ok);
bool drm_dp_clock_recovery_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
int lane_count)
{
int lane;
u8 lane_status;
for (lane = 0; lane < lane_count; lane++) {
lane_status = dp_get_lane_status(link_status, lane);
if ((lane_status & DP_LANE_CR_DONE) == 0)
return false;
}
return true;
}
EXPORT_SYMBOL(drm_dp_clock_recovery_ok);
bool drm_dp_post_lt_adj_req_in_progress(const u8 link_status[DP_LINK_STATUS_SIZE])
{
u8 lane_align = dp_link_status(link_status, DP_LANE_ALIGN_STATUS_UPDATED);
return lane_align & DP_POST_LT_ADJ_REQ_IN_PROGRESS;
}
EXPORT_SYMBOL(drm_dp_post_lt_adj_req_in_progress);
u8 drm_dp_get_adjust_request_voltage(const u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{
int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
int s = ((lane & 1) ?
DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT :
DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT);
u8 l = dp_link_status(link_status, i);
return ((l >> s) & 0x3) << DP_TRAIN_VOLTAGE_SWING_SHIFT;
}
EXPORT_SYMBOL(drm_dp_get_adjust_request_voltage);
u8 drm_dp_get_adjust_request_pre_emphasis(const u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/dynamic_debug.h`, `linux/errno.h`, `linux/export.h`, `linux/i2c.h`, `linux/init.h`, `linux/iopoll.h`.
- Detected declarations: `struct dp_aux_backlight`, `struct dpcd_quirk`, `function dp_link_status`, `function dp_get_lane_status`, `function drm_dp_channel_eq_ok`, `function drm_dp_clock_recovery_ok`, `function drm_dp_post_lt_adj_req_in_progress`, `function drm_dp_get_adjust_request_voltage`, `function drm_dp_get_adjust_request_pre_emphasis`, `function drm_dp_get_adjust_tx_ffe_preset`.
- 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.