drivers/gpu/drm/amd/display/dc/link/link_factory.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/link_factory.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/link_factory.c- Extension
.c- Size
- 35604 bytes
- Lines
- 1004
- 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.
- 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
link_factory.hlink_detection.hlink_resource.hlink_validation.hlink_dpms.haccessories/link_dp_cts.haccessories/link_dp_trace.hprotocols/link_ddc.hprotocols/link_dp_capability.hprotocols/link_dp_dpia_bw.hprotocols/link_dp_dpia.hprotocols/link_dp_irq_handler.hprotocols/link_dp_phy.hprotocols/link_dp_training.hprotocols/link_edp_panel_control.hprotocols/link_dp_panel_replay.hprotocols/link_hdmi_frl.hprotocols/link_hpd.hgpio_service_interface.hatomfirmware.h
Detected Declarations
function filesfunction construct_link_service_detectionfunction construct_link_service_resourcefunction construct_link_service_validationfunction construct_link_service_dpmsfunction construct_link_service_ddcfunction construct_link_service_dp_capabilityfunction construct_link_service_dp_phy_or_dpiafunction construct_link_service_dp_irq_handlerfunction construct_link_service_edp_panel_controlfunction construct_link_service_dp_panel_replayfunction construct_link_service_hdmi_frlfunction construct_link_service_dp_ctsfunction construct_link_service_dp_tracefunction construct_link_servicefunction link_destroy_link_servicefunction translate_encoder_to_transmitterfunction encoder_is_external_dpfunction link_destructfunction get_ddc_linefunction find_analog_enginefunction analog_engine_supportedfunction construct_phyfunction construct_dpiafunction link_constructfunction link_destroy
Annotated Snippet
switch (encoder.enum_id) {
case ENUM_ID_1:
return TRANSMITTER_UNIPHY_A;
case ENUM_ID_2:
return TRANSMITTER_UNIPHY_B;
default:
return TRANSMITTER_UNKNOWN;
}
break;
case ENCODER_ID_INTERNAL_UNIPHY1:
switch (encoder.enum_id) {
case ENUM_ID_1:
return TRANSMITTER_UNIPHY_C;
case ENUM_ID_2:
return TRANSMITTER_UNIPHY_D;
default:
return TRANSMITTER_UNKNOWN;
}
break;
case ENCODER_ID_INTERNAL_UNIPHY2:
switch (encoder.enum_id) {
case ENUM_ID_1:
return TRANSMITTER_UNIPHY_E;
case ENUM_ID_2:
return TRANSMITTER_UNIPHY_F;
default:
return TRANSMITTER_UNKNOWN;
}
break;
case ENCODER_ID_INTERNAL_UNIPHY3:
switch (encoder.enum_id) {
case ENUM_ID_1:
return TRANSMITTER_UNIPHY_G;
default:
return TRANSMITTER_UNKNOWN;
}
break;
default:
return TRANSMITTER_UNKNOWN;
}
}
static bool encoder_is_external_dp(
struct graphics_object_id encoder)
{
switch (encoder.id) {
case ENCODER_ID_EXTERNAL_NUTMEG:
case ENCODER_ID_EXTERNAL_TRAVIS:
return true;
default:
return false;
}
}
static void link_destruct(struct dc_link *link)
{
unsigned int i;
if (link->ddc)
link_destroy_ddc_service(&link->ddc);
if (link->panel_cntl)
link->panel_cntl->funcs->destroy(&link->panel_cntl);
if (link->link_enc && !link->is_dig_mapping_flexible) {
/* Update link encoder resource tracking variables. These are used for
* the dynamic assignment of link encoders to streams. Virtual links
* are not assigned encoder resources on creation.
*/
if (link->link_id.id != CONNECTOR_ID_VIRTUAL && link->eng_id != ENGINE_ID_UNKNOWN) {
link->dc->res_pool->link_encoders[link->eng_id - ENGINE_ID_DIGA] = NULL;
link->dc->res_pool->dig_link_enc_count--;
}
link->link_enc->funcs->destroy(&link->link_enc);
}
if (link->hpo_frl_link_enc)
link->hpo_frl_link_enc->funcs->destroy(&link->hpo_frl_link_enc);
if (link->local_sink)
dc_sink_release(link->local_sink);
for (i = 0; i < link->sink_count; ++i)
dc_sink_release(link->remote_sinks[i]);
}
static enum channel_id get_ddc_line(struct dc_link *link)
{
struct ddc *ddc;
enum channel_id channel;
Annotation
- Immediate include surface: `link_factory.h`, `link_detection.h`, `link_resource.h`, `link_validation.h`, `link_dpms.h`, `accessories/link_dp_cts.h`, `accessories/link_dp_trace.h`, `protocols/link_ddc.h`.
- Detected declarations: `function files`, `function construct_link_service_detection`, `function construct_link_service_resource`, `function construct_link_service_validation`, `function construct_link_service_dpms`, `function construct_link_service_ddc`, `function construct_link_service_dp_capability`, `function construct_link_service_dp_phy_or_dpia`, `function construct_link_service_dp_irq_handler`, `function construct_link_service_edp_panel_control`.
- 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.