diff options
| author | Monk Liu <[email protected]> | 2017-03-27 07:14:53 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2017-03-30 03:55:34 +0000 |
| commit | 65333e4429c60b8bbbb7a9213cb5612761499acd (patch) | |
| tree | bad1ecae493a70c18b595a51224c5ef7882df192 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
| parent | drm/amdgpu:protect cs submit (diff) | |
| download | kernel-65333e4429c60b8bbbb7a9213cb5612761499acd.tar.gz kernel-65333e4429c60b8bbbb7a9213cb5612761499acd.zip | |
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: Monk Liu <[email protected]>
Reviewed-by: Ken Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index cf44388b5bce..2957404bd44a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -903,16 +903,17 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, if (chunk->chunk_id != AMDGPU_CHUNK_ID_IB) continue; - if (ib->flags & AMDGPU_IB_FLAG_PREEMPT) { - if (ib->flags & AMDGPU_IB_FLAG_CE) - ce_preempt++; - else - de_preempt++; - } + if (chunk_ib->ip_type == AMDGPU_HW_IP_GFX && amdgpu_sriov_vf(adev)) { + if (chunk_ib->flags & AMDGPU_IB_FLAG_PREEMPT) + if (chunk_ib->flags & AMDGPU_IB_FLAG_CE) + ce_preempt++; + else + de_preempt++; - /* only one preemptible IB per submit for me/ce */ - if (ce_preempt > 1 || de_preempt > 1) - return -EINVAL; + /* each GFX command submit allows 0 or 1 IB preemptible for CE & DE */ + if (ce_preempt > 1 || de_preempt > 1) + BUG(); + } r = amdgpu_cs_get_ring(adev, chunk_ib->ip_type, chunk_ib->ip_instance, chunk_ib->ring, |
