drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_translation_helper.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_translation_helper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_translation_helper.c- Extension
.c- Size
- 40373 bytes
- Lines
- 1037
- 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
dml21_wrapper.hdml2_core_dcn4_calcs.hdml2_internal_shared_types.hdml2_internal_types.hdml21_utils.hdml21_translation_helper.hsoc_and_ip_translator.h
Detected Declarations
function dml21_populate_pmo_optionsfunction dml21_dcn_revision_to_dml2_project_idfunction dml21_populate_dml_init_paramsfunction calc_max_hardware_v_totalfunction populate_dml21_timing_config_from_stream_statefunction populate_dml21_output_config_from_stream_statefunction populate_dml21_stream_overrides_from_stream_statefunction gfx_addr3_to_dml2_swizzle_modefunction gfx9_to_dml2_swizzle_modefunction populate_dml21_dummy_surface_cfgfunction populate_dml21_dummy_plane_cfgfunction populate_dml21_surface_config_from_plane_statefunction populate_dml21_plane_config_from_plane_statefunction dml21_wrapper_get_plane_idfunction map_stream_to_dml21_display_cfgfunction map_plane_to_dml21_display_cfgfunction dml21_force_pstate_method_to_uclk_state_change_strategyfunction dml21_map_dc_state_into_dml_display_cfgfunction dml21_copy_clocks_to_dc_statefunction dml21_extract_watermark_setsfunction dml21_map_hw_resourcesfunction dml21_get_pipe_mcache_configfunction dml21_set_dc_p_state_typefunction dml21_init_min_clocks_for_dc_state
Annotated Snippet
if (pipe_ctx->dsc_padding_params.dsc_hactive_padding != 0) {
pix_clk_100hz = pipe_ctx->dsc_padding_params.dsc_pix_clk_100hz;
} else {
pix_clk_100hz = stream->timing.pix_clk_100hz;
}
min_hardware_refresh_in_uhz = div64_u64((pix_clk_100hz * 100000000ULL),
(timing->h_total * (long long)calc_max_hardware_v_total(stream)));
}
{
uint64_t min_refresh = max((uint64_t)stream->timing.min_refresh_in_uhz, min_hardware_refresh_in_uhz);
ASSERT(min_refresh <= ULONG_MAX);
timing->drr_config.min_refresh_uhz = (unsigned long)min_refresh;
}
if (dml_ctx->config.callbacks.get_max_flickerless_instant_vtotal_increase &&
stream->ctx->dc->config.enable_fpo_flicker_detection == 1)
timing->drr_config.max_instant_vtotal_delta = dml_ctx->config.callbacks.get_max_flickerless_instant_vtotal_increase(stream, false);
else
timing->drr_config.max_instant_vtotal_delta = 0;
if (stream->timing.flags.DSC) {
timing->dsc.enable = dml2_dsc_enable;
timing->dsc.overrides.num_slices = stream->timing.dsc_cfg.num_slices_h;
timing->dsc.dsc_compressed_bpp_x16 = stream->timing.dsc_cfg.bits_per_pixel;
} else
timing->dsc.enable = dml2_dsc_disable;
switch (stream->timing.display_color_depth) {
case COLOR_DEPTH_666:
timing->bpc = 6;
break;
case COLOR_DEPTH_888:
timing->bpc = 8;
break;
case COLOR_DEPTH_101010:
timing->bpc = 10;
break;
case COLOR_DEPTH_121212:
timing->bpc = 12;
break;
case COLOR_DEPTH_141414:
timing->bpc = 14;
break;
case COLOR_DEPTH_161616:
timing->bpc = 16;
break;
case COLOR_DEPTH_999:
timing->bpc = 9;
break;
case COLOR_DEPTH_111111:
timing->bpc = 11;
break;
default:
timing->bpc = 8;
break;
}
timing->vblank_nom = timing->v_total - timing->v_active;
}
static void populate_dml21_output_config_from_stream_state(struct dml2_link_output_cfg *output,
struct dc_stream_state *stream, const struct pipe_ctx *pipe)
{
output->output_dp_lane_count = 4;
switch (stream->signal) {
case SIGNAL_TYPE_DISPLAY_PORT_MST:
case SIGNAL_TYPE_DISPLAY_PORT:
output->output_encoder = dml2_dp;
if (check_dp2p0_output_encoder(pipe))
output->output_encoder = dml2_dp2p0;
break;
case SIGNAL_TYPE_EDP:
output->output_encoder = dml2_edp;
break;
case SIGNAL_TYPE_HDMI_TYPE_A:
case SIGNAL_TYPE_DVI_SINGLE_LINK:
case SIGNAL_TYPE_DVI_DUAL_LINK:
output->output_encoder = dml2_hdmi;
break;
case SIGNAL_TYPE_HDMI_FRL:
output->output_encoder = dml2_hdmifrl;
break;
default:
output->output_encoder = dml2_dp;
}
switch (stream->timing.pixel_encoding) {
case PIXEL_ENCODING_RGB:
Annotation
- Immediate include surface: `dml21_wrapper.h`, `dml2_core_dcn4_calcs.h`, `dml2_internal_shared_types.h`, `dml2_internal_types.h`, `dml21_utils.h`, `dml21_translation_helper.h`, `soc_and_ip_translator.h`.
- Detected declarations: `function dml21_populate_pmo_options`, `function dml21_dcn_revision_to_dml2_project_id`, `function dml21_populate_dml_init_params`, `function calc_max_hardware_v_total`, `function populate_dml21_timing_config_from_stream_state`, `function populate_dml21_output_config_from_stream_state`, `function populate_dml21_stream_overrides_from_stream_state`, `function gfx_addr3_to_dml2_swizzle_mode`, `function gfx9_to_dml2_swizzle_mode`, `function populate_dml21_dummy_surface_cfg`.
- 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.