Lines Matching refs:mgr
9 int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id) in lima_ctx_create() argument
26 err = xa_alloc(&mgr->handles, id, ctx, xa_limit_32b, GFP_KERNEL); in lima_ctx_create()
52 int lima_ctx_free(struct lima_ctx_mgr *mgr, u32 id) in lima_ctx_free() argument
57 mutex_lock(&mgr->lock); in lima_ctx_free()
58 ctx = xa_erase(&mgr->handles, id); in lima_ctx_free()
63 mutex_unlock(&mgr->lock); in lima_ctx_free()
67 struct lima_ctx *lima_ctx_get(struct lima_ctx_mgr *mgr, u32 id) in lima_ctx_get() argument
71 mutex_lock(&mgr->lock); in lima_ctx_get()
72 ctx = xa_load(&mgr->handles, id); in lima_ctx_get()
75 mutex_unlock(&mgr->lock); in lima_ctx_get()
84 void lima_ctx_mgr_init(struct lima_ctx_mgr *mgr) in lima_ctx_mgr_init() argument
86 mutex_init(&mgr->lock); in lima_ctx_mgr_init()
87 xa_init_flags(&mgr->handles, XA_FLAGS_ALLOC); in lima_ctx_mgr_init()
90 void lima_ctx_mgr_fini(struct lima_ctx_mgr *mgr) in lima_ctx_mgr_fini() argument
95 xa_for_each(&mgr->handles, id, ctx) { in lima_ctx_mgr_fini()
99 xa_destroy(&mgr->handles); in lima_ctx_mgr_fini()
100 mutex_destroy(&mgr->lock); in lima_ctx_mgr_fini()