From: Likun Gao <[email protected]>

Set aid_mask via xcc_mask.

v2: squash in follow up change

Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/soc_v1_0.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c 
b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
index 628abd25ac091..e9c7be1ed602e 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c
@@ -781,9 +781,17 @@ static int soc_v1_0_xcp_mgr_init(struct amdgpu_device 
*adev)
 
 int soc_v1_0_init_soc_config(struct amdgpu_device *adev)
 {
-       int ret;
+       int ret, i;
+       int xcc_inst_per_aid = 4;
+       uint16_t xcc_mask;
+
+       xcc_mask = adev->gfx.xcc_mask;
+       adev->aid_mask = 0;
+       for (i = 0; xcc_mask; xcc_mask >>= xcc_inst_per_aid, i++) {
+               if (xcc_mask & ((1U << xcc_inst_per_aid) - 1))
+                       adev->aid_mask |= (1 << i);
+       }
 
-       /*TODO: init soc config */
        adev->sdma.num_inst_per_xcc = 2;
        adev->sdma.num_instances =
                NUM_XCC(adev->gfx.xcc_mask) * adev->sdma.num_inst_per_xcc;
-- 
2.52.0

Reply via email to