forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the non-submission parts of the new UAPI, including channel management and memory mapping. The UAPI is under the CONFIG_DRM_TEGRA_STAGING config flag for now. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
- Loading branch information
1 parent
ed10454
commit 2c6bdcf
Showing
5 changed files
with
401 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* 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 tegra_drm_channel_ctx { | ||
struct tegra_drm_client *client; | ||
struct host1x_channel *channel; | ||
struct xarray mappings; | ||
}; | ||
|
||
struct tegra_drm_mapping { | ||
struct kref ref; | ||
|
||
struct device *dev; | ||
struct host1x_bo *bo; | ||
struct sg_table *sgt; | ||
enum dma_data_direction direction; | ||
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_gem_create(struct drm_device *drm, void *data, | ||
struct drm_file *file); | ||
int tegra_drm_ioctl_gem_mmap(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); | ||
struct tegra_drm_channel_ctx * | ||
tegra_drm_channel_ctx_lock(struct tegra_drm_file *file, u32 id); | ||
|
||
#endif |
Oops, something went wrong.