Skip to contentSkip to conversation

drm/amdgpu: always sync the GFX pipe on ctx switch

PATCH In review Christian König 2 participants 2 messages Jan 8, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: always sync the GFX pipe on ctx switch

That is needed to enforce isolation between contexts.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -2
index d751995dc131..e0bc37557d2c 100644
@@ -191,8 +191,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
 	need_ctx_switch = ring->current_ctx != fence_ctx;
 	if (ring->funcs->emit_pipeline_sync && job &&
 	    ((tmp = amdgpu_sync_get_fence(&job->explicit_sync)) ||
-	     (amdgpu_sriov_vf(adev) && need_ctx_switch) ||
-	     amdgpu_vm_need_pipeline_sync(ring, job))) {
+	     need_ctx_switch || amdgpu_vm_need_pipeline_sync(ring, job))) {
+
 		need_pipe_sync = true;
 
 		if (tmp)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Christian König

That is needed to enforce isolation between contexts.

Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -3
index d751995dc131..e0bc37557d2c 100644
@@ -191,8 +191,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
        need_ctx_switch = ring->current_ctx != fence_ctx;
        if (ring->funcs->emit_pipeline_sync && job &&
            ((tmp = amdgpu_sync_get_fence(&job->explicit_sync)) ||
-            (amdgpu_sriov_vf(adev) && need_ctx_switch) ||
-            amdgpu_vm_need_pipeline_sync(ring, job))) {
+            need_ctx_switch || amdgpu_vm_need_pipeline_sync(ring, job))) {
+
                need_pipe_sync = true;
 
                if (tmp)
--

2.34.1