drivers/gpu/drm/amd/display/dc/core/dc_stream.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/core/dc_stream.c- Extension
.c- Size
- 39294 bytes
- Lines
- 1365
- 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
dm_services.hbasics/dc_common.hdc.hcore_types.hresource.hipp.htiming_generator.hdc_dmub_srv.hdc_state_priv.hdc_stream_priv.hdc_fpu.h
Detected Declarations
function filesfunction dc_stream_constructfunction dc_stream_destructfunction dc_stream_assign_stream_idfunction dc_stream_retainfunction dc_stream_freefunction dc_stream_releasefunction dc_stream_get_statusfunction program_cursor_attributesfunction dc_stream_check_cursor_attributesfunction dc_stream_set_cursor_attributesfunction dc_stream_program_cursor_attributesfunction program_cursor_positionfunction dc_stream_set_cursor_positionfunction dc_stream_program_cursor_positionfunction dc_stream_add_writebackfunction dc_stream_fc_disable_writebackfunction dc_stream_remove_writebackfunction dc_stream_get_vblank_counterfunction dc_stream_send_dp_sdpfunction dc_stream_get_scanoutposfunction dc_stream_dmdata_status_donefunction dc_stream_set_dynamic_metadatafunction dc_stream_add_dsc_to_resourcefunction dc_stream_logfunction dc_stream_get_3dlutfunction dc_stream_release_3dlut_for_streamfunction dc_stream_init_rmcm_3dlutfunction dc_stream_get_nearest_smallest_indexfunction dc_stream_get_brightness_millinits_linear_interpolationfunction dc_stream_get_refresh_hz_linear_interpolationfunction dc_stream_get_brightness_millinits_from_refreshfunction dc_stream_calculate_flickerless_refresh_ratefunction dc_stream_get_max_delta_lumin_millinitsfunction dc_stream_get_max_flickerless_instant_vtotal_deltafunction dc_stream_calculate_max_flickerless_refresh_ratefunction dc_stream_calculate_min_flickerless_refresh_ratefunction dc_stream_is_refresh_rate_range_flickerlessfunction dc_stream_get_max_flickerless_instant_vtotal_decreasefunction dc_stream_get_max_flickerless_instant_vtotal_increasefunction dc_stream_is_cursor_limit_pendingfunction dc_stream_can_clear_cursor_limit
Annotated Snippet
if (stream->timing.pixel_encoding != PIXEL_ENCODING_YCBCR422) {
switch (stream->timing.display_color_depth) {
case COLOR_DEPTH_666:
case COLOR_DEPTH_888:
break;
case COLOR_DEPTH_101010:
pix_clk = pix_clk * 10 / 8;
break;
case COLOR_DEPTH_121212:
pix_clk = pix_clk * 12 / 8;
break;
default:
break;
}
}
if (pix_clk != 0 && pix_clk < HDMI2_TMDS_MAX_PIXEL_CLOCK)
stream->signal = SIGNAL_TYPE_HDMI_TYPE_A;
if (stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420 &&
stream->timing.h_addressable > 4096)
stream->signal = SIGNAL_TYPE_HDMI_FRL;
if (stream->timing.rid != 0)
stream->signal = SIGNAL_TYPE_HDMI_FRL;
if (stream->link->frl_flags.force_frl_always ||
stream->link->frl_flags.force_frl_max
|| stream->link->frl_flags.force_frl_dsc)
stream->signal = SIGNAL_TYPE_HDMI_FRL;
}
}
bool dc_stream_construct(struct dc_stream_state *stream,
struct dc_sink *dc_sink_data)
{
uint32_t i = 0;
stream->sink = dc_sink_data;
dc_sink_retain(dc_sink_data);
stream->ctx = dc_sink_data->ctx;
stream->link = dc_sink_data->link;
stream->sink_patches = dc_sink_data->edid_caps.panel_patch;
stream->converter_disable_audio = dc_sink_data->converter_disable_audio;
stream->qs_bit = dc_sink_data->edid_caps.qs_bit;
stream->qy_bit = dc_sink_data->edid_caps.qy_bit;
/* Copy audio modes */
/* TODO - Remove this translation */
for (i = 0; i < (dc_sink_data->edid_caps.audio_mode_count); i++) {
stream->audio_info.modes[i].channel_count = dc_sink_data->edid_caps.audio_modes[i].channel_count;
stream->audio_info.modes[i].format_code = dc_sink_data->edid_caps.audio_modes[i].format_code;
stream->audio_info.modes[i].sample_rates.all = dc_sink_data->edid_caps.audio_modes[i].sample_rate;
stream->audio_info.modes[i].sample_size = dc_sink_data->edid_caps.audio_modes[i].sample_size;
}
stream->audio_info.mode_count = dc_sink_data->edid_caps.audio_mode_count;
stream->audio_info.audio_latency = dc_sink_data->edid_caps.audio_latency;
stream->audio_info.video_latency = dc_sink_data->edid_caps.video_latency;
memmove(
stream->audio_info.display_name,
dc_sink_data->edid_caps.display_name,
AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS);
stream->audio_info.manufacture_id = dc_sink_data->edid_caps.manufacturer_id;
stream->audio_info.product_id = dc_sink_data->edid_caps.product_id;
stream->audio_info.flags.all = dc_sink_data->edid_caps.speaker_flags;
if (dc_sink_data->dc_container_id != NULL) {
struct dc_container_id *dc_container_id = dc_sink_data->dc_container_id;
stream->audio_info.port_id[0] = dc_container_id->portId[0];
stream->audio_info.port_id[1] = dc_container_id->portId[1];
} else {
/* TODO - WindowDM has implemented,
other DMs need Unhardcode port_id */
stream->audio_info.port_id[0] = 0x5558859e;
stream->audio_info.port_id[1] = 0xd989449;
}
/* EDID CAP translation for HDMI 2.0 */
stream->timing.flags.LTE_340MCSC_SCRAMBLE = dc_sink_data->edid_caps.lte_340mcsc_scramble;
memset(&stream->timing.dsc_cfg, 0, sizeof(stream->timing.dsc_cfg));
stream->timing.dsc_cfg.num_slices_h = 0;
stream->timing.dsc_cfg.num_slices_v = 0;
stream->timing.dsc_cfg.bits_per_pixel = 128;
stream->timing.dsc_cfg.block_pred_enable = 1;
stream->timing.dsc_cfg.linebuf_depth = 9;
stream->timing.dsc_cfg.version_minor = 2;
stream->timing.dsc_cfg.ycbcr422_simple = 0;
update_stream_signal(stream, dc_sink_data);
Annotation
- Immediate include surface: `dm_services.h`, `basics/dc_common.h`, `dc.h`, `core_types.h`, `resource.h`, `ipp.h`, `timing_generator.h`, `dc_dmub_srv.h`.
- Detected declarations: `function files`, `function dc_stream_construct`, `function dc_stream_destruct`, `function dc_stream_assign_stream_id`, `function dc_stream_retain`, `function dc_stream_free`, `function dc_stream_release`, `function dc_stream_get_status`, `function program_cursor_attributes`, `function dc_stream_check_cursor_attributes`.
- 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.