No intended functional change.  Needed to help separate
the IB scheduling and emit logic.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c  | 7 +++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index 17176e51c0398..036a9fb4e1ca3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -126,7 +126,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, struct 
amdgpu_job *job,
        struct amdgpu_ib *ib;
        struct dma_fence *tmp = NULL;
        struct amdgpu_fence *af;
-       bool need_ctx_switch;
        struct amdgpu_vm *vm;
        uint64_t fence_ctx;
        uint32_t status = 0, alloc_size;
@@ -185,10 +184,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, struct 
amdgpu_job *job,
                return r;
        }
 
-       need_ctx_switch = ring->current_ctx != fence_ctx;
+       job->need_ctx_switch = ring->current_ctx != fence_ctx;
        if (ring->funcs->emit_pipeline_sync && job &&
            ((tmp = amdgpu_sync_get_fence(&job->explicit_sync)) ||
-            need_ctx_switch || amdgpu_vm_need_pipeline_sync(ring, job))) {
+            job->need_ctx_switch || amdgpu_vm_need_pipeline_sync(ring, job))) {
 
                job->need_pipe_sync = true;
                job->pipe_sync_seq = ring->fence_drv.sync_seq;
@@ -227,7 +226,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, struct 
amdgpu_job *job,
 
        amdgpu_device_flush_hdp(adev, ring);
 
-       if (need_ctx_switch)
+       if (job->need_ctx_switch)
                status |= AMDGPU_HAVE_CTX_SWITCH;
 
        if (ring->funcs->emit_cntxcntl) {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
index 908239d45bd3f..21e1941ce356a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
@@ -104,6 +104,7 @@ struct amdgpu_job {
        /* job state */
        bool                    need_pipe_sync;
        u32                     pipe_sync_seq;
+       bool                    need_ctx_switch;
 
        uint32_t                num_ibs;
        struct amdgpu_ib        ibs[];
-- 
2.52.0

Reply via email to