drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.c- Extension
.c- Size
- 25738 bytes
- Lines
- 911
- 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/delay.hlinux/gfp.hlinux/kernel.hlinux/ktime.hlinux/slab.hlinux/types.hcgs_common.hsmu/smu_8_0_d.hsmu/smu_8_0_sh_mask.hsmu8.hsmu8_fusion.hsmu8_smumgr.hcz_ppsmc.hsmu_ucode_xfer_cz.hgca/gfx_8_0_d.hgca/gfx_8_0_sh_mask.hsmumgr.h
Detected Declarations
function smu8_get_argumentfunction smu8_send_msg_to_smc_with_parameterfunction smu8_send_msg_to_smcfunction smu8_set_smc_sram_addressfunction smu8_write_smc_sram_dwordfunction smu8_check_fw_load_finishfunction smu8_load_mec_firmwarefunction smu8_translate_firmware_enum_to_argfunction smu8_convert_fw_type_to_cgsfunction smu8_smu_populate_single_scratch_taskfunction smu8_smu_populate_single_ucode_load_taskfunction smu8_smu_construct_toc_for_rlc_aram_savefunction smu8_smu_initialize_toc_empty_job_listfunction smu8_smu_construct_toc_for_vddgfx_enterfunction smu8_smu_construct_toc_for_vddgfx_exitfunction smu8_smu_construct_toc_for_power_profilingfunction smu8_smu_construct_toc_for_bootupfunction smu8_smu_construct_toc_for_clock_tablefunction smu8_smu_construct_tocfunction smu8_smu_populate_firmware_entriesfunction smu8_smu_populate_single_scratch_entryfunction smu8_download_pptable_settingsfunction smu8_upload_pptable_settingsfunction smu8_request_smu_load_fwfunction smu8_start_smufunction smu8_smu_initfunction smu8_smu_finifunction smu8_dpm_check_smu_featuresfunction smu8_is_dpm_running
Annotated Snippet
if (ret == 0) {
smu8_smu->driver_buffer[i].mc_addr = info.mc_addr;
smu8_smu->driver_buffer[i].data_size = info.image_size;
smu8_smu->driver_buffer[i].firmware_ID = firmware_list[i];
smu8_smu->driver_buffer_length++;
}
}
return 0;
}
static int smu8_smu_populate_single_scratch_entry(
struct pp_hwmgr *hwmgr,
enum smu8_scratch_entry scratch_type,
uint32_t ulsize_byte,
struct smu8_buffer_entry *entry)
{
struct smu8_smumgr *smu8_smu = hwmgr->smu_backend;
uint32_t ulsize_aligned = SIZE_ALIGN_32(ulsize_byte);
entry->data_size = ulsize_byte;
entry->kaddr = (char *) smu8_smu->smu_buffer.kaddr +
smu8_smu->smu_buffer_used_bytes;
entry->mc_addr = smu8_smu->smu_buffer.mc_addr + smu8_smu->smu_buffer_used_bytes;
entry->firmware_ID = scratch_type;
smu8_smu->smu_buffer_used_bytes += ulsize_aligned;
return 0;
}
static int smu8_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table)
{
struct smu8_smumgr *smu8_smu = hwmgr->smu_backend;
unsigned long i;
for (i = 0; i < smu8_smu->scratch_buffer_length; i++) {
if (smu8_smu->scratch_buffer[i].firmware_ID
== SMU8_SCRATCH_ENTRY_SMU8_FUSION_CLKTABLE)
break;
}
*table = (struct SMU8_Fusion_ClkTable *)smu8_smu->scratch_buffer[i].kaddr;
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrHi,
upper_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrLo,
lower_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob,
smu8_smu->toc_entry_clock_table,
NULL);
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ClkTableXferToDram, NULL);
return 0;
}
static int smu8_upload_pptable_settings(struct pp_hwmgr *hwmgr)
{
struct smu8_smumgr *smu8_smu = hwmgr->smu_backend;
unsigned long i;
for (i = 0; i < smu8_smu->scratch_buffer_length; i++) {
if (smu8_smu->scratch_buffer[i].firmware_ID
== SMU8_SCRATCH_ENTRY_SMU8_FUSION_CLKTABLE)
break;
}
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrHi,
upper_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrLo,
lower_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob,
smu8_smu->toc_entry_clock_table,
NULL);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gfp.h`, `linux/kernel.h`, `linux/ktime.h`, `linux/slab.h`, `linux/types.h`, `cgs_common.h`, `smu/smu_8_0_d.h`.
- Detected declarations: `function smu8_get_argument`, `function smu8_send_msg_to_smc_with_parameter`, `function smu8_send_msg_to_smc`, `function smu8_set_smc_sram_address`, `function smu8_write_smc_sram_dword`, `function smu8_check_fw_load_finish`, `function smu8_load_mec_firmware`, `function smu8_translate_firmware_enum_to_arg`, `function smu8_convert_fw_type_to_cgs`, `function smu8_smu_populate_single_scratch_task`.
- 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.