mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
drm/amdgpu: reorder IB schedule sequence
This reorders the IB schedule sequence to cleanly separate the vm operation from the IB submission. This makes the two independent so we can cleanly associate each one with its respective fence. v2: fixes for VCN Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
90d5122115
commit
d3499de3b7
|
|
@ -215,16 +215,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
|
|||
dma_fence_put(tmp);
|
||||
}
|
||||
|
||||
if ((ib->flags & AMDGPU_IB_FLAG_EMIT_MEM_SYNC) && ring->funcs->emit_mem_sync)
|
||||
ring->funcs->emit_mem_sync(ring);
|
||||
|
||||
if (ring->funcs->emit_wave_limit &&
|
||||
ring->hw_prio == AMDGPU_GFX_PIPE_PRIO_HIGH)
|
||||
ring->funcs->emit_wave_limit(ring, true);
|
||||
|
||||
if (ring->funcs->insert_start)
|
||||
ring->funcs->insert_start(ring);
|
||||
|
||||
if (job) {
|
||||
r = amdgpu_vm_flush(ring, job, need_pipe_sync);
|
||||
if (r) {
|
||||
|
|
@ -235,6 +225,16 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
|
|||
|
||||
amdgpu_ring_ib_begin(ring);
|
||||
|
||||
if (ring->funcs->insert_start)
|
||||
ring->funcs->insert_start(ring);
|
||||
|
||||
if ((ib->flags & AMDGPU_IB_FLAG_EMIT_MEM_SYNC) && ring->funcs->emit_mem_sync)
|
||||
ring->funcs->emit_mem_sync(ring);
|
||||
|
||||
if (ring->funcs->emit_wave_limit &&
|
||||
ring->hw_prio == AMDGPU_GFX_PIPE_PRIO_HIGH)
|
||||
ring->funcs->emit_wave_limit(ring, true);
|
||||
|
||||
if (ring->funcs->emit_gfx_shadow && adev->gfx.cp_gfx_shadow)
|
||||
amdgpu_ring_emit_gfx_shadow(ring, shadow_va, csa_va, gds_va,
|
||||
init_shadow, vmid);
|
||||
|
|
@ -323,6 +323,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
|
|||
ring->hw_prio == AMDGPU_GFX_PIPE_PRIO_HIGH)
|
||||
ring->funcs->emit_wave_limit(ring, false);
|
||||
|
||||
amdgpu_ring_ib_end(ring);
|
||||
/* Save the wptr associated with this fence.
|
||||
* This must be last for resets to work properly
|
||||
* as we need to save the wptr associated with this
|
||||
|
|
@ -331,7 +332,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
|
|||
*/
|
||||
amdgpu_fence_save_wptr(af);
|
||||
|
||||
amdgpu_ring_ib_end(ring);
|
||||
amdgpu_ring_commit(ring);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -815,6 +815,17 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job,
|
|||
return 0;
|
||||
|
||||
amdgpu_ring_ib_begin(ring);
|
||||
|
||||
/* There is no matching insert_end for this on purpose for the vm flush.
|
||||
* The IB portion of the submission has both. Having multiple
|
||||
* insert_start sequences is ok, but you can only have one insert_end
|
||||
* per submission based on the way VCN FW works. For JPEG
|
||||
* you can as many insert_start and insert_end sequences as you like as
|
||||
* long as the rest of the packets come between start and end sequences.
|
||||
*/
|
||||
if (ring->funcs->insert_start)
|
||||
ring->funcs->insert_start(ring);
|
||||
|
||||
if (ring->funcs->init_cond_exec)
|
||||
patch = amdgpu_ring_init_cond_exec(ring,
|
||||
ring->cond_exe_gpu_addr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user