drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c- Extension
.c- Size
- 115921 bytes
- Lines
- 3924
- 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.hcore_types.hObjectID.hatomfirmware.hdc_bios_types.hinclude/grph_object_ctrl_defs.hinclude/bios_parser_interface.hinclude/logger_interface.hcommand_table2.hbios_parser_helper.hcommand_table_helper2.hbios_parser2.hbios_parser_types_internal2.hbios_parser_interface.hbios_parser_common.h
Detected Declarations
function bios_parser2_destructfunction firmware_parser_destroyfunction get_atom_data_table_revisionfunction bios_parser_get_connectors_numberfunction bios_parser_get_connector_idfunction bios_parser_get_src_objfunction bios_parser_get_i2c_infofunction get_gpio_i2c_infofunction bios_parser_get_hpd_infofunction bios_parser_get_gpio_pin_infofunction bios_parser_get_connector_aux_infofunction device_type_from_device_idfunction bios_parser_get_device_tagfunction get_ss_info_v4_1function get_ss_info_v4_2function get_ss_info_v4_5function ASIC_InternalSS_Infofunction get_soc_bb_info_v4_4function get_soc_bb_info_v4_5function bios_parser_get_soc_bb_infofunction get_disp_caps_v4_1function get_disp_caps_v4_2function get_disp_caps_v4_3function get_disp_caps_v4_4function get_disp_caps_v4_5function bios_parser_get_lttpr_interopfunction bios_parser_get_lttpr_capsfunction get_embedded_panel_info_v2_1function bios_parser_get_embedded_panel_infofunction get_support_mask_for_device_idfunction bios_parser_is_device_id_supportedfunction bios_parser_get_ss_entry_numberfunction bios_parser_transmitter_controlfunction bios_parser_encoder_controlfunction bios_parser_set_pixel_clockfunction bios_parser_set_dce_clockfunction bios_parser_program_crtc_timingfunction bios_parser_enable_crtcfunction bios_parser_enable_disp_power_gatingfunction bios_parser_enable_lvtma_controlfunction bios_parser_is_accelerated_modefunction bios_parser_set_scratch_critical_statefunction bios_parser_get_firmware_infofunction get_firmware_info_v3_1function get_firmware_info_v3_2function get_firmware_info_v3_4function get_firmware_info_v3_5function bios_parser_get_encoder_cap_info
Annotated Snippet
if (v1_4->number_of_path > i) {
/* If display_objid is generic object id, the encoderObj
* /extencoderobjId should be 0
*/
if (v1_4->display_path[i].encoderobjid != 0 &&
v1_4->display_path[i].display_objid != 0)
object_id = object_id_from_bios_object_id(
v1_4->display_path[i].display_objid);
}
break;
case 5:
if (v1_5->number_of_path > i) {
/* If display_objid is generic object id, the encoderObjId
* should be 0
*/
if (v1_5->display_path[i].encoderobjid != 0 &&
v1_5->display_path[i].display_objid != 0)
object_id = object_id_from_bios_object_id(
v1_5->display_path[i].display_objid);
}
break;
}
return object_id;
}
static enum bp_result bios_parser_get_src_obj(struct dc_bios *dcb,
struct graphics_object_id object_id, uint32_t index,
struct graphics_object_id *src_object_id)
{
(void)index;
struct bios_parser *bp = BP_FROM_DCB(dcb);
unsigned int i;
enum bp_result bp_result = BP_RESULT_BADINPUT;
struct graphics_object_id obj_id = { 0 };
struct object_info_table *tbl = &bp->object_info_tbl;
if (!src_object_id)
return bp_result;
switch (object_id.type) {
/* Encoder's Source is GPU. BIOS does not provide GPU, since all
* displaypaths point to same GPU (0x1100). Hardcode GPU object type
*/
case OBJECT_TYPE_ENCODER:
/* TODO: since num of src must be less than 2.
* If found in for loop, should break.
* DAL2 implementation may be changed too
*/
switch (bp->object_info_tbl.revision.minor) {
default:
case 4:
for (i = 0; i < tbl->v1_4->number_of_path; i++) {
obj_id = object_id_from_bios_object_id(
tbl->v1_4->display_path[i].encoderobjid);
if (object_id.type == obj_id.type &&
object_id.id == obj_id.id &&
object_id.enum_id == obj_id.enum_id) {
*src_object_id =
object_id_from_bios_object_id(
0x1100);
/* break; */
}
}
bp_result = BP_RESULT_OK;
break;
case 5:
for (i = 0; i < tbl->v1_5->number_of_path; i++) {
obj_id = object_id_from_bios_object_id(
tbl->v1_5->display_path[i].encoderobjid);
if (object_id.type == obj_id.type &&
object_id.id == obj_id.id &&
object_id.enum_id == obj_id.enum_id) {
*src_object_id =
object_id_from_bios_object_id(
0x1100);
/* break; */
}
}
bp_result = BP_RESULT_OK;
break;
}
break;
case OBJECT_TYPE_CONNECTOR:
switch (bp->object_info_tbl.revision.minor) {
default:
case 4:
for (i = 0; i < tbl->v1_4->number_of_path; i++) {
obj_id = object_id_from_bios_object_id(
Annotation
- Immediate include surface: `dm_services.h`, `core_types.h`, `ObjectID.h`, `atomfirmware.h`, `dc_bios_types.h`, `include/grph_object_ctrl_defs.h`, `include/bios_parser_interface.h`, `include/logger_interface.h`.
- Detected declarations: `function bios_parser2_destruct`, `function firmware_parser_destroy`, `function get_atom_data_table_revision`, `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 get_gpio_i2c_info`, `function bios_parser_get_hpd_info`, `function bios_parser_get_gpio_pin_info`.
- 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.