drivers/gpu/drm/amd/display/dc/bios/bios_parser_common.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/bios/bios_parser_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/bios/bios_parser_common.c- Extension
.c- Size
- 7454 bytes
- Lines
- 292
- 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
bios_parser_common.hinclude/grph_object_ctrl_defs.h
Detected Declarations
function filesfunction enum_id_from_bios_object_idfunction gpu_id_from_bios_object_idfunction encoder_id_from_bios_object_idfunction connector_id_from_bios_object_idfunction generic_id_from_bios_object_idfunction id_from_bios_object_idfunction object_id_from_bios_object_id
Annotated Snippet
#include "bios_parser_common.h"
#include "include/grph_object_ctrl_defs.h"
static enum object_type object_type_from_bios_object_id(uint32_t bios_object_id)
{
uint32_t bios_object_type = (bios_object_id & OBJECT_TYPE_MASK)
>> OBJECT_TYPE_SHIFT;
enum object_type object_type;
switch (bios_object_type) {
case GRAPH_OBJECT_TYPE_GPU:
object_type = OBJECT_TYPE_GPU;
break;
case GRAPH_OBJECT_TYPE_ENCODER:
object_type = OBJECT_TYPE_ENCODER;
break;
case GRAPH_OBJECT_TYPE_CONNECTOR:
object_type = OBJECT_TYPE_CONNECTOR;
break;
case GRAPH_OBJECT_TYPE_ROUTER:
object_type = OBJECT_TYPE_ROUTER;
break;
case GRAPH_OBJECT_TYPE_GENERIC:
object_type = OBJECT_TYPE_GENERIC;
break;
default:
object_type = OBJECT_TYPE_UNKNOWN;
break;
}
return object_type;
}
static enum object_enum_id enum_id_from_bios_object_id(uint32_t bios_object_id)
{
uint32_t bios_enum_id =
(bios_object_id & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
enum object_enum_id id;
switch (bios_enum_id) {
case GRAPH_OBJECT_ENUM_ID1:
id = ENUM_ID_1;
break;
case GRAPH_OBJECT_ENUM_ID2:
id = ENUM_ID_2;
break;
case GRAPH_OBJECT_ENUM_ID3:
id = ENUM_ID_3;
break;
case GRAPH_OBJECT_ENUM_ID4:
id = ENUM_ID_4;
break;
case GRAPH_OBJECT_ENUM_ID5:
id = ENUM_ID_5;
break;
case GRAPH_OBJECT_ENUM_ID6:
id = ENUM_ID_6;
break;
case GRAPH_OBJECT_ENUM_ID7:
id = ENUM_ID_7;
break;
default:
id = ENUM_ID_UNKNOWN;
break;
}
return id;
}
static uint32_t gpu_id_from_bios_object_id(uint32_t bios_object_id)
{
return (bios_object_id & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
}
static enum encoder_id encoder_id_from_bios_object_id(uint32_t bios_object_id)
{
uint32_t bios_encoder_id = gpu_id_from_bios_object_id(bios_object_id);
enum encoder_id id;
switch (bios_encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
id = ENCODER_ID_INTERNAL_LVDS;
break;
case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
id = ENCODER_ID_INTERNAL_TMDS1;
break;
case ENCODER_OBJECT_ID_INTERNAL_TMDS2:
id = ENCODER_ID_INTERNAL_TMDS2;
break;
case ENCODER_OBJECT_ID_INTERNAL_DAC1:
Annotation
- Immediate include surface: `bios_parser_common.h`, `include/grph_object_ctrl_defs.h`.
- Detected declarations: `function files`, `function enum_id_from_bios_object_id`, `function gpu_id_from_bios_object_id`, `function encoder_id_from_bios_object_id`, `function connector_id_from_bios_object_id`, `function generic_id_from_bios_object_id`, `function id_from_bios_object_id`, `function object_id_from_bios_object_id`.
- 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.