From: Hawking Zhang <[email protected]>

Initialize xcp manager for soc v1_0

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/soc_v1_0.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c 
b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
index 803732c11d3f7..66972b8aee505 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;
-- 
2.51.1

Reply via email to