Skip to content

Commit b00f553

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Use PSP FW API for partition switch
Use PSP firmware interface for switching compute partitions. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Le Ma <le.ma@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent fe38172 commit b00f553

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,6 @@ static int aqua_vanjaram_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr,
518518
adev->gfx.funcs->switch_partition_mode(xcp_mgr->adev,
519519
num_xcc_per_xcp);
520520

521-
if (adev->nbio.funcs->set_compute_partition_mode)
522-
adev->nbio.funcs->set_compute_partition_mode(adev, mode);
523-
524521
/* Init info about new xcps */
525522
*num_xcps = num_xcc / num_xcc_per_xcp;
526523
amdgpu_xcp_init(xcp_mgr, *num_xcps, mode);

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -623,22 +623,16 @@ static void gfx_v9_4_3_select_me_pipe_q(struct amdgpu_device *adev,
623623
static int gfx_v9_4_3_switch_compute_partition(struct amdgpu_device *adev,
624624
int num_xccs_per_xcp)
625625
{
626-
int i, num_xcc;
627-
u32 tmp = 0;
628-
629-
num_xcc = NUM_XCC(adev->gfx.xcc_mask);
626+
int ret;
630627

631-
for (i = 0; i < num_xcc; i++) {
632-
tmp = REG_SET_FIELD(tmp, CP_HYP_XCP_CTL, NUM_XCC_IN_XCP,
633-
num_xccs_per_xcp);
634-
tmp = REG_SET_FIELD(tmp, CP_HYP_XCP_CTL, VIRTUAL_XCC_ID,
635-
i % num_xccs_per_xcp);
636-
WREG32_SOC15(GC, GET_INST(GC, i), regCP_HYP_XCP_CTL, tmp);
637-
}
628+
ret = psp_spatial_partition(&adev->psp, NUM_XCC(adev->gfx.xcc_mask) /
629+
num_xccs_per_xcp);
630+
if (ret)
631+
return ret;
638632

639633
adev->gfx.num_xcc_per_xcp = num_xccs_per_xcp;
640634

641-
return 0;
635+
return ret;
642636
}
643637

644638
static int gfx_v9_4_3_ih_to_xcc_inst(struct amdgpu_device *adev, int ih_node)

0 commit comments

Comments
 (0)