drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c- Extension
.c- Size
- 95068 bytes
- Lines
- 2404
- 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
dml2_pmo_factory.hdml2_debug.hlib_float_math.hdml2_pmo_dcn4_fams2.h
Detected Declarations
function increase_odm_combine_factorfunction increase_mpc_combine_factorfunction count_planes_with_stream_indexfunction optimize_dcc_mcache_no_odmfunction pmo_dcn4_fams2_optimize_dcc_mcachefunction convert_strategy_to_drr_variantfunction dcn4_get_num_expanded_strategiesfunction dcn4_insert_strategy_into_expanded_listfunction expand_base_strategyfunction is_variant_method_validfunction dcn4_expand_variant_strategyfunction pmo_dcn4_fams2_expand_base_pstate_strategiesfunction pmo_dcn4_fams2_initializefunction is_h_timing_divisible_byfunction is_dp_encoderfunction pmo_dcn4_fams2_init_for_vminfunction pmo_dcn4_fams2_test_for_vminfunction find_highest_odm_load_stream_indexfunction pmo_dcn4_fams2_optimize_for_vminfunction set_bit_in_bitfieldfunction is_bit_set_in_bitfieldfunction build_synchronized_timing_groupsfunction all_timings_support_vactivefunction all_timings_support_vblankfunction calc_svp_microschedulefunction all_timings_support_drrfunction all_timings_support_svpfunction dcn4_insert_into_candidate_listfunction dcn4_uclk_pstate_strategy_override_to_pstate_methodfunction pstate_method_to_uclk_pstate_strategy_overridefunction all_planes_match_methodfunction build_method_scheduling_paramsfunction is_timing_group_schedulablefunction is_config_schedulablefunction stream_matches_drr_policyfunction is_bit_set_in_bitfieldfunction validate_pstate_support_strategy_cofunctionalityfunction dcn4_get_vactive_pstate_marginfunction get_vactive_det_fill_latency_delay_usfunction build_pstate_meta_per_streamfunction build_subvp_meta_per_streamfunction pmo_dcn4_fams2_init_for_pstate_supportfunction reset_display_configurationfunction setup_planes_for_drr_by_maskfunction setup_planes_for_svp_by_maskfunction setup_planes_for_svp_drr_by_maskfunction setup_planes_for_vblank_by_maskfunction setup_planes_for_vblank_drr_by_mask
Annotated Snippet
switch (odms_calculated) {
case 1:
*odm_mode = dml2_odm_mode_bypass;
break;
case 2:
*odm_mode = dml2_odm_mode_combine_2to1;
break;
case 3:
*odm_mode = dml2_odm_mode_combine_3to1;
break;
case 4:
*odm_mode = dml2_odm_mode_combine_4to1;
break;
default:
result = false;
break;
}
}
if (result) {
if (*odm_mode == dml2_odm_mode_bypass) {
*odm_mode = dml2_odm_mode_combine_2to1;
} else if (*odm_mode == dml2_odm_mode_combine_2to1) {
*odm_mode = dml2_odm_mode_combine_3to1;
} else if (*odm_mode == dml2_odm_mode_combine_3to1) {
*odm_mode = dml2_odm_mode_combine_4to1;
} else {
result = false;
}
}
return result;
}
static bool increase_mpc_combine_factor(unsigned int *mpc_combine_factor, unsigned int limit)
{
if (*mpc_combine_factor < limit) {
(*mpc_combine_factor)++;
return true;
}
return false;
}
static int count_planes_with_stream_index(const struct dml2_display_cfg *display_cfg, unsigned int stream_index)
{
unsigned int i, count;
count = 0;
for (i = 0; i < display_cfg->num_planes; i++) {
if (display_cfg->plane_descriptors[i].stream_index == stream_index)
count++;
}
return count;
}
static bool optimize_dcc_mcache_no_odm(struct dml2_pmo_optimize_dcc_mcache_in_out *in_out,
int free_pipes)
{
struct dml2_pmo_instance *pmo = in_out->instance;
unsigned int i;
bool result = true;
for (i = 0; i < in_out->optimized_display_cfg->num_planes; i++) {
// For pipes that failed dcc mcache check, we want to increase the pipe count.
// The logic for doing this depends on how many pipes is already being used,
// and whether it's mpcc or odm combine.
if (!in_out->dcc_mcache_supported[i]) {
// For the general case of "n displays", we can only optimize streams with an ODM combine factor of 1
if (in_out->cfg_support_info->stream_support_info[in_out->optimized_display_cfg->plane_descriptors[i].stream_index].odms_used == 1) {
in_out->optimized_display_cfg->plane_descriptors[i].overrides.mpcc_combine_factor =
in_out->cfg_support_info->plane_support_info[i].dpps_used;
// For each plane that is not passing mcache validation, just add another pipe to it, up to the limit.
if (free_pipes > 0) {
if (!increase_mpc_combine_factor(&in_out->optimized_display_cfg->plane_descriptors[i].overrides.mpcc_combine_factor,
pmo->mpc_combine_limit)) {
// We've reached max pipes allocatable to a single plane, so we fail.
result = false;
break;
} else {
// Successfully added another pipe to this failing plane.
free_pipes--;
}
} else {
// No free pipes to add.
result = false;
break;
}
Annotation
- Immediate include surface: `dml2_pmo_factory.h`, `dml2_debug.h`, `lib_float_math.h`, `dml2_pmo_dcn4_fams2.h`.
- Detected declarations: `function increase_odm_combine_factor`, `function increase_mpc_combine_factor`, `function count_planes_with_stream_index`, `function optimize_dcc_mcache_no_odm`, `function pmo_dcn4_fams2_optimize_dcc_mcache`, `function convert_strategy_to_drr_variant`, `function dcn4_get_num_expanded_strategies`, `function dcn4_insert_strategy_into_expanded_list`, `function expand_base_strategy`, `function is_variant_method_valid`.
- 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.