drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c- Extension
.c- Size
- 89667 bytes
- Lines
- 3081
- 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
linux/slab.hdm_services.hatom.hdc_bios_types.hinclude/gpio_service_interface.hinclude/grph_object_ctrl_defs.hinclude/bios_parser_interface.hinclude/logger_interface.hcommand_table.hbios_parser_helper.hcommand_table_helper.hbios_parser.hbios_parser_types_internal.hbios_parser_interface.hbios_parser_common.h
Detected Declarations
function bios_parser_destructfunction bios_parser_destroyfunction get_number_of_objectsfunction bios_parser_get_connectors_numberfunction bios_parser_get_connector_idfunction bios_parser_get_src_objfunction bios_parser_get_i2c_infofunction bios_parser_get_hpd_infofunction bios_parser_get_device_tag_recordfunction bios_parser_get_device_tagfunction bios_parser_get_firmware_infofunction get_firmware_info_v1_4function get_firmware_info_v2_1function get_firmware_info_v2_2function get_ss_info_v3_1function bios_parser_transmitter_controlfunction bios_parser_select_crtc_sourcefunction bios_parser_encoder_controlfunction bios_parser_external_encoder_controlfunction bios_parser_dac_load_detectionfunction bios_parser_adjust_pixel_clockfunction bios_parser_set_pixel_clockfunction bios_parser_set_dce_clockfunction bios_parser_enable_spread_spectrum_on_ppllfunction bios_parser_program_crtc_timingfunction bios_parser_program_display_engine_pllfunction bios_parser_enable_crtcfunction bios_parser_enable_disp_power_gatingfunction bios_parser_is_device_id_supportedfunction ASIC_InternalSS_Infofunction get_ss_info_from_tblfunction get_ss_info_from_internal_ss_info_tbl_V2_1function get_ss_info_from_ss_info_tablefunction bios_parser_get_embedded_panel_infofunction get_embedded_panel_extra_infofunction get_embedded_panel_info_v1_2function get_embedded_panel_info_v1_3function bios_parser_get_encoder_cap_infofunction SSidfunction get_ss_entry_number_from_ss_info_tblfunction get_ss_entry_numberfunction get_ss_entry_number_from_internal_ss_info_tbl_v2_1function get_ss_entry_number_from_internal_ss_info_tbl_V3_1function bios_parser_get_gpio_pin_infofunction get_gpio_i2c_infofunction dal_graphics_object_id_is_validfunction dal_graphics_object_id_is_equalfunction get_src_obj_list
Annotated Snippet
switch (revision.major) {
case 1:
switch (revision.minor) {
case 4:
result = get_firmware_info_v1_4(bp, info);
break;
default:
break;
}
break;
case 2:
switch (revision.minor) {
case 1:
result = get_firmware_info_v2_1(bp, info);
break;
case 2:
result = get_firmware_info_v2_2(bp, info);
break;
default:
break;
}
break;
default:
break;
}
}
return result;
}
static enum bp_result get_firmware_info_v1_4(
struct bios_parser *bp,
struct dc_firmware_info *info)
{
ATOM_FIRMWARE_INFO_V1_4 *firmware_info =
GET_IMAGE(ATOM_FIRMWARE_INFO_V1_4,
DATA_TABLES(FirmwareInfo));
if (!info)
return BP_RESULT_BADINPUT;
if (!firmware_info)
return BP_RESULT_BADBIOSTABLE;
memset(info, 0, sizeof(*info));
/* Pixel clock pll information. We need to convert from 10KHz units into
* KHz units */
info->pll_info.crystal_frequency =
le16_to_cpu(firmware_info->usReferenceClock) * 10;
info->pll_info.min_input_pxl_clk_pll_frequency =
le16_to_cpu(firmware_info->usMinPixelClockPLL_Input) * 10;
info->pll_info.max_input_pxl_clk_pll_frequency =
le16_to_cpu(firmware_info->usMaxPixelClockPLL_Input) * 10;
info->pll_info.min_output_pxl_clk_pll_frequency =
le32_to_cpu(firmware_info->ulMinPixelClockPLL_Output) * 10;
info->pll_info.max_output_pxl_clk_pll_frequency =
le32_to_cpu(firmware_info->ulMaxPixelClockPLL_Output) * 10;
info->max_pixel_clock = le16_to_cpu(firmware_info->usMaxPixelClock) * 10;
if (firmware_info->usFirmwareCapability.sbfAccess.MemoryClockSS_Support)
/* Since there is no information on the SS, report conservative
* value 3% for bandwidth calculation */
/* unit of 0.01% */
info->feature.memory_clk_ss_percentage = THREE_PERCENT_OF_10000;
if (firmware_info->usFirmwareCapability.sbfAccess.EngineClockSS_Support)
/* Since there is no information on the SS,report conservative
* value 3% for bandwidth calculation */
/* unit of 0.01% */
info->feature.engine_clk_ss_percentage = THREE_PERCENT_OF_10000;
return BP_RESULT_OK;
}
static enum bp_result get_ss_info_v3_1(
struct bios_parser *bp,
uint32_t id,
uint32_t index,
struct spread_spectrum_info *ss_info);
static enum bp_result get_firmware_info_v2_1(
struct bios_parser *bp,
struct dc_firmware_info *info)
{
ATOM_FIRMWARE_INFO_V2_1 *firmwareInfo =
GET_IMAGE(ATOM_FIRMWARE_INFO_V2_1, DATA_TABLES(FirmwareInfo));
struct spread_spectrum_info internalSS;
uint32_t index;
Annotation
- Immediate include surface: `linux/slab.h`, `dm_services.h`, `atom.h`, `dc_bios_types.h`, `include/gpio_service_interface.h`, `include/grph_object_ctrl_defs.h`, `include/bios_parser_interface.h`, `include/logger_interface.h`.
- Detected declarations: `function bios_parser_destruct`, `function bios_parser_destroy`, `function get_number_of_objects`, `function bios_parser_get_connectors_number`, `function bios_parser_get_connector_id`, `function bios_parser_get_src_obj`, `function bios_parser_get_i2c_info`, `function bios_parser_get_hpd_info`, `function bios_parser_get_device_tag_record`, `function bios_parser_get_device_tag`.
- 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.