mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
Add a userspace interface for providing access to the memory syncpoint
shim through dma-buf file descriptors. Applications can pass references
to syncpoints to other devices that only support memory semaphores to
facilitate synchronization with syncpoints.
Only syncpoints allocated through the DRM file descriptor ("owned" by
the application) can be exported read-write. All syncpoints can be
exported read-only.
Jira HOSTX-5722
Bug 4919132
Change-Id: I4f5c007b7f9ba65780c418b4e22c5f59a11ef84d
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3252026
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
61 lines
1.7 KiB
C
61 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/* Copyright (c) 2020 NVIDIA Corporation */
|
|
|
|
#ifndef _TEGRA_DRM_UAPI_H
|
|
#define _TEGRA_DRM_UAPI_H
|
|
|
|
#include <linux/dma-mapping.h>
|
|
#include <linux/idr.h>
|
|
#include <linux/kref.h>
|
|
#include <linux/xarray.h>
|
|
|
|
#include <drm/drm.h>
|
|
|
|
struct drm_file;
|
|
struct drm_device;
|
|
|
|
struct tegra_drm_file {
|
|
/* Legacy UAPI state */
|
|
struct idr legacy_contexts;
|
|
struct mutex lock;
|
|
|
|
/* New UAPI state */
|
|
struct xarray contexts;
|
|
struct xarray syncpoints;
|
|
};
|
|
|
|
struct tegra_drm_mapping {
|
|
struct kref ref;
|
|
|
|
struct host1x_bo_mapping *bo_map;
|
|
struct host1x_context_mapping *ctx_map;
|
|
struct host1x_bo *bo;
|
|
|
|
dma_addr_t iova;
|
|
dma_addr_t iova_end;
|
|
};
|
|
|
|
int tegra_drm_ioctl_channel_open(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_channel_close(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_channel_unmap(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_syncpoint_allocate(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_syncpoint_free(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_syncpoint_wait(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
int tegra_drm_ioctl_syncpoint_export_memory(struct drm_device *drm, void *data,
|
|
struct drm_file *file);
|
|
|
|
void tegra_drm_uapi_close_file(struct tegra_drm_file *file);
|
|
void tegra_drm_mapping_put(struct tegra_drm_mapping *mapping);
|
|
|
|
#endif
|