Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Emit cleaner shader at end of IB submission

This commit introduces the emission of a cleaner shader at the end of
the IB submission process. This is achieved by adding a new function
pointer, `emit_cleaner_shader`, to the `amdgpu_ring_funcs` structure. If
the `emit_cleaner_shader` function is set in the ring functions, it is
called during the VM flush process.

The cleaner shader is only emitted if the `enable_cleaner_shader` flag
is set in the `amdgpu_device` structure. This allows the cleaner shader
emission to be controlled on a per-device basis.

By emitting a cleaner shader at the end of the IB submission, we can
ensure that the VM state is properly cleaned up after each submission.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>

+6
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
··· 236 236 void (*patch_ce)(struct amdgpu_ring *ring, unsigned offset); 237 237 void (*patch_de)(struct amdgpu_ring *ring, unsigned offset); 238 238 int (*reset)(struct amdgpu_ring *ring, unsigned int vmid); 239 + void (*emit_cleaner_shader)(struct amdgpu_ring *ring); 239 240 }; 240 241 241 242 struct amdgpu_ring {
+5
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 681 681 pasid_mapping_needed &= adev->gmc.gmc_funcs->emit_pasid_mapping && 682 682 ring->funcs->emit_wreg; 683 683 684 + if (adev->gfx.enable_cleaner_shader && 685 + ring->funcs->emit_cleaner_shader) 686 + ring->funcs->emit_cleaner_shader(ring); 687 + 684 688 if (!vm_flush_needed && !gds_switch_needed && !need_pipe_sync) 685 689 return 0; 686 690 ··· 746 742 amdgpu_ring_emit_switch_buffer(ring); 747 743 amdgpu_ring_emit_switch_buffer(ring); 748 744 } 745 + 749 746 amdgpu_ring_ib_end(ring); 750 747 return 0; 751 748 }