Skip to content

Commit f7e232d

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Fix VCN allocation in CPX partition
VCN need not be shared in CPX mode always for all GFX 9.4.3 SOC SKUs. In certain configs, VCN instance can be exclusively allocated to a partition even under CPX mode. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: James Zhu <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3818708 commit f7e232d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ void aqua_vanjaram_doorbell_index_init(struct amdgpu_device *adev)
6262
adev->doorbell_index.max_assignment = AMDGPU_DOORBELL_LAYOUT1_MAX_ASSIGNMENT << 1;
6363
}
6464

65+
static bool aqua_vanjaram_xcp_vcn_shared(struct amdgpu_device *adev)
66+
{
67+
return (adev->xcp_mgr->num_xcps > adev->vcn.num_vcn_inst);
68+
}
69+
6570
static void aqua_vanjaram_set_xcp_id(struct amdgpu_device *adev,
6671
uint32_t inst_idx, struct amdgpu_ring *ring)
6772
{
@@ -87,7 +92,7 @@ static void aqua_vanjaram_set_xcp_id(struct amdgpu_device *adev,
8792
case AMDGPU_RING_TYPE_VCN_ENC:
8893
case AMDGPU_RING_TYPE_VCN_JPEG:
8994
ip_blk = AMDGPU_XCP_VCN;
90-
if (adev->xcp_mgr->mode == AMDGPU_CPX_PARTITION_MODE)
95+
if (aqua_vanjaram_xcp_vcn_shared(adev))
9196
inst_mask = 1 << (inst_idx * 2);
9297
break;
9398
default:
@@ -140,10 +145,12 @@ static int aqua_vanjaram_xcp_sched_list_update(
140145

141146
aqua_vanjaram_xcp_gpu_sched_update(adev, ring, ring->xcp_id);
142147

143-
/* VCN is shared by two partitions under CPX MODE */
148+
/* VCN may be shared by two partitions under CPX MODE in certain
149+
* configs.
150+
*/
144151
if ((ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC ||
145-
ring->funcs->type == AMDGPU_RING_TYPE_VCN_JPEG) &&
146-
adev->xcp_mgr->mode == AMDGPU_CPX_PARTITION_MODE)
152+
ring->funcs->type == AMDGPU_RING_TYPE_VCN_JPEG) &&
153+
aqua_vanjaram_xcp_vcn_shared(adev))
147154
aqua_vanjaram_xcp_gpu_sched_update(adev, ring, ring->xcp_id + 1);
148155
}
149156

0 commit comments

Comments
 (0)