Lines Matching refs:evf_mgr

29 #define evf_mgr_to_fpriv(e) container_of(e, struct amdgpu_fpriv, evf_mgr)
47 amdgpu_eviction_fence_replace_fence(struct amdgpu_eviction_fence_mgr *evf_mgr, in amdgpu_eviction_fence_replace_fence() argument
55 if (evf_mgr->ev_fence && in amdgpu_eviction_fence_replace_fence()
56 !dma_fence_is_signaled(&evf_mgr->ev_fence->base)) in amdgpu_eviction_fence_replace_fence()
67 new_ef = amdgpu_eviction_fence_create(evf_mgr); in amdgpu_eviction_fence_replace_fence()
74 spin_lock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_replace_fence()
75 old_ef = evf_mgr->ev_fence; in amdgpu_eviction_fence_replace_fence()
76 evf_mgr->ev_fence = new_ef; in amdgpu_eviction_fence_replace_fence()
77 spin_unlock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_replace_fence()
85 ret = amdgpu_eviction_fence_attach(evf_mgr, bo); in amdgpu_eviction_fence_replace_fence()
105 struct amdgpu_eviction_fence_mgr *evf_mgr = work_to_evf_mgr(work, suspend_work.work); in amdgpu_eviction_fence_suspend_worker() local
106 struct amdgpu_fpriv *fpriv = evf_mgr_to_fpriv(evf_mgr); in amdgpu_eviction_fence_suspend_worker()
111 spin_lock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_suspend_worker()
112 ev_fence = evf_mgr->ev_fence; in amdgpu_eviction_fence_suspend_worker()
117 spin_unlock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_suspend_worker()
126 spin_unlock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_suspend_worker()
132 struct amdgpu_eviction_fence_mgr *evf_mgr; in amdgpu_eviction_fence_enable_signaling() local
139 evf_mgr = ev_fence->evf_mgr; in amdgpu_eviction_fence_enable_signaling()
141 schedule_delayed_work(&evf_mgr->suspend_work, 0); in amdgpu_eviction_fence_enable_signaling()
151 void amdgpu_eviction_fence_signal(struct amdgpu_eviction_fence_mgr *evf_mgr, in amdgpu_eviction_fence_signal() argument
154 spin_lock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_signal()
156 spin_unlock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_signal()
160 amdgpu_eviction_fence_create(struct amdgpu_eviction_fence_mgr *evf_mgr) in amdgpu_eviction_fence_create() argument
168 ev_fence->evf_mgr = evf_mgr; in amdgpu_eviction_fence_create()
172 &ev_fence->lock, evf_mgr->ev_fence_ctx, in amdgpu_eviction_fence_create()
173 atomic_inc_return(&evf_mgr->ev_fence_seq)); in amdgpu_eviction_fence_create()
177 void amdgpu_eviction_fence_destroy(struct amdgpu_eviction_fence_mgr *evf_mgr) in amdgpu_eviction_fence_destroy() argument
182 flush_delayed_work(&evf_mgr->suspend_work); in amdgpu_eviction_fence_destroy()
184 spin_lock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_destroy()
185 ev_fence = evf_mgr->ev_fence; in amdgpu_eviction_fence_destroy()
186 spin_unlock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_destroy()
197 int amdgpu_eviction_fence_attach(struct amdgpu_eviction_fence_mgr *evf_mgr, in amdgpu_eviction_fence_attach() argument
213 spin_lock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_attach()
214 ev_fence = evf_mgr->ev_fence; in amdgpu_eviction_fence_attach()
217 spin_unlock(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_attach()
222 void amdgpu_eviction_fence_detach(struct amdgpu_eviction_fence_mgr *evf_mgr, in amdgpu_eviction_fence_detach() argument
227 dma_resv_replace_fences(bo->tbo.base.resv, evf_mgr->ev_fence_ctx, in amdgpu_eviction_fence_detach()
232 int amdgpu_eviction_fence_init(struct amdgpu_eviction_fence_mgr *evf_mgr) in amdgpu_eviction_fence_init() argument
235 atomic_set(&evf_mgr->ev_fence_seq, 0); in amdgpu_eviction_fence_init()
236 evf_mgr->ev_fence_ctx = dma_fence_context_alloc(1); in amdgpu_eviction_fence_init()
237 spin_lock_init(&evf_mgr->ev_fence_lock); in amdgpu_eviction_fence_init()
239 INIT_DELAYED_WORK(&evf_mgr->suspend_work, amdgpu_eviction_fence_suspend_worker); in amdgpu_eviction_fence_init()