diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-07-19 10:08:04 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-07-19 10:08:04 +0000 |
commit | 8166f0d21a69a8ab5a66c51e8d72db0e159ed443 (patch) | |
tree | a42e17b17c89b217de70e3d6711809ac62ef3d80 | |
parent | e611d821984c5ec28d5f32cdea351ed5472c6c3a (diff) |
drm/amdgpu: remove unsafe optimization to drop preamble ib
From Jiansong Chen
8fa6473a61ecc9972ad543d8ba1d927d442d1f67 in linux 5.10.y/5.10.51
7d9c70d23550eb86a1bec1954ccaa8d6ec3a3328 in mainline linux
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c index 28f20f0b722..163188ce02b 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c @@ -128,7 +128,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, struct amdgpu_device *adev = ring->adev; struct amdgpu_ib *ib = &ibs[0]; struct dma_fence *tmp = NULL; - bool skip_preamble, need_ctx_switch; + bool need_ctx_switch; unsigned patch_offset = ~0; struct amdgpu_vm *vm; uint64_t fence_ctx; @@ -221,7 +221,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, if (need_ctx_switch) status |= AMDGPU_HAVE_CTX_SWITCH; - skip_preamble = ring->current_ctx == fence_ctx; if (job && ring->funcs->emit_cntxcntl) { status |= job->preamble_status; status |= job->preemption_status; @@ -239,14 +238,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, for (i = 0; i < num_ibs; ++i) { ib = &ibs[i]; - /* drop preamble IBs if we don't have a context switch */ - if ((ib->flags & AMDGPU_IB_FLAG_PREAMBLE) && - skip_preamble && - !(status & AMDGPU_PREAMBLE_IB_PRESENT_FIRST) && - !amdgpu_mcbp && - !amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */ - continue; - if (job && ring->funcs->emit_frame_cntl) { if (secure != !!(ib->flags & AMDGPU_IB_FLAGS_SECURE)) { amdgpu_ring_emit_frame_cntl(ring, false, secure); |