Lines Matching refs:ctx
12 struct lima_ctx *ctx;
15 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
16 if (!ctx)
18 ctx->dev = dev;
19 kref_init(&ctx->refcnt);
22 err = lima_sched_context_init(dev->pipe + i, ctx->context + i);
27 err = xa_alloc(&mgr->handles, id, ctx, xa_limit_32b, GFP_KERNEL);
31 ctx->pid = task_pid_nr(current);
32 get_task_comm(ctx->pname, current);
38 lima_sched_context_fini(dev->pipe + i, ctx->context + i);
39 kfree(ctx);
45 struct lima_ctx *ctx = container_of(ref, struct lima_ctx, refcnt);
49 lima_sched_context_fini(ctx->dev->pipe + i, ctx->context + i);
50 kfree(ctx);
55 struct lima_ctx *ctx;
59 ctx = xa_erase(&mgr->handles, id);
60 if (ctx)
61 kref_put(&ctx->refcnt, lima_ctx_do_release);
70 struct lima_ctx *ctx;
73 ctx = xa_load(&mgr->handles, id);
74 if (ctx)
75 kref_get(&ctx->refcnt);
77 return ctx;
80 void lima_ctx_put(struct lima_ctx *ctx)
82 kref_put(&ctx->refcnt, lima_ctx_do_release);
93 struct lima_ctx *ctx;
96 xa_for_each(&mgr->handles, id, ctx) {
97 kref_put(&ctx->refcnt, lima_ctx_do_release);