Lines Matching refs:context

255 static void tegra_drm_context_free(struct tegra_drm_context *context)  in tegra_drm_context_free()  argument
257 context->client->ops->close_channel(context); in tegra_drm_context_free()
258 kfree(context); in tegra_drm_context_free()
327 int tegra_drm_submit(struct tegra_drm_context *context, in tegra_drm_submit() argument
348 job = host1x_job_alloc(context->channel, args->num_cmdbufs, in tegra_drm_submit()
355 job->client = (u32)args->context; in tegra_drm_submit()
356 job->class = context->client->base.class; in tegra_drm_submit()
400 job->is_addr_reg = context->client->ops->is_addr_reg; in tegra_drm_submit()
408 err = host1x_job_pin(job, context->client->base.dev); in tegra_drm_submit()
430 static struct tegra_drm_context *tegra_drm_get_context(__u64 context) in tegra_drm_get_context() argument
432 return (struct tegra_drm_context *)(uintptr_t)context; in tegra_drm_get_context()
436 struct tegra_drm_context *context) in tegra_drm_file_owns_context() argument
441 if (ctx == context) in tegra_drm_file_owns_context()
531 struct tegra_drm_context *context; in tegra_open_channel() local
535 context = kzalloc(sizeof(*context), GFP_KERNEL); in tegra_open_channel()
536 if (!context) in tegra_open_channel()
541 err = client->ops->open_channel(client, context); in tegra_open_channel()
545 list_add(&context->list, &fpriv->contexts); in tegra_open_channel()
546 args->context = (uintptr_t)context; in tegra_open_channel()
547 context->client = client; in tegra_open_channel()
551 kfree(context); in tegra_open_channel()
560 struct tegra_drm_context *context; in tegra_close_channel() local
562 context = tegra_drm_get_context(args->context); in tegra_close_channel()
564 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_close_channel()
567 list_del(&context->list); in tegra_close_channel()
568 tegra_drm_context_free(context); in tegra_close_channel()
578 struct tegra_drm_context *context; in tegra_get_syncpt() local
581 context = tegra_drm_get_context(args->context); in tegra_get_syncpt()
583 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_get_syncpt()
586 if (args->index >= context->client->base.num_syncpts) in tegra_get_syncpt()
589 syncpt = context->client->base.syncpts[args->index]; in tegra_get_syncpt()
600 struct tegra_drm_context *context; in tegra_submit() local
602 context = tegra_drm_get_context(args->context); in tegra_submit()
604 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_submit()
607 return context->client->ops->submit(context, args, drm, file); in tegra_submit()
615 struct tegra_drm_context *context; in tegra_get_syncpt_base() local
619 context = tegra_drm_get_context(args->context); in tegra_get_syncpt_base()
621 if (!tegra_drm_file_owns_context(fpriv, context)) in tegra_get_syncpt_base()
624 if (args->syncpt >= context->client->base.num_syncpts) in tegra_get_syncpt_base()
627 syncpt = context->client->base.syncpts[args->syncpt]; in tegra_get_syncpt_base()
862 struct tegra_drm_context *context, *tmp; in tegra_drm_preclose() local
868 list_for_each_entry_safe(context, tmp, &fpriv->contexts, list) in tegra_drm_preclose()
869 tegra_drm_context_free(context); in tegra_drm_preclose()