Lines Matching refs:mgr

90 	struct amdgpu_ctx_mgr *mgr = &fpriv->ctx_mgr;  in amdgpu_ctx_alloc()  local
98 mutex_lock(&mgr->lock); in amdgpu_ctx_alloc()
99 r = idr_alloc(&mgr->ctx_handles, ctx, 1, 0, GFP_KERNEL); in amdgpu_ctx_alloc()
101 mutex_unlock(&mgr->lock); in amdgpu_ctx_alloc()
107 mutex_unlock(&mgr->lock); in amdgpu_ctx_alloc()
125 struct amdgpu_ctx_mgr *mgr = &fpriv->ctx_mgr; in amdgpu_ctx_free() local
128 mutex_lock(&mgr->lock); in amdgpu_ctx_free()
129 ctx = idr_find(&mgr->ctx_handles, id); in amdgpu_ctx_free()
131 idr_remove(&mgr->ctx_handles, id); in amdgpu_ctx_free()
133 mutex_unlock(&mgr->lock); in amdgpu_ctx_free()
136 mutex_unlock(&mgr->lock); in amdgpu_ctx_free()
145 struct amdgpu_ctx_mgr *mgr; in amdgpu_ctx_query() local
151 mgr = &fpriv->ctx_mgr; in amdgpu_ctx_query()
152 mutex_lock(&mgr->lock); in amdgpu_ctx_query()
153 ctx = idr_find(&mgr->ctx_handles, id); in amdgpu_ctx_query()
155 mutex_unlock(&mgr->lock); in amdgpu_ctx_query()
172 mutex_unlock(&mgr->lock); in amdgpu_ctx_query()
210 struct amdgpu_ctx_mgr *mgr; in amdgpu_ctx_get() local
215 mgr = &fpriv->ctx_mgr; in amdgpu_ctx_get()
217 mutex_lock(&mgr->lock); in amdgpu_ctx_get()
218 ctx = idr_find(&mgr->ctx_handles, id); in amdgpu_ctx_get()
221 mutex_unlock(&mgr->lock); in amdgpu_ctx_get()
288 void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr) in amdgpu_ctx_mgr_init() argument
290 mutex_init(&mgr->lock); in amdgpu_ctx_mgr_init()
291 idr_init(&mgr->ctx_handles); in amdgpu_ctx_mgr_init()
294 void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr) in amdgpu_ctx_mgr_fini() argument
300 idp = &mgr->ctx_handles; in amdgpu_ctx_mgr_fini()
307 idr_destroy(&mgr->ctx_handles); in amdgpu_ctx_mgr_fini()
308 mutex_destroy(&mgr->lock); in amdgpu_ctx_mgr_fini()