drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c- Extension
.c- Size
- 247874 bytes
- Lines
- 7211
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/delay.hlinux/kernel.hlinux/firmware.hlinux/module.hlinux/pci.hamdgpu.hamdgpu_gfx.hamdgpu_ring.hvi.hvi_structs.hvid.hamdgpu_ucode.hamdgpu_atombios.hatombios_i2c.hclearstate_vi.hgmc/gmc_8_2_d.hgmc/gmc_8_2_sh_mask.hoss/oss_3_0_d.hoss/oss_3_0_sh_mask.hbif/bif_5_0_d.hbif/bif_5_0_sh_mask.hgca/gfx_8_0_d.hgca/gfx_8_0_enum.hgca/gfx_8_0_sh_mask.hdce/dce_10_0_d.hdce/dce_10_0_sh_mask.hsmu/smu_7_1_3_d.hivsrcid/ivsrcid_vislands30.h
Detected Declarations
function gfx_v8_0_init_golden_registersfunction gfx_v8_0_ring_test_ringfunction gfx_v8_0_ring_test_ibfunction gfx_v8_0_free_microcodefunction gfx_v8_0_init_microcodefunction gfx_v8_0_get_csb_bufferfunction gfx_v8_0_cp_jump_table_numfunction gfx_v8_0_rlc_initfunction gfx_v8_0_mec_finifunction gfx_v8_0_mec_initfunction gfx_v8_0_do_edc_gpr_workaroundsfunction gfx_v8_0_gpu_early_initfunction gfx_v8_0_compute_ring_initfunction gfx_v8_0_sw_initfunction gfx_v8_0_sw_finifunction gfx_v8_0_tiling_mode_table_initfunction gfx_v8_0_select_se_shfunction gfx_v8_0_select_me_pipe_qfunction gfx_v8_0_get_rb_active_bitmapfunction gfx_v8_0_raster_configfunction gfx_v8_0_write_harvested_raster_configsfunction gfx_v8_0_setup_rbfunction gfx_v8_0_init_compute_vmidfunction gfx_v8_0_init_gds_vmidfunction gfx_v8_0_config_initfunction gfx_v8_0_constants_initfunction gfx_v8_0_wait_for_rlc_serdesfunction gfx_v8_0_enable_gui_idle_interruptfunction gfx_v8_0_init_csbfunction gfx_v8_0_parse_ind_reg_listfunction gfx_v8_0_init_save_restore_listfunction gfx_v8_0_enable_save_restore_machinefunction gfx_v8_0_init_power_gatingfunction cz_enable_sck_slow_down_on_power_upfunction cz_enable_sck_slow_down_on_power_downfunction cz_enable_cp_power_gatingfunction gfx_v8_0_init_pgfunction gfx_v8_0_rlc_stopfunction gfx_v8_0_rlc_resetfunction gfx_v8_0_rlc_startfunction gfx_v8_0_rlc_resumefunction gfx_v8_0_cp_gfx_enablefunction gfx_v8_0_get_csb_sizefunction gfx_v8_0_cp_gfx_startfunction gfx_v8_0_set_cpg_door_bellfunction gfx_v8_0_cp_gfx_resumefunction gfx_v8_0_cp_compute_enablefunction gfx_v8_0_kiq_setting
Annotated Snippet
if (err == -ENODEV) {
err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_pfp.bin", chip_name);
}
} else {
err = amdgpu_ucode_request(adev, &adev->gfx.pfp_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_pfp.bin", chip_name);
}
if (err)
goto out;
cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.pfp_fw->data;
adev->gfx.pfp_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);
adev->gfx.pfp_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);
if (adev->asic_type >= CHIP_POLARIS10 && adev->asic_type <= CHIP_POLARIS12) {
err = amdgpu_ucode_request(adev, &adev->gfx.me_fw,
AMDGPU_UCODE_OPTIONAL,
"amdgpu/%s_me_2.bin", chip_name);
if (err == -ENODEV) {
err = amdgpu_ucode_request(adev, &adev->gfx.me_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_me.bin", chip_name);
}
} else {
err = amdgpu_ucode_request(adev, &adev->gfx.me_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_me.bin", chip_name);
}
if (err)
goto out;
cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.me_fw->data;
adev->gfx.me_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);
adev->gfx.me_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);
if (adev->asic_type >= CHIP_POLARIS10 && adev->asic_type <= CHIP_POLARIS12) {
err = amdgpu_ucode_request(adev, &adev->gfx.ce_fw,
AMDGPU_UCODE_OPTIONAL,
"amdgpu/%s_ce_2.bin", chip_name);
if (err == -ENODEV) {
err = amdgpu_ucode_request(adev, &adev->gfx.ce_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_ce.bin", chip_name);
}
} else {
err = amdgpu_ucode_request(adev, &adev->gfx.ce_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_ce.bin", chip_name);
}
if (err)
goto out;
cp_hdr = (const struct gfx_firmware_header_v1_0 *)adev->gfx.ce_fw->data;
adev->gfx.ce_fw_version = le32_to_cpu(cp_hdr->header.ucode_version);
adev->gfx.ce_feature_version = le32_to_cpu(cp_hdr->ucode_feature_version);
/*
* Support for MCBP/Virtualization in combination with chained IBs is
* formal released on feature version #46
*/
if (adev->gfx.ce_feature_version >= 46 &&
adev->gfx.pfp_feature_version >= 46) {
adev->virt.chained_ib_support = true;
drm_info(adev_to_drm(adev), "Chained IB support enabled!\n");
} else
adev->virt.chained_ib_support = false;
err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw,
AMDGPU_UCODE_REQUIRED,
"amdgpu/%s_rlc.bin", chip_name);
if (err)
goto out;
rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
adev->gfx.rlc_fw_version = le32_to_cpu(rlc_hdr->header.ucode_version);
adev->gfx.rlc_feature_version = le32_to_cpu(rlc_hdr->ucode_feature_version);
adev->gfx.rlc.save_and_restore_offset =
le32_to_cpu(rlc_hdr->save_and_restore_offset);
adev->gfx.rlc.clear_state_descriptor_offset =
le32_to_cpu(rlc_hdr->clear_state_descriptor_offset);
adev->gfx.rlc.avail_scratch_ram_locations =
le32_to_cpu(rlc_hdr->avail_scratch_ram_locations);
adev->gfx.rlc.reg_restore_list_size =
le32_to_cpu(rlc_hdr->reg_restore_list_size);
adev->gfx.rlc.reg_list_format_start =
le32_to_cpu(rlc_hdr->reg_list_format_start);
adev->gfx.rlc.reg_list_format_separate_start =
le32_to_cpu(rlc_hdr->reg_list_format_separate_start);
adev->gfx.rlc.starting_offsets_start =
Annotation
- Immediate include surface: `linux/delay.h`, `linux/kernel.h`, `linux/firmware.h`, `linux/module.h`, `linux/pci.h`, `amdgpu.h`, `amdgpu_gfx.h`, `amdgpu_ring.h`.
- Detected declarations: `function gfx_v8_0_init_golden_registers`, `function gfx_v8_0_ring_test_ring`, `function gfx_v8_0_ring_test_ib`, `function gfx_v8_0_free_microcode`, `function gfx_v8_0_init_microcode`, `function gfx_v8_0_get_csb_buffer`, `function gfx_v8_0_cp_jump_table_num`, `function gfx_v8_0_rlc_init`, `function gfx_v8_0_mec_fini`, `function gfx_v8_0_mec_init`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.