drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
Extension
.c
Size
107310 bytes
Lines
4188
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: operation-table or driver-model contract
Status
pattern 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.

Dependency Surface

Detected Declarations

Annotated Snippet

static const struct file_operations smu_stb_debugfs_fops = {
	.owner = THIS_MODULE,
	.open = smu_stb_debugfs_open,
	.read = smu_stb_debugfs_read,
	.release = smu_stb_debugfs_release,
	.llseek = default_llseek,
};

#endif

void amdgpu_smu_stb_debug_fs_init(struct amdgpu_device *adev)
{
#if defined(CONFIG_DEBUG_FS)

	struct smu_context *smu = adev->powerplay.pp_handle;

	if (!smu || (!smu->stb_context.stb_buf_size))
		return;

	debugfs_create_file_size("amdgpu_smu_stb_dump",
			    S_IRUSR,
			    adev_to_drm(adev)->primary->debugfs_root,
			    adev,
			    &smu_stb_debugfs_fops,
			    smu->stb_context.stb_buf_size);
#endif
}

int smu_send_hbm_bad_pages_num(struct smu_context *smu, uint32_t size)
{
	int ret = 0;

	if (smu->ppt_funcs && smu->ppt_funcs->send_hbm_bad_pages_num)
		ret = smu->ppt_funcs->send_hbm_bad_pages_num(smu, size);

	return ret;
}

int smu_send_hbm_bad_channel_flag(struct smu_context *smu, uint32_t size)
{
	int ret = 0;

	if (smu->ppt_funcs && smu->ppt_funcs->send_hbm_bad_channel_flag)
		ret = smu->ppt_funcs->send_hbm_bad_channel_flag(smu, size);

	return ret;
}

int smu_send_rma_reason(struct smu_context *smu)
{
	int ret = 0;

	if (smu->ppt_funcs && smu->ppt_funcs->send_rma_reason)
		ret = smu->ppt_funcs->send_rma_reason(smu);

	return ret;
}

/**
 * smu_reset_sdma_is_supported - Check if SDMA reset is supported by SMU
 * @smu: smu_context pointer
 *
 * This function checks if the SMU supports resetting the SDMA engine.
 * It returns true if supported, false otherwise.
 */
bool smu_reset_sdma_is_supported(struct smu_context *smu)
{
	return smu_feature_cap_test(smu, SMU_FEATURE_CAP_ID__SDMA_RESET);
}

int smu_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
{
	int ret = 0;

	if (smu->ppt_funcs && smu->ppt_funcs->reset_sdma)
		ret = smu->ppt_funcs->reset_sdma(smu, inst_mask);

	return ret;
}

bool smu_reset_vcn_is_supported(struct smu_context *smu)
{
	return smu_feature_cap_test(smu, SMU_FEATURE_CAP_ID__VCN_RESET);
}

int smu_reset_vcn(struct smu_context *smu, uint32_t inst_mask)
{
	if (smu->ppt_funcs && smu->ppt_funcs->dpm_reset_vcn)
		smu->ppt_funcs->dpm_reset_vcn(smu, inst_mask);

Annotation

Implementation Notes