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

drm/amdgpu: Enforce isolation as part of the job

This patch adds a new parameter 'enforce_isolation' to the amdgpu_job
structure. This parameter is used to determine whether shader isolation
should be enforced for a job. The enforce_isolation parameter is then
stored in the amdgpu_job structure and used when flushing the VM.

The enforce_isolation field of the amdgpu_job structure is set directly
after the job is allocated

This change allows more fine-grained control over shader isolation,
making it possible to enforce isolation on a per-job basis rather than
globally. This can be useful in scenarios where only certain jobs
require isolation.

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>

authored by

Srinivasan Shanmugam and committed by
Alex Deucher
dba1a6cf 19cff165

+6 -1
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
··· 296 296 num_ibs[i], &p->jobs[i]); 297 297 if (ret) 298 298 goto free_all_kdata; 299 + p->jobs[i]->enforce_isolation = p->adev->enforce_isolation[fpriv->xcp_id]; 299 300 } 300 301 p->gang_leader = p->jobs[p->gang_leader_idx]; 301 302
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_job.h
··· 76 76 /* job_run_counter >= 1 means a resubmit job */ 77 77 uint32_t job_run_counter; 78 78 79 + /* enforce isolation */ 80 + bool enforce_isolation; 81 + 79 82 uint32_t num_ibs; 80 83 struct amdgpu_ib ibs[]; 81 84 };
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 682 682 ring->funcs->emit_wreg; 683 683 684 684 if (adev->gfx.enable_cleaner_shader && 685 - ring->funcs->emit_cleaner_shader) 685 + ring->funcs->emit_cleaner_shader && 686 + job->enforce_isolation) 686 687 ring->funcs->emit_cleaner_shader(ring); 687 688 688 689 if (!vm_flush_needed && !gds_switch_needed && !need_pipe_sync)