drm/amdgpu: grab an additional reference on the gang fence
Subsystems (3)
PATCH 1/6 drm/amdgpu: grab an additional reference on the gang fence
We keep the gang submission fence around in adev, make sure that it stays alive.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
@@ -6753,6 +6753,7 @@ struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev, {struct dma_fence *old =NULL ; +dma_fence_get (gang); do { dma_fence_put(old); old = amdgpu_device_get_gang(adev);
@@ -6765,6 +6766,7 @@ struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev, }while (cmpxchg ((struct dma_fence __force **)&adev->gang_submit, old, gang) != old); +dma_fence_put (old);dma_fence_put (old);return NULL ; }
Signature · 1 line
2.34.1
PATCH 2/6 drm/amdgpu: use GFP_NOWAIT for memory allocations
In the critical submission path memory allocations can't wait for reclaim since that can potentially wait for submissions to finish.
Finally clean that up and mark most memory allocations in the critical path with GFP_NOWAIT. The only exception left is the dma_fence_array() used when no VMID is available, but that will be cleaned up later on.
--- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 18 +++++++++++------- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 11 +++++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 11 ++++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 4 ++-- 7 files changed, 34 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +4 -4
@@ -499,7 +499,7 @@ static int vm_update_pds(struct amdgpu_vm *vm, struct amdgpu_sync *sync)if (ret)return ret; -return amdgpu_sync_fence (sync, vm->last_update); +return amdgpu_sync_fence (sync, vm->last_update,GFP_KERNEL ); }static uint64_t get_pte_flags (struct amdgpu_device *adev,struct kgd_mem *mem)
@@ -1263,7 +1263,7 @@ static int unmap_bo_from_gpuvm(struct kgd_mem *mem, (void )amdgpu_vm_clear_freed (adev, vm, &bo_va->last_pt_update); - (void )amdgpu_sync_fence (sync, bo_va->last_pt_update); + (void )amdgpu_sync_fence (sync, bo_va->last_pt_update,GFP_KERNEL );return 0 ; }
@@ -1287,7 +1287,7 @@ static int update_gpuvm_pte(struct kgd_mem *mem,return ret; } -return amdgpu_sync_fence (sync, bo_va->last_pt_update); +return amdgpu_sync_fence (sync, bo_va->last_pt_update,GFP_KERNEL ); } static int map_bo_to_gpuvm(struct kgd_mem *mem,
@@ -2948,7 +2948,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence __rcu * }dma_resv_for_each_fence (&cursor, bo->tbo.base.resv,DMA_RESV_USAGE_KERNEL , fence) { - ret =amdgpu_sync_fence (&sync_obj, fence); + ret =amdgpu_sync_fence (&sync_obj, fence,GFP_KERNEL );if (ret) {pr_debug ("Memory eviction: Sync BO fence failed. Try again\n" ); goto validate_map_fail;
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +11 -7
@@ -428,7 +428,7 @@ static int amdgpu_cs_p2_dependencies(struct amdgpu_cs_parser *p,dma_fence_put (old); } - r =amdgpu_sync_fence (&p->sync, fence); + r =amdgpu_sync_fence (&p->sync, fence,GFP_KERNEL );dma_fence_put (fence);if (r)return r;
@@ -450,7 +450,7 @@ static int amdgpu_syncobj_lookup_and_add(struct amdgpu_cs_parser *p,return r; } - r =amdgpu_sync_fence (&p->sync, fence); + r =amdgpu_sync_fence (&p->sync, fence,GFP_KERNEL );dma_fence_put (fence);return r; }
@@ -1124,7 +1124,8 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)if (r)return r; - r =amdgpu_sync_fence (&p->sync, fpriv->prt_va->last_pt_update); + r =amdgpu_sync_fence (&p->sync, fpriv->prt_va->last_pt_update, +GFP_KERNEL );if (r)return r;
@@ -1135,7 +1136,8 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)if (r)return r; - r =amdgpu_sync_fence (&p->sync, bo_va->last_pt_update); + r =amdgpu_sync_fence (&p->sync, bo_va->last_pt_update, +GFP_KERNEL );if (r)return r; }
@@ -1154,7 +1156,8 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)if (r)return r; - r =amdgpu_sync_fence (&p->sync, bo_va->last_pt_update); + r =amdgpu_sync_fence (&p->sync, bo_va->last_pt_update, +GFP_KERNEL );if (r)return r; }
@@ -1167,7 +1170,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)if (r)return r; - r =amdgpu_sync_fence (&p->sync, vm->last_update); + r =amdgpu_sync_fence (&p->sync, vm->last_update,GFP_KERNEL );if (r)return r;
@@ -1248,7 +1251,8 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser *p)continue ; } - r =amdgpu_sync_fence (&p->gang_leader->explicit_sync, fence); + r =amdgpu_sync_fence (&p->gang_leader->explicit_sync, fence, +GFP_KERNEL );dma_fence_put (fence);if (r)return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +7 -4
@@ -209,7 +209,7 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_ring *ring,return 0 ; } - fences =kmalloc_array (id_mgr->num_ids,sizeof (void *),GFP_KERNEL ); + fences =kmalloc_array (id_mgr->num_ids,sizeof (void *),GFP_NOWAIT );if (!fences)return -ENOMEM ;
@@ -326,7 +326,8 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm,/* Good we can use this VMID. Remember this submission as * user of the VMID. */ - r =amdgpu_sync_fence (&(*id)->active, &job->base.s_fence->finished); + r =amdgpu_sync_fence (&(*id)->active, &job->base.s_fence->finished, +GFP_NOWAIT );if (r)return r;
@@ -385,7 +386,8 @@ static int amdgpu_vmid_grab_used(struct amdgpu_vm *vm,* user of the VMID. */ r =amdgpu_sync_fence (&(*id)->active, - &job->base.s_fence->finished); + &job->base.s_fence->finished, +GFP_NOWAIT );if (r)return r;
@@ -437,7 +439,8 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,/* Remember this submission as user of the VMID */ r =amdgpu_sync_fence (&id->active, - &job->base.s_fence->finished); + &job->base.s_fence->finished, +GFP_NOWAIT );if (r) goto error;
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +2 -2
@@ -1332,14 +1332,14 @@ int amdgpu_mes_ctx_map_meta_data(struct amdgpu_device *adev,DRM_ERROR ("failed to do vm_bo_update on meta data\n" ); goto error_del_bo_va; } -amdgpu_sync_fence (&sync, bo_va->last_pt_update); +amdgpu_sync_fence (&sync, bo_va->last_pt_update,GFP_KERNEL ); r =amdgpu_vm_update_pdes (adev, vm, false);if (r) {DRM_ERROR ("failed to update pdes on meta data\n" ); goto error_del_bo_va; } -amdgpu_sync_fence (&sync, vm->last_update); +amdgpu_sync_fence (&sync, vm->last_update,GFP_KERNEL );amdgpu_sync_wait (&sync, false);drm_exec_fini (&exec);
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +6 -5
@@ -152,7 +152,8 @@ static bool amdgpu_sync_add_later(struct amdgpu_sync *sync, struct dma_fence *f)* * Add the fence to the sync object. */ -int amdgpu_sync_fence (struct amdgpu_sync *sync,struct dma_fence *f) +int amdgpu_sync_fence (struct amdgpu_sync *sync,struct dma_fence *f, +gfp_t flags) {struct amdgpu_sync_entry *e;
@@ -162,7 +163,7 @@ int amdgpu_sync_fence(struct amdgpu_sync *sync, struct dma_fence *f)if (amdgpu_sync_add_later (sync, f))return 0 ; - e =kmem_cache_alloc (amdgpu_sync_slab,GFP_KERNEL ); + e =kmem_cache_alloc (amdgpu_sync_slab, flags);if (!e)return -ENOMEM ;
@@ -249,7 +250,7 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync,struct dma_fence *tmp =dma_fence_chain_contained (f);if (amdgpu_sync_test_fence (adev, mode, owner, tmp)) { - r =amdgpu_sync_fence (sync, f); + r =amdgpu_sync_fence (sync, f,GFP_KERNEL );dma_fence_put (f);if (r)return r;
@@ -281,7 +282,7 @@ int amdgpu_sync_kfd(struct amdgpu_sync *sync, struct dma_resv *resv)if (fence_owner !=AMDGPU_FENCE_OWNER_KFD )continue ; - r =amdgpu_sync_fence (sync, f); + r =amdgpu_sync_fence (sync, f,GFP_KERNEL );if (r)break ; }
@@ -388,7 +389,7 @@ int amdgpu_sync_clone(struct amdgpu_sync *source, struct amdgpu_sync *clone)hash_for_each_safe (source->fences, i, tmp, e, node) { f = e->fence;if (!dma_fence_is_signaled (f)) { - r =amdgpu_sync_fence (clone, f); + r =amdgpu_sync_fence (clone, f,GFP_KERNEL );if (r)return r; }else {
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.h +2 -1
@@ -47,7 +47,8 @@ struct amdgpu_sync { };void amdgpu_sync_create (struct amdgpu_sync *sync); -int amdgpu_sync_fence (struct amdgpu_sync *sync,struct dma_fence *f); +int amdgpu_sync_fence (struct amdgpu_sync *sync,struct dma_fence *f, +gfp_t flags);int amdgpu_sync_resv (struct amdgpu_device *adev,struct amdgpu_sync *sync,struct dma_resv *resv,enum amdgpu_sync_mode mode,void *owner);
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +2 -2
@@ -120,13 +120,13 @@ static int map_ring_data(struct amdgpu_device *adev, struct amdgpu_vm *vm,if (r) goto error_del_bo_va; -amdgpu_sync_fence (&sync, (*bo_va)->last_pt_update); +amdgpu_sync_fence (&sync, (*bo_va)->last_pt_update,GFP_KERNEL ); r =amdgpu_vm_update_pdes (adev, vm, false);if (r) goto error_del_bo_va; -amdgpu_sync_fence (&sync, vm->last_update); +amdgpu_sync_fence (&sync, vm->last_update,GFP_KERNEL );amdgpu_sync_wait (&sync, false);drm_exec_fini (&exec);
Signature · 1 line
2.34.1
PATCH 3/6 drm/amdgpu: overwrite signaled fence in amdgpu_sync
In reply to Christian KönigThis allows using amdgpu_sync even without peeking into the fences for a long time.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +9 -4
@@ -135,11 +135,16 @@ static bool amdgpu_sync_add_later(struct amdgpu_sync *sync, struct dma_fence *f)struct amdgpu_sync_entry *e;hash_for_each_possible (sync->fences, e, node, f->context) { -if (unlikely (e->fence->context != f->context)) -continue ; +if (dma_fence_is_signaled (e->fence)) { +dma_fence_put (e->fence); + e->fence =dma_fence_get (f); +return true; + } -amdgpu_sync_keep_later (&e->fence, f); -return true; +if (likely (e->fence->context == f->context)) { +amdgpu_sync_keep_later (&e->fence, f); +return true; + } }return false; }
Signature · 1 line
2.34.1
PATCH 4/6 drm/amdgpu: rework how isolation is enforced
In reply to Christian KönigLimiting the number of available VMIDs to enforce isolation causes some issues with gang submit and applying certain HW workarounds which require multiple VMIDs to work correctly.
So instead start to track all submissions to the relevant engines in a per partition data structure and use the dma_fences of the submissions to enforce isolation similar to what a VMID limit does.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 13 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 94 +++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 43 ++++------ drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 16 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 19 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_sync.h | 1 + 6 files changed, 151 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +11 -2
@@ -1204,9 +1204,15 @@ struct amdgpu_device {bool debug_enable_ras_aca;bool debug_exp_resets; -bool enforce_isolation[MAX_XCP ]; -/* Added this mutex for cleaner shader isolation between GFX and compute processes */ +/* Protection for the following isolation structure */ struct mutex enforce_isolation_mutex; +bool enforce_isolation[MAX_XCP ]; +struct amdgpu_isolation { +void *owner; +struct dma_fence *spearhead; +struct amdgpu_sync active; +struct amdgpu_sync prev; + } isolation[MAX_XCP ];struct amdgpu_init_level *init_lvl; };
@@ -1487,6 +1493,9 @@ void amdgpu_device_pcie_port_wreg(struct amdgpu_device *adev,struct dma_fence *amdgpu_device_get_gang (struct amdgpu_device *adev);struct dma_fence *amdgpu_device_switch_gang (struct amdgpu_device *adev,struct dma_fence *gang); +struct dma_fence *amdgpu_device_enforce_isolation (struct amdgpu_device *adev, +struct amdgpu_ring *ring, +struct amdgpu_job *job);bool amdgpu_device_has_display_hardware (struct amdgpu_device *adev);ssize_t amdgpu_get_soft_full_reset_mask (struct amdgpu_ring *ring);ssize_t amdgpu_show_reset_mask (char *buf,uint32_t supported_reset);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +93 -1
118 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +15 -28
55 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +12 -4
@@ -342,17 +342,24 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, {struct amdgpu_ring *ring =to_amdgpu_ring (s_entity->rq->sched);struct amdgpu_job *job =to_amdgpu_job (sched_job); -struct dma_fence *fence =NULL ; +struct dma_fence *fence;int r; r =drm_sched_entity_error (s_entity);if (r) goto error; -if (job->gang_submit) +if (job->gang_submit) { fence =amdgpu_device_switch_gang (ring->adev, job->gang_submit); +if (fence) +return fence; + } + + fence =amdgpu_device_enforce_isolation (ring->adev, ring, job); +if (fence) +return fence; -if (!fence && job->vm && !job->vmid) { +if (job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err (ring->adev->dev,"Error getting VM ID (%d)\n" , r);
@@ -365,9 +372,10 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,*/ if (!fence) job->vm =NULL ; +return fence; } -return fence; +return NULL ; error:dma_fence_set_error (&job->base.s_fence->finished, r);
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +19 -0
@@ -405,6 +405,25 @@ int amdgpu_sync_clone(struct amdgpu_sync *source, struct amdgpu_sync *clone)return 0 ; } +/** +* amdgpu_sync_move - move all fences from src to dst +* +* @src: source of the fences, empty after function +* @dst: destination for the fences +* +* Moves all fences from source to destination. All fences in destination are +* freed and source is empty after the function call. +*/ +void amdgpu_sync_move (struct amdgpu_sync *src,struct amdgpu_sync *dst) +{ +unsigned int i; + +amdgpu_sync_free (dst); + +for (i =0 ; i <HASH_SIZE (src->fences); ++i) +hlist_move_list (&src->fences[i], &dst->fences[i]); +} +/** * amdgpu_sync_push_to_job - push fences into job * @sync: sync object to get the fences from
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.h +1 -0
@@ -57,6 +57,7 @@ struct dma_fence *amdgpu_sync_peek_fence(struct amdgpu_sync *sync, struct amdgpu_ring *ring);struct dma_fence *amdgpu_sync_get_fence (struct amdgpu_sync *sync);int amdgpu_sync_clone (struct amdgpu_sync *source,struct amdgpu_sync *clone); +void amdgpu_sync_move (struct amdgpu_sync *src,struct amdgpu_sync *dst);int amdgpu_sync_push_to_job (struct amdgpu_sync *sync,struct amdgpu_job *job);int amdgpu_sync_wait (struct amdgpu_sync *sync,bool intr);void amdgpu_sync_free (struct amdgpu_sync *sync);
Signature · 1 line
2.34.1
PATCH 5/6 drm/amdgpu: rework how the cleaner shader is emitted
In reply to Christian KönigInstead of emitting the cleaner shader for every job which has the enforce_isolation flag set only emit it for the first submission from every client.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +20 -5
@@ -643,6 +643,7 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, bool need_pipe_sync) {struct amdgpu_device *adev = ring->adev; +struct amdgpu_isolation *isolation = &adev->isolation[ring->xcp_id];unsigned vmhub = ring->vm_hub;struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];struct amdgpu_vmid *id = &id_mgr->ids[job->vmid];
@@ -650,8 +651,9 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job,bool gds_switch_needed = ring->funcs->emit_gds_switch && job->gds_switch_needed;bool vm_flush_needed = job->vm_needs_flush; -struct dma_fence *fence =NULL ; +bool cleaner_shader_needed = false;bool pasid_mapping_needed = false; +struct dma_fence *fence =NULL ;unsigned int patch;int r;
@@ -674,8 +676,12 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, pasid_mapping_needed &= adev->gmc.gmc_funcs->emit_pasid_mapping && ring->funcs->emit_wreg; + cleaner_shader_needed = adev->gfx.enable_cleaner_shader && + ring->funcs->emit_cleaner_shader && + &job->base.s_fence->scheduled == isolation->spearhead; +if (!vm_flush_needed && !gds_switch_needed && !need_pipe_sync && - !(job->enforce_isolation && !job->vmid)) + !cleaner_shader_needed)return 0 ;amdgpu_ring_ib_begin (ring);
@@ -686,9 +692,7 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job,if (need_pipe_sync)amdgpu_ring_emit_pipeline_sync (ring); -if (adev->gfx.enable_cleaner_shader && - ring->funcs->emit_cleaner_shader && - job->enforce_isolation) +if (cleaner_shader_needed) ring->funcs->emit_cleaner_shader (ring);if (vm_flush_needed) {
@@ -732,6 +736,17 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, id->pasid_mapping =dma_fence_get (fence);mutex_unlock (&id_mgr->lock); } + +/* +* Make sure that all other submissions wait for the cleaner shader to +* finish before we push them to the HW. +*/ +if (cleaner_shader_needed) { +mutex_lock (&adev->enforce_isolation_mutex); +dma_fence_put (isolation->spearhead); + isolation->spearhead =dma_fence_get (fence); +mutex_unlock (&adev->enforce_isolation_mutex); + }dma_fence_put (fence);amdgpu_ring_patch_cond_exec (ring, patch);
Signature · 1 line
2.34.1
PATCH 6/6 drm/amdgpu: stop reserving VMIDs to enforce isolation
In reply to Christian KönigThat was quite troublesome for gang submit. Completely drop this approach and enforce the isolation separately.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 9 ++------- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 11 +++-------- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h | 3 +-- 4 files changed, 7 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -1
@@ -1111,7 +1111,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)struct drm_gpu_scheduler *sched = entity->rq->sched;struct amdgpu_ring *ring =to_amdgpu_ring (sched); -if (amdgpu_vmid_uses_reserved (adev, vm, ring->vm_hub)) +if (amdgpu_vmid_uses_reserved (vm, ring->vm_hub))return -EINVAL ; } }
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -7
@@ -1640,15 +1640,10 @@ static ssize_t amdgpu_gfx_set_enforce_isolation(struct device *dev,mutex_lock (&adev->enforce_isolation_mutex);for (i =0 ; i < num_partitions; i++) { -if (adev->enforce_isolation[i] && !partition_values[i]) { -/* Going from enabled to disabled */ -amdgpu_vmid_free_reserved (adev,AMDGPU_GFXHUB (i)); +if (adev->enforce_isolation[i] && !partition_values[i])amdgpu_mes_set_enforce_isolation (adev, i, false); - }else if (!adev->enforce_isolation[i] && partition_values[i]) { -/* Going from disabled to enabled */ -amdgpu_vmid_alloc_reserved (adev,AMDGPU_GFXHUB (i)); +else if (!adev->enforce_isolation[i] && partition_values[i])amdgpu_mes_set_enforce_isolation (adev, i, true); - } adev->enforce_isolation[i] = partition_values[i]; }
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +3 -8
@@ -411,7 +411,7 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,if (r || !idle) goto error; -if (amdgpu_vmid_uses_reserved (adev, vm, vmhub)) { +if (amdgpu_vmid_uses_reserved (vm, vmhub)) { r =amdgpu_vmid_grab_reserved (vm, ring, job, &id, fence);if (r || !id) goto error;
@@ -464,19 +464,14 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,/* * amdgpu_vmid_uses_reserved - check if a VM will use a reserved VMID -* @adev: amdgpu_device pointer * @vm: the VM to check * @vmhub: the VMHUB which will be used * * Returns: True if the VM will use a reserved VMID. */ -bool amdgpu_vmid_uses_reserved (struct amdgpu_device *adev, -struct amdgpu_vm *vm,unsigned int vmhub) +bool amdgpu_vmid_uses_reserved (struct amdgpu_vm *vm,unsigned int vmhub) { -return vm->reserved_vmid[vmhub] || - (adev->enforce_isolation[(vm->root.bo->xcp_id !=AMDGPU_XCP_NO_PARTITION ) ? - vm->root.bo->xcp_id :0 ] && -AMDGPU_IS_GFXHUB (vmhub)); +return vm->reserved_vmid[vmhub]; } int amdgpu_vmid_alloc_reserved(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h +1 -2
@@ -78,8 +78,7 @@ void amdgpu_pasid_free_delayed(struct dma_resv *resv,bool amdgpu_vmid_had_gpu_reset (struct amdgpu_device *adev,struct amdgpu_vmid *id); -bool amdgpu_vmid_uses_reserved (struct amdgpu_device *adev, -struct amdgpu_vm *vm,unsigned int vmhub); +bool amdgpu_vmid_uses_reserved (struct amdgpu_vm *vm,unsigned int vmhub);int amdgpu_vmid_alloc_reserved (struct amdgpu_device *adev,unsigned vmhub); void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,
Signature · 1 line
2.34.1