Lines Matching refs:context

246 static void tegra_drm_context_free(struct tegra_drm_context *context)  in tegra_drm_context_free()  argument
248 context->client->ops->close_channel(context); in tegra_drm_context_free()
249 kfree(context); in tegra_drm_context_free()
318 int tegra_drm_submit(struct tegra_drm_context *context, in tegra_drm_submit() argument
339 job = host1x_job_alloc(context->channel, args->num_cmdbufs, in tegra_drm_submit()
346 job->client = (u32)args->context; in tegra_drm_submit()
347 job->class = context->client->base.class; in tegra_drm_submit()
391 job->is_addr_reg = context->client->ops->is_addr_reg; in tegra_drm_submit()
399 err = host1x_job_pin(job, context->client->base.dev); in tegra_drm_submit()
421 static struct tegra_drm_context *tegra_drm_get_context(__u64 context) in tegra_drm_get_context() argument
423 return (struct tegra_drm_context *)(uintptr_t)context; in tegra_drm_get_context()
427 struct tegra_drm_context *context) in tegra_drm_file_owns_context() argument
432 if (ctx == context) in tegra_drm_file_owns_context()
522 struct tegra_drm_context *context; in tegra_open_channel() local
526 context = kzalloc(sizeof(*context), GFP_KERNEL); in tegra_open_channel()
527 if (!context) in tegra_open_channel()
532 err = client->ops->open_channel(client, context); in tegra_open_channel()
536 list_add(&context->list, &fpriv->contexts); in tegra_open_channel()
537 args->context = (uintptr_t)context; in tegra_open_channel()
538 context->client = client; in tegra_open_channel()
542 kfree(context); in tegra_open_channel()
551 struct tegra_drm_context *context; in tegra_close_channel() local
553 context = tegra_drm_get_context(args->context); in tegra_close_channel()
555 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_close_channel()
558 list_del(&context->list); in tegra_close_channel()
559 tegra_drm_context_free(context); in tegra_close_channel()
569 struct tegra_drm_context *context; in tegra_get_syncpt() local
572 context = tegra_drm_get_context(args->context); in tegra_get_syncpt()
574 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_get_syncpt()
577 if (args->index >= context->client->base.num_syncpts) in tegra_get_syncpt()
580 syncpt = context->client->base.syncpts[args->index]; in tegra_get_syncpt()
591 struct tegra_drm_context *context; in tegra_submit() local
593 context = tegra_drm_get_context(args->context); in tegra_submit()
595 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_submit()
598 return context->client->ops->submit(context, args, drm, file); in tegra_submit()
606 struct tegra_drm_context *context; in tegra_get_syncpt_base() local
610 context = tegra_drm_get_context(args->context); in tegra_get_syncpt_base()
612 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_get_syncpt_base()
615 if (args->syncpt >= context->client->base.num_syncpts) in tegra_get_syncpt_base()
618 syncpt = context->client->base.syncpts[args->syncpt]; in tegra_get_syncpt_base()
852 struct tegra_drm_context *context, *tmp; in tegra_drm_preclose() local
858 list_for_each_entry_safe(context, tmp, &fpriv->contexts, list) in tegra_drm_preclose()
859 tegra_drm_context_free(context); in tegra_drm_preclose()