Skip to content

Commit 7d9c70d

Browse files
Jiansong Chenalexdeucher
authored andcommitted
drm/amdgpu: remove unsafe optimization to drop preamble ib
Take the situation with gfxoff, the optimization may cause corrupt CE ram contents. In addition emit_cntxcntl callback has similar optimization which firmware can handle properly even for power feature. Signed-off-by: Jiansong Chen <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 29b4c58 commit 7d9c70d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
130130
struct amdgpu_device *adev = ring->adev;
131131
struct amdgpu_ib *ib = &ibs[0];
132132
struct dma_fence *tmp = NULL;
133-
bool skip_preamble, need_ctx_switch;
133+
bool need_ctx_switch;
134134
unsigned patch_offset = ~0;
135135
struct amdgpu_vm *vm;
136136
uint64_t fence_ctx;
@@ -227,7 +227,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
227227
if (need_ctx_switch)
228228
status |= AMDGPU_HAVE_CTX_SWITCH;
229229

230-
skip_preamble = ring->current_ctx == fence_ctx;
231230
if (job && ring->funcs->emit_cntxcntl) {
232231
status |= job->preamble_status;
233232
status |= job->preemption_status;
@@ -245,14 +244,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
245244
for (i = 0; i < num_ibs; ++i) {
246245
ib = &ibs[i];
247246

248-
/* drop preamble IBs if we don't have a context switch */
249-
if ((ib->flags & AMDGPU_IB_FLAG_PREAMBLE) &&
250-
skip_preamble &&
251-
!(status & AMDGPU_PREAMBLE_IB_PRESENT_FIRST) &&
252-
!amdgpu_mcbp &&
253-
!amdgpu_sriov_vf(adev)) /* for SRIOV preemption, Preamble CE ib must be inserted anyway */
254-
continue;
255-
256247
if (job && ring->funcs->emit_frame_cntl) {
257248
if (secure != !!(ib->flags & AMDGPU_IB_FLAGS_SECURE)) {
258249
amdgpu_ring_emit_frame_cntl(ring, false, secure);

0 commit comments

Comments
 (0)