Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* Copyright (c) 2020 NVIDIA Corporation */
0003 
0004 #ifndef _TEGRA_DRM_UAPI_H
0005 #define _TEGRA_DRM_UAPI_H
0006 
0007 #include <linux/dma-mapping.h>
0008 #include <linux/idr.h>
0009 #include <linux/kref.h>
0010 #include <linux/xarray.h>
0011 
0012 #include <drm/drm.h>
0013 
0014 struct drm_file;
0015 struct drm_device;
0016 
0017 struct tegra_drm_file {
0018     /* Legacy UAPI state */
0019     struct idr legacy_contexts;
0020     struct mutex lock;
0021 
0022     /* New UAPI state */
0023     struct xarray contexts;
0024     struct xarray syncpoints;
0025 };
0026 
0027 struct tegra_drm_mapping {
0028     struct kref ref;
0029 
0030     struct host1x_bo_mapping *map;
0031     struct host1x_bo *bo;
0032 
0033     dma_addr_t iova;
0034     dma_addr_t iova_end;
0035 };
0036 
0037 int tegra_drm_ioctl_channel_open(struct drm_device *drm, void *data,
0038                  struct drm_file *file);
0039 int tegra_drm_ioctl_channel_close(struct drm_device *drm, void *data,
0040                   struct drm_file *file);
0041 int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data,
0042                 struct drm_file *file);
0043 int tegra_drm_ioctl_channel_unmap(struct drm_device *drm, void *data,
0044                   struct drm_file *file);
0045 int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
0046                    struct drm_file *file);
0047 int tegra_drm_ioctl_syncpoint_allocate(struct drm_device *drm, void *data,
0048                        struct drm_file *file);
0049 int tegra_drm_ioctl_syncpoint_free(struct drm_device *drm, void *data,
0050                    struct drm_file *file);
0051 int tegra_drm_ioctl_syncpoint_wait(struct drm_device *drm, void *data,
0052                    struct drm_file *file);
0053 
0054 void tegra_drm_uapi_close_file(struct tegra_drm_file *file);
0055 void tegra_drm_mapping_put(struct tegra_drm_mapping *mapping);
0056 
0057 #endif