drivers/gpu/drm/amd/display/dc/link/link_dpms.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/link_dpms.c- Extension
.c- Size
- 86301 bytes
- Lines
- 2713
- 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_dpms.hlink_hwss.hlink_validation.haccessories/link_dp_trace.hprotocols/link_dpcd.hprotocols/link_ddc.hprotocols/link_hpd.hprotocols/link_dp_phy.hprotocols/link_dp_capability.hprotocols/link_dp_training.hprotocols/link_edp_panel_control.hprotocols/link_dp_panel_replay.hprotocols/link_dp_dpia_bw.hlink/protocols/link_hdmi_frl.hdm_helpers.hlink_enc_cfg.hresource.hdsc.hdccg.hclk_mgr.hatomfirmware.hvpg.h
Detected Declarations
function filesfunction link_blank_all_edp_displaysfunction link_blank_dp_streamfunction link_set_all_streams_dpms_off_for_linkfunction link_resumefunction is_master_pipe_for_linkfunction link_get_master_pipes_with_dpms_onfunction create_ext_hdmi_settingsfunction get_ext_hdmi_settingsfunction write_i2cfunction write_i2c_retimer_offset_valuefunction write_i2c_retimer_vgafunction write_i2c_retimer_bytefunction write_i2c_retimer_settingfunction write_i2c_default_retimer_settingfunction write_i2c_redriver_settingfunction update_psp_stream_configfunction link_wait_for_unlockedfunction set_avmutefunction enable_mst_on_sinkfunction dsc_optc_config_logfunction dp_set_dsc_on_rxfunction dp_set_hblank_reduction_on_rxfunction link_set_dsc_on_streamfunction link_set_dsc_pps_packetfunction link_set_dsc_enablefunction link_update_dsc_configfunction enable_stream_featuresfunction log_vcp_x_yfunction get_pbn_per_slotfunction get_pbn_from_bw_in_kbpsfunction get_pbn_from_timingfunction get_lane_statusfunction poll_for_allocation_change_triggerfunction update_mst_stream_alloc_tablefunction remove_stream_from_alloc_tablefunction print_mst_streamsfunction deallocate_mst_payloadfunction link_dp_get_encoding_formatfunction allocate_mst_payloadfunction link_dp_get_encoding_formatfunction link_calculate_sst_avg_time_slots_per_mtpfunction write_128b_132b_sst_payload_allocation_tablefunction update_sst_payloadfunction link_reduce_mst_payloadfunction link_dp_get_encoding_formatfunction link_increase_mst_payloadfunction link_dp_get_encoding_format
Annotated Snippet
if (fe == dc->res_pool->stream_enc[j]->id) {
dc->res_pool->stream_enc[j]->funcs->dp_blank(link,
dc->res_pool->stream_enc[j]);
break;
}
}
}
if (((!dc->is_switch_in_progress_dest) && ((!link->wa_flags.dp_keep_receiver_powered) || hw_init)) &&
(link->type != dc_connection_none))
dpcd_write_rx_power_ctrl(link, false);
}
}
void link_set_all_streams_dpms_off_for_link(struct dc_link *link)
{
struct pipe_ctx *pipes[MAX_PIPES];
struct dc_stream_state *streams[MAX_PIPES];
struct dc_state *state = link->dc->current_state;
uint8_t count;
int i;
struct dc_stream_update stream_update;
bool dpms_off = true;
struct link_resource link_res = {0};
memset(&stream_update, 0, sizeof(stream_update));
stream_update.dpms_off = &dpms_off;
link_get_master_pipes_with_dpms_on(link, state, &count, pipes);
/* The subsequent call to dc_commit_updates_for_stream for a full update
* will release the current state and swap to a new state. Releasing the
* current state results in the stream pointers in the pipe_ctx structs
* to be zero'd. Hence, cache all streams prior to dc_commit_updates_for_stream.
*/
for (i = 0; i < count; i++)
streams[i] = pipes[i]->stream;
for (i = 0; i < count; i++) {
stream_update.stream = streams[i];
dc_commit_updates_for_stream(link->ctx->dc, NULL, 0,
streams[i], &stream_update,
state);
}
/* link can be also enabled by vbios. In this case it is not recorded
* in pipe_ctx. Disable link phy here to make sure it is completely off
*/
if (dc_is_dp_signal(link->connector_signal))
dp_disable_link_phy(link, &link_res, link->connector_signal);
}
void link_resume(struct dc_link *link)
{
if (link->connector_signal != SIGNAL_TYPE_VIRTUAL)
program_hpd_filter(link);
}
/* This function returns true if the pipe is used to feed video signal directly
* to the link.
*/
static bool is_master_pipe_for_link(const struct dc_link *link,
const struct pipe_ctx *pipe)
{
return resource_is_pipe_type(pipe, OTG_MASTER) &&
pipe->stream->link == link;
}
/*
* This function finds all master pipes feeding to a given link with dpms set to
* on in given dc state.
*/
void link_get_master_pipes_with_dpms_on(const struct dc_link *link,
struct dc_state *state,
uint8_t *count,
struct pipe_ctx *pipes[MAX_PIPES])
{
int i;
struct pipe_ctx *pipe = NULL;
*count = 0;
for (i = 0; i < MAX_PIPES; i++) {
pipe = &state->res_ctx.pipe_ctx[i];
if (is_master_pipe_for_link(link, pipe) &&
pipe->stream->dpms_off == false) {
pipes[(*count)++] = pipe;
}
}
}
Annotation
- Immediate include surface: `link_dpms.h`, `link_hwss.h`, `link_validation.h`, `accessories/link_dp_trace.h`, `protocols/link_dpcd.h`, `protocols/link_ddc.h`, `protocols/link_hpd.h`, `protocols/link_dp_phy.h`.
- Detected declarations: `function files`, `function link_blank_all_edp_displays`, `function link_blank_dp_stream`, `function link_set_all_streams_dpms_off_for_link`, `function link_resume`, `function is_master_pipe_for_link`, `function link_get_master_pipes_with_dpms_on`, `function create_ext_hdmi_settings`, `function get_ext_hdmi_settings`, `function write_i2c`.
- 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.