drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c- Extension
.c- Size
- 6763 bytes
- Lines
- 211
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
link_dp_phy.hlink_dpcd.hlink_dp_training.hlink_dp_capability.hclk_mgr.hresource.hlink_enc_cfg.hatomfirmware.h
Detected Declarations
function filesfunction dp_enable_link_phyfunction dp_disable_link_phyfunction is_immediate_downstreamfunction dp_set_hw_lane_settingsfunction dp_set_drive_settingsfunction dp_set_fec_readyfunction dp_set_fec_enable
Annotated Snippet
if (status == DC_OK) {
link_enc->funcs->fec_set_ready(link_enc, true);
link->fec_state = dc_link_fec_ready;
}
} else {
if (link->fec_state == dc_link_fec_ready) {
fec_config = 0;
if (link->type != dc_connection_none)
core_link_write_dpcd(link, DP_FEC_CONFIGURATION,
&fec_config, sizeof(fec_config));
link_enc->funcs->fec_set_ready(link_enc, false);
link->fec_state = dc_link_fec_not_ready;
}
}
return status;
}
void dp_set_fec_enable(struct dc_link *link, const struct link_resource *link_res, bool enable)
{
struct link_encoder *link_enc = link_res->dio_link_enc;
if (!link->dc->config.unify_link_enc_assignment)
link_enc = link_enc_cfg_get_link_enc(link);
if (link_enc == NULL || link_enc->funcs == NULL || link_enc->funcs->fec_set_enable == NULL)
return;
if (enable && dp_should_enable_fec(link)) {
if (link->fec_state == dc_link_fec_ready) {
/* According to DP spec, FEC enable sequence can first
* be transmitted anytime after 1000 LL codes have
* been transmitted on the link after link training
* completion. Using 1 lane RBR should have the maximum
* time for transmitting 1000 LL codes which is 6.173 us.
* So use 7 microseconds delay instead.
*/
udelay(7);
link_enc->funcs->fec_set_enable(link_enc, true);
link->fec_state = dc_link_fec_enabled;
}
} else {
if (link->fec_state == dc_link_fec_enabled) {
link_enc->funcs->fec_set_enable(link_enc, false);
link->fec_state = dc_link_fec_ready;
}
}
}
Annotation
- Immediate include surface: `link_dp_phy.h`, `link_dpcd.h`, `link_dp_training.h`, `link_dp_capability.h`, `clk_mgr.h`, `resource.h`, `link_enc_cfg.h`, `atomfirmware.h`.
- Detected declarations: `function files`, `function dp_enable_link_phy`, `function dp_disable_link_phy`, `function is_immediate_downstream`, `function dp_set_hw_lane_settings`, `function dp_set_drive_settings`, `function dp_set_fec_ready`, `function dp_set_fec_enable`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.