drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c- Extension
.c- Size
- 18432 bytes
- Lines
- 619
- 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_irq_handler.hlink_dpcd.hlink_dp_training.hlink_dp_capability.hlink_edp_panel_control.hlink_dp_panel_replay.hlink/accessories/link_dp_trace.hlink/link_dpms.hdm_helpers.hlink_dp_dpia_bw.h
Detected Declarations
function filesfunction handle_hpd_irq_psr_sinkfunction handle_hpd_irq_vesa_replay_sinkfunction handle_hpd_irq_replay_sinkfunction dp_handle_link_lossfunction dp_handle_tunneling_irqfunction read_dpcd204h_on_irq_hpdfunction dp_read_hpd_rx_irq_datafunction dp_should_allow_hpd_rx_irqfunction dp_handle_hpd_rx_irq
Annotated Snippet
if (dpcd_result != DC_OK) {
DC_LOG_HW_HPD_IRQ("%s: DPCD read failed to obtain power state.\n",
__func__);
} else {
if (irq_reg_rx_power_state != DP_SET_POWER_D0)
return_code = false;
}
}
return return_code;
}
static bool handle_hpd_irq_psr_sink(struct dc_link *link)
{
union dpcd_psr_configuration psr_configuration = {0};
if (!link->psr_settings.psr_feature_enabled)
return false;
dm_helpers_dp_read_dpcd(
link->ctx,
link,
368,/*DpcdAddress_PSR_Enable_Cfg*/
&psr_configuration.raw,
sizeof(psr_configuration.raw));
if (psr_configuration.bits.ENABLE) {
unsigned char dpcdbuf[3] = {0};
union psr_error_status psr_error_status;
union psr_sink_psr_status psr_sink_psr_status;
dm_helpers_dp_read_dpcd(
link->ctx,
link,
0x2006, /*DpcdAddress_PSR_Error_Status*/
(unsigned char *) dpcdbuf,
sizeof(dpcdbuf));
/*DPCD 2006h ERROR STATUS*/
psr_error_status.raw = dpcdbuf[0];
/*DPCD 2008h SINK PANEL SELF REFRESH STATUS*/
psr_sink_psr_status.raw = dpcdbuf[2];
if (psr_error_status.bits.LINK_CRC_ERROR ||
psr_error_status.bits.RFB_STORAGE_ERROR ||
psr_error_status.bits.VSC_SDP_ERROR) {
bool allow_active;
/* Acknowledge and clear error bits */
dm_helpers_dp_write_dpcd(
link->ctx,
link,
8198,/*DpcdAddress_PSR_Error_Status*/
&psr_error_status.raw,
sizeof(psr_error_status.raw));
/* PSR error, disable and re-enable PSR */
if (link->psr_settings.psr_allow_active) {
allow_active = false;
edp_set_psr_allow_active(link, &allow_active, true, false, NULL);
allow_active = true;
edp_set_psr_allow_active(link, &allow_active, true, false, NULL);
}
return true;
} else if (psr_sink_psr_status.bits.SINK_SELF_REFRESH_STATUS ==
PSR_SINK_STATE_ACTIVE_DISPLAY_FROM_SINK_RFB){
/* No error is detect, PSR is active.
* We should return with IRQ_HPD handled without
* checking for loss of sync since PSR would have
* powered down main link.
*/
return true;
}
}
return false;
}
static void handle_hpd_irq_vesa_replay_sink(struct dc_link *link)
{
union pr_error_status pr_error_status = {0};
if (!link->replay_settings.replay_feature_enabled ||
link->replay_settings.config.replay_version != DC_VESA_PANEL_REPLAY)
return;
dm_helpers_dp_read_dpcd(
link->ctx,
link,
DP_PR_ERROR_STATUS,
Annotation
- Immediate include surface: `link_dp_irq_handler.h`, `link_dpcd.h`, `link_dp_training.h`, `link_dp_capability.h`, `link_edp_panel_control.h`, `link_dp_panel_replay.h`, `link/accessories/link_dp_trace.h`, `link/link_dpms.h`.
- Detected declarations: `function files`, `function handle_hpd_irq_psr_sink`, `function handle_hpd_irq_vesa_replay_sink`, `function handle_hpd_irq_replay_sink`, `function dp_handle_link_loss`, `function dp_handle_tunneling_irq`, `function read_dpcd204h_on_irq_hpd`, `function dp_read_hpd_rx_irq_data`, `function dp_should_allow_hpd_rx_irq`, `function dp_handle_hpd_rx_irq`.
- 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.