Lines Matching refs:mgr
10 int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
27 err = xa_alloc(&mgr->handles, id, ctx, xa_limit_32b, GFP_KERNEL);
53 int lima_ctx_free(struct lima_ctx_mgr *mgr, u32 id)
58 mutex_lock(&mgr->lock);
59 ctx = xa_erase(&mgr->handles, id);
64 mutex_unlock(&mgr->lock);
68 struct lima_ctx *lima_ctx_get(struct lima_ctx_mgr *mgr, u32 id)
72 mutex_lock(&mgr->lock);
73 ctx = xa_load(&mgr->handles, id);
76 mutex_unlock(&mgr->lock);
85 void lima_ctx_mgr_init(struct lima_ctx_mgr *mgr)
87 mutex_init(&mgr->lock);
88 xa_init_flags(&mgr->handles, XA_FLAGS_ALLOC);
91 void lima_ctx_mgr_fini(struct lima_ctx_mgr *mgr)
96 xa_for_each(&mgr->handles, id, ctx) {
100 xa_destroy(&mgr->handles);
101 mutex_destroy(&mgr->lock);