drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c- Extension
.c- Size
- 214238 bytes
- Lines
- 3621
- 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
resource.hdm_services.hdce_calcs.hdc.hcore_types.hdal_asic_id.hcalcs_logger.h
Detected Declarations
function filesfunction calculate_bandwidthfunction bw_frc_to_fixedfunction bw_frc_to_fixedfunction bw_calcs_initfunction calculatedfunction populate_initial_datafunction all_displays_in_syncfunction bw_calcs
Annotated Snippet
switch (data->underlay_surface_type) {
case bw_def_420:
data->enable[0] = 1;
data->enable[1] = 1;
break;
default:
data->enable[0] = 1;
data->enable[1] = 0;
break;
}
}
else {
data->enable[0] = 0;
data->enable[1] = 0;
}
if (d1_underlay_enable) {
switch (data->underlay_surface_type) {
case bw_def_420:
data->enable[2] = 1;
data->enable[3] = 1;
break;
default:
data->enable[2] = 1;
data->enable[3] = 0;
break;
}
}
else {
data->enable[2] = 0;
data->enable[3] = 0;
}
data->use_alpha[0] = 0;
data->use_alpha[1] = 0;
data->use_alpha[2] = 0;
data->use_alpha[3] = 0;
data->scatter_gather_enable_for_pipe[0] = vbios->scatter_gather_enable;
data->scatter_gather_enable_for_pipe[1] = vbios->scatter_gather_enable;
data->scatter_gather_enable_for_pipe[2] = vbios->scatter_gather_enable;
data->scatter_gather_enable_for_pipe[3] = vbios->scatter_gather_enable;
/*underlay0 same and graphics display pipe0*/
data->interlace_mode[0] = data->interlace_mode[4];
data->interlace_mode[1] = data->interlace_mode[4];
/*underlay1 same and graphics display pipe1*/
data->interlace_mode[2] = data->interlace_mode[5];
data->interlace_mode[3] = data->interlace_mode[5];
/*underlay0 same and graphics display pipe0*/
data->h_total[0] = data->h_total[4];
data->v_total[0] = data->v_total[4];
data->h_total[1] = data->h_total[4];
data->v_total[1] = data->v_total[4];
/*underlay1 same and graphics display pipe1*/
data->h_total[2] = data->h_total[5];
data->v_total[2] = data->v_total[5];
data->h_total[3] = data->h_total[5];
data->v_total[3] = data->v_total[5];
/*underlay0 same and graphics display pipe0*/
data->pixel_rate[0] = data->pixel_rate[4];
data->pixel_rate[1] = data->pixel_rate[4];
/*underlay1 same and graphics display pipe1*/
data->pixel_rate[2] = data->pixel_rate[5];
data->pixel_rate[3] = data->pixel_rate[5];
if ((data->underlay_tiling_mode == bw_def_array_linear_general || data->underlay_tiling_mode == bw_def_array_linear_aligned)) {
tiling_mode[0] = bw_def_linear;
tiling_mode[1] = bw_def_linear;
tiling_mode[2] = bw_def_linear;
tiling_mode[3] = bw_def_linear;
}
else {
tiling_mode[0] = bw_def_landscape;
tiling_mode[1] = bw_def_landscape;
tiling_mode[2] = bw_def_landscape;
tiling_mode[3] = bw_def_landscape;
}
data->lb_bpc[0] = data->underlay_lb_bpc;
data->lb_bpc[1] = data->underlay_lb_bpc;
data->lb_bpc[2] = data->underlay_lb_bpc;
data->lb_bpc[3] = data->underlay_lb_bpc;
data->compression_rate[0] = bw_int_to_fixed(1);
data->compression_rate[1] = bw_int_to_fixed(1);
data->compression_rate[2] = bw_int_to_fixed(1);
data->compression_rate[3] = bw_int_to_fixed(1);
data->access_one_channel_only[0] = 0;
data->access_one_channel_only[1] = 0;
data->access_one_channel_only[2] = 0;
data->access_one_channel_only[3] = 0;
data->cursor_width_pixels[0] = bw_int_to_fixed(0);
data->cursor_width_pixels[1] = bw_int_to_fixed(0);
data->cursor_width_pixels[2] = bw_int_to_fixed(0);
data->cursor_width_pixels[3] = bw_int_to_fixed(0);
/* graphics surface parameters from spreadsheet*/
Annotation
- Immediate include surface: `resource.h`, `dm_services.h`, `dce_calcs.h`, `dc.h`, `core_types.h`, `dal_asic_id.h`, `calcs_logger.h`.
- Detected declarations: `function files`, `function calculate_bandwidth`, `function bw_frc_to_fixed`, `function bw_frc_to_fixed`, `function bw_calcs_init`, `function calculated`, `function populate_initial_data`, `function all_displays_in_sync`, `function bw_calcs`.
- 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.