From: Hawking Zhang Date: Thu, 5 Jun 2025 16:38:51 +0000 (+0800) Subject: drm/amdgpu: Initialize xcp manager for soc v1_0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ed1d463ecdd265059ebcc8642651e59588c6fd;p=thirdparty%2Fkernel%2Flinux.git drm/amdgpu: Initialize xcp manager for soc v1_0 Initialize xcp manager for soc v1_0 Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c index 74eb21799fa8..8ab30cafe0b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c @@ -747,10 +747,35 @@ struct amdgpu_xcp_mgr_funcs soc_v1_0_xcp_funcs = { #endif }; +static int soc_v1_0_xcp_mgr_init(struct amdgpu_device *adev) +{ + int ret; + + if (amdgpu_sriov_vf(adev)) + soc_v1_0_xcp_funcs.switch_partition_mode = NULL; + + ret = amdgpu_xcp_mgr_init(adev, AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE, + 1, &soc_v1_0_xcp_funcs); + if (ret) + return ret; + + amdgpu_xcp_update_supported_modes(adev->xcp_mgr); + /* TODO: Default memory node affinity init */ + + return ret; +} + int soc_v1_0_init_soc_config(struct amdgpu_device *adev) { + int ret; + + /*TODO: init soc config */ adev->sdma.num_inst_per_xcc = 2; + ret = soc_v1_0_xcp_mgr_init(adev); + if (ret) + return ret; + amdgpu_ip_map_init(adev); return 0;