drivers/gpu/drm/radeon/radeon_atombios.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/radeon_atombios.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/radeon_atombios.c- Extension
.c- Size
- 146481 bytes
- Lines
- 4474
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/pci.hdrm/drm_device.hdrm/drm_edid.hdrm/radeon_drm.hradeon.hatom.hatom-bits.hradeon_asic.hradeon_atombios.hradeon_legacy_encoders.h
Detected Declarations
struct bios_connectorfunction radeon_lookup_i2c_gpio_quirksfunction radeon_get_bus_rec_for_i2c_gpiofunction radeon_lookup_i2c_gpiofunction radeon_atombios_i2c_initfunction radeon_atombios_lookup_gpiofunction radeon_atom_get_hpd_info_from_gpiofunction radeon_atom_apply_quirksfunction radeon_get_atom_connector_info_from_object_tablefunction atombios_get_connector_object_idfunction radeon_get_atom_connector_info_from_supported_devices_tablefunction radeon_atombios_get_dentist_vco_freqfunction radeon_atom_get_clock_infofunction radeon_atombios_sideport_presentfunction radeon_atombios_get_tmds_infofunction radeon_atombios_get_ppll_ss_infofunction radeon_atombios_get_igp_ss_overridesfunction radeon_atombios_get_asic_ss_infofunction radeon_atombios_get_primary_dac_infofunction radeon_atom_get_tv_timingsfunction radeon_atombios_get_tv_infofunction radeon_atombios_get_tv_dac_infofunction radeon_atombios_parse_misc_flags_1_3function radeon_atombios_parse_power_table_1_3function radeon_atombios_add_pplib_thermal_controllerfunction radeon_atombios_get_default_voltagesfunction radeon_atombios_parse_pplib_non_clock_infofunction radeon_atombios_parse_pplib_clock_infofunction radeon_atombios_parse_power_table_4_5function radeon_atombios_parse_power_table_6function radeon_atombios_get_power_modesfunction radeon_atom_get_clock_dividersfunction radeon_atom_get_memory_pll_dividersfunction radeon_atom_set_clock_gatingfunction radeon_atom_get_engine_clockfunction radeon_atom_get_memory_clockfunction radeon_atom_set_engine_clockfunction radeon_atom_set_memory_clockfunction radeon_atom_set_engine_dram_timingsfunction radeon_atom_update_memory_dllfunction radeon_atom_set_ac_timingfunction radeon_atom_set_voltagefunction radeon_atom_get_max_vddcfunction radeon_atom_get_leakage_vddc_based_on_leakage_idxfunction radeon_atom_get_leakage_id_from_vbiosfunction radeon_atom_get_leakage_vddc_based_on_leakage_paramsfunction radeon_atom_get_voltage_evvfunction radeon_atom_get_voltage_gpio_settings
Annotated Snippet
struct bios_connector {
bool valid;
uint16_t line_mux;
uint16_t devices;
int connector_type;
struct radeon_i2c_bus_rec ddc_bus;
struct radeon_hpd hpd;
};
bool radeon_get_atom_connector_info_from_supported_devices_table(struct
drm_device
*dev)
{
struct radeon_device *rdev = dev->dev_private;
struct radeon_mode_info *mode_info = &rdev->mode_info;
struct atom_context *ctx = mode_info->atom_context;
int index = GetIndexIntoMasterTable(DATA, SupportedDevicesInfo);
uint16_t size, data_offset;
uint8_t frev, crev;
uint16_t device_support;
uint8_t dac;
union atom_supported_devices *supported_devices;
int i, j, max_device;
struct bios_connector *bios_connectors;
size_t bc_size = sizeof(*bios_connectors) * ATOM_MAX_SUPPORTED_DEVICE;
struct radeon_router router;
router.ddc_valid = false;
router.cd_valid = false;
bios_connectors = kzalloc(bc_size, GFP_KERNEL);
if (!bios_connectors)
return false;
if (!atom_parse_data_header(ctx, index, &size, &frev, &crev,
&data_offset)) {
kfree(bios_connectors);
return false;
}
supported_devices =
(union atom_supported_devices *)(ctx->bios + data_offset);
device_support = le16_to_cpu(supported_devices->info.usDeviceSupport);
if (frev > 1)
max_device = ATOM_MAX_SUPPORTED_DEVICE;
else
max_device = ATOM_MAX_SUPPORTED_DEVICE_INFO;
for (i = 0; i < max_device; i++) {
ATOM_CONNECTOR_INFO_I2C ci;
if (frev > 1)
ci = supported_devices->info_2d1.asConnInfo[i];
else
ci = supported_devices->info.asConnInfo[i];
bios_connectors[i].valid = false;
if (!(device_support & (1 << i))) {
continue;
}
if (i == ATOM_DEVICE_CV_INDEX) {
DRM_DEBUG_KMS("Skipping Component Video\n");
continue;
}
bios_connectors[i].connector_type =
supported_devices_connector_convert[ci.sucConnectorInfo.
sbfAccess.
bfConnectorType];
if (bios_connectors[i].connector_type ==
DRM_MODE_CONNECTOR_Unknown)
continue;
dac = ci.sucConnectorInfo.sbfAccess.bfAssociatedDAC;
bios_connectors[i].line_mux =
ci.sucI2cId.ucAccess;
/* give tv unique connector ids */
if (i == ATOM_DEVICE_TV1_INDEX) {
bios_connectors[i].ddc_bus.valid = false;
bios_connectors[i].line_mux = 50;
} else if (i == ATOM_DEVICE_TV2_INDEX) {
bios_connectors[i].ddc_bus.valid = false;
bios_connectors[i].line_mux = 51;
Annotation
- Immediate include surface: `linux/pci.h`, `drm/drm_device.h`, `drm/drm_edid.h`, `drm/radeon_drm.h`, `radeon.h`, `atom.h`, `atom-bits.h`, `radeon_asic.h`.
- Detected declarations: `struct bios_connector`, `function radeon_lookup_i2c_gpio_quirks`, `function radeon_get_bus_rec_for_i2c_gpio`, `function radeon_lookup_i2c_gpio`, `function radeon_atombios_i2c_init`, `function radeon_atombios_lookup_gpio`, `function radeon_atom_get_hpd_info_from_gpio`, `function radeon_atom_apply_quirks`, `function radeon_get_atom_connector_info_from_object_table`, `function atombios_get_connector_object_id`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.