Lines Matching refs:fpriv

104 	struct tegra_drm_file *fpriv;  in tegra_drm_open()  local
106 fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); in tegra_drm_open()
107 if (!fpriv) in tegra_drm_open()
110 idr_init_base(&fpriv->legacy_contexts, 1); in tegra_drm_open()
111 xa_init_flags(&fpriv->contexts, XA_FLAGS_ALLOC1); in tegra_drm_open()
112 xa_init(&fpriv->syncpoints); in tegra_drm_open()
113 mutex_init(&fpriv->lock); in tegra_drm_open()
114 filp->driver_priv = fpriv; in tegra_drm_open()
428 static int tegra_client_open(struct tegra_drm_file *fpriv, in tegra_client_open() argument
444 err = idr_alloc(&fpriv->legacy_contexts, context, 1, 0, GFP_KERNEL); in tegra_client_open()
460 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_open_channel() local
471 mutex_lock(&fpriv->lock); in tegra_open_channel()
475 err = tegra_client_open(fpriv, client, context); in tegra_open_channel()
486 mutex_unlock(&fpriv->lock); in tegra_open_channel()
493 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_close_channel() local
498 mutex_lock(&fpriv->lock); in tegra_close_channel()
500 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_close_channel()
506 idr_remove(&fpriv->legacy_contexts, context->id); in tegra_close_channel()
510 mutex_unlock(&fpriv->lock); in tegra_close_channel()
517 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_get_syncpt() local
523 mutex_lock(&fpriv->lock); in tegra_get_syncpt()
525 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_get_syncpt()
540 mutex_unlock(&fpriv->lock); in tegra_get_syncpt()
547 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_submit() local
552 mutex_lock(&fpriv->lock); in tegra_submit()
554 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_submit()
563 mutex_unlock(&fpriv->lock); in tegra_submit()
570 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_get_syncpt_base() local
577 mutex_lock(&fpriv->lock); in tegra_get_syncpt_base()
579 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_get_syncpt_base()
601 mutex_unlock(&fpriv->lock); in tegra_get_syncpt_base()
817 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_drm_postclose() local
819 mutex_lock(&fpriv->lock); in tegra_drm_postclose()
820 idr_for_each(&fpriv->legacy_contexts, tegra_drm_context_cleanup, NULL); in tegra_drm_postclose()
821 tegra_drm_uapi_close_file(fpriv); in tegra_drm_postclose()
822 mutex_unlock(&fpriv->lock); in tegra_drm_postclose()
824 idr_destroy(&fpriv->legacy_contexts); in tegra_drm_postclose()
825 mutex_destroy(&fpriv->lock); in tegra_drm_postclose()
826 kfree(fpriv); in tegra_drm_postclose()