Skip to content

Commit a28eb48

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Keep non-psp path for partition switch
When PSP block is not present, use direct programming. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Acked-by: Mangesh Gadre <[email protected]> Tested-by: Mangesh Gadre <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2dc8450 commit a28eb48

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -623,12 +623,28 @@ 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 ret;
627-
628-
ret = psp_spatial_partition(&adev->psp, NUM_XCC(adev->gfx.xcc_mask) /
629-
num_xccs_per_xcp);
630-
if (ret)
631-
return ret;
626+
int ret, i, num_xcc;
627+
u32 tmp = 0;
628+
629+
if (adev->psp.funcs) {
630+
ret = psp_spatial_partition(&adev->psp,
631+
NUM_XCC(adev->gfx.xcc_mask) /
632+
num_xccs_per_xcp);
633+
if (ret)
634+
return ret;
635+
} else {
636+
num_xcc = NUM_XCC(adev->gfx.xcc_mask);
637+
638+
for (i = 0; i < num_xcc; i++) {
639+
tmp = REG_SET_FIELD(tmp, CP_HYP_XCP_CTL, NUM_XCC_IN_XCP,
640+
num_xccs_per_xcp);
641+
tmp = REG_SET_FIELD(tmp, CP_HYP_XCP_CTL, VIRTUAL_XCC_ID,
642+
i % num_xccs_per_xcp);
643+
WREG32_SOC15(GC, GET_INST(GC, i), regCP_HYP_XCP_CTL,
644+
tmp);
645+
}
646+
ret = 0;
647+
}
632648

633649
adev->gfx.num_xcc_per_xcp = num_xccs_per_xcp;
634650

0 commit comments

Comments
 (0)