Commit 65333e44 authored by Monk Liu's avatar Monk Liu Committed by Alex Deucher

drm/amdgpu:fix the check in cs_ib_fill for SRIOV

1,the check is only appliable for SRIOV GFX engine.
2,use chunk_ib instead of ib.
Signed-off-by: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarKen Wang <Qingqing.wang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9a1b3af1
...@@ -903,17 +903,18 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, ...@@ -903,17 +903,18 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev,
if (chunk->chunk_id != AMDGPU_CHUNK_ID_IB) if (chunk->chunk_id != AMDGPU_CHUNK_ID_IB)
continue; continue;
if (ib->flags & AMDGPU_IB_FLAG_PREEMPT) { if (chunk_ib->ip_type == AMDGPU_HW_IP_GFX && amdgpu_sriov_vf(adev)) {
if (ib->flags & AMDGPU_IB_FLAG_CE) if (chunk_ib->flags & AMDGPU_IB_FLAG_PREEMPT)
ce_preempt++; if (chunk_ib->flags & AMDGPU_IB_FLAG_CE)
else ce_preempt++;
de_preempt++; else
de_preempt++;
/* each GFX command submit allows 0 or 1 IB preemptible for CE & DE */
if (ce_preempt > 1 || de_preempt > 1)
BUG();
} }
/* only one preemptible IB per submit for me/ce */
if (ce_preempt > 1 || de_preempt > 1)
return -EINVAL;
r = amdgpu_cs_get_ring(adev, chunk_ib->ip_type, r = amdgpu_cs_get_ring(adev, chunk_ib->ip_type,
chunk_ib->ip_instance, chunk_ib->ring, chunk_ib->ip_instance, chunk_ib->ring,
&ring); &ring);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment