drm/amdgpu: Add helper function amdgpu_ring_set_preempt_cond_exec
authorRex Zhu <Rex.Zhu@amd.com>
Mon, 8 Oct 2018 06:55:42 +0000 (14:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 14:30:39 +0000 (09:30 -0500)
can preempt the ring by setting cond_exec to false

Acked-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h

index cdddce938bf59dea7909dd56a066b8303e400b3c..764bf851c1dfc227cc6593e3dcef14aba6199942 100644 (file)
@@ -266,6 +266,12 @@ void amdgpu_ring_emit_reg_write_reg_wait_helper(struct amdgpu_ring *ring,
 bool amdgpu_ring_soft_recovery(struct amdgpu_ring *ring, unsigned int vmid,
                               struct dma_fence *fence);
 
+static inline void amdgpu_ring_set_preempt_cond_exec(struct amdgpu_ring *ring,
+                                                       bool cond_exec)
+{
+       *ring->cond_exe_cpu_addr = cond_exec;
+}
+
 static inline void amdgpu_ring_clear_ring(struct amdgpu_ring *ring)
 {
        int i = 0;