Lines Matching refs:context

31 static void tegra_drm_channel_context_close(struct tegra_drm_context *context)
36 if (context->memory_context)
37 host1x_memory_context_put(context->memory_context);
39 xa_for_each(&context->mappings, id, mapping)
42 xa_destroy(&context->mappings);
44 host1x_channel_put(context->channel);
46 kfree(context);
51 struct tegra_drm_context *context;
55 xa_for_each(&file->contexts, id, context)
56 tegra_drm_channel_context_close(context);
83 struct tegra_drm_context *context;
89 context = kzalloc(sizeof(*context), GFP_KERNEL);
90 if (!context)
100 context->channel = host1x_channel_get(client->shared_channel);
102 context->channel = host1x_channel_request(&client->base);
103 if (!context->channel) {
109 /* Only allocate context if the engine supports context isolation. */
118 context->memory_context = host1x_memory_context_alloc(
121 if (IS_ERR(context->memory_context)) {
122 if (PTR_ERR(context->memory_context) != -EOPNOTSUPP) {
123 err = PTR_ERR(context->memory_context);
130 context->memory_context = NULL;
135 err = xa_alloc(&fpriv->contexts, &args->context, context, XA_LIMIT(1, U32_MAX),
140 context->client = client;
141 xa_init_flags(&context->mappings, XA_FLAGS_ALLOC1);
152 if (context->memory_context)
153 host1x_memory_context_put(context->memory_context);
155 host1x_channel_put(context->channel);
157 kfree(context);
166 struct tegra_drm_context *context;
170 context = xa_load(&fpriv->contexts, args->context);
171 if (!context) {
176 xa_erase(&fpriv->contexts, args->context);
180 tegra_drm_channel_context_close(context);
190 struct tegra_drm_context *context;
200 context = xa_load(&fpriv->contexts, args->context);
201 if (!context) {
214 if (context->memory_context)
215 mapping_dev = &context->memory_context->dev;
217 mapping_dev = context->client->base.dev;
252 err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
277 struct tegra_drm_context *context;
281 context = xa_load(&fpriv->contexts, args->context);
282 if (!context) {
287 mapping = xa_erase(&context->mappings, args->mapping);