diff options
| author | Gerrit Code Review <gerrit2@nvidia.com> | 2018-08-17 21:50:05 -0400 |
|---|---|---|
| committer | Gerrit Code Review <gerrit2@nvidia.com> | 2018-08-17 21:50:05 -0400 |
| commit | d3fb5f60edd25717947375f4e4671bc1dc0ba729 (patch) | |
| tree | 9db93ce6395fa4e48e9a979aa434c80119071fa0 /include | |
| parent | a92a75135404f7d873151610b625ddd1195f2377 (diff) | |
| parent | f7d4dc894b87584d8b3c58d07d3cedf0050ea198 (diff) | |
Merge "tegra: vgpu: move tegra_gr_comm.h" into dev-kernel
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/tegra_gr_comm.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/include/linux/tegra_gr_comm.h b/include/linux/tegra_gr_comm.h new file mode 100644 index 000000000..f1de97f4f --- /dev/null +++ b/include/linux/tegra_gr_comm.h | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | /* | ||
| 2 | * Tegra Graphics Virtualization Communication Framework | ||
| 3 | * | ||
| 4 | * Copyright (c) 2013-2018, NVIDIA Corporation. All rights reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms and conditions of the GNU General Public License, | ||
| 8 | * version 2, as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 13 | * more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __TEGRA_GR_COMM_H | ||
| 20 | #define __TEGRA_GR_COMM_H | ||
| 21 | |||
| 22 | #include <linux/platform_device.h> | ||
| 23 | |||
| 24 | #define TEGRA_GR_COMM_ID_SELF (0xFF) | ||
| 25 | |||
| 26 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION | ||
| 27 | int tegra_gr_comm_init(struct platform_device *pdev, u32 elems, | ||
| 28 | const size_t *queue_sizes, u32 queue_start, u32 num_queues); | ||
| 29 | void tegra_gr_comm_deinit(u32 queue_start, u32 num_queues); | ||
| 30 | int tegra_gr_comm_send(u32 peer, u32 index, void *data, | ||
| 31 | size_t size); | ||
| 32 | int tegra_gr_comm_recv(u32 index, void **handle, void **data, | ||
| 33 | size_t *size, u32 *sender); | ||
| 34 | int tegra_gr_comm_sendrecv(u32 peer, u32 index, void **handle, | ||
| 35 | void **data, size_t *size); | ||
| 36 | void tegra_gr_comm_release(void *handle); | ||
| 37 | u32 tegra_gr_comm_get_server_vmid(void); | ||
| 38 | void *tegra_gr_comm_oob_get_ptr(u32 peer, u32 index, | ||
| 39 | void **ptr, size_t *size); | ||
| 40 | void tegra_gr_comm_oob_put_ptr(void *handle); | ||
| 41 | #else | ||
| 42 | static inline int tegra_gr_comm_init(struct platform_device *pdev, | ||
| 43 | u32 elems, | ||
| 44 | const size_t *queue_sizes, u32 queue_start, | ||
| 45 | u32 num_queues) | ||
| 46 | { | ||
| 47 | return -ENOSYS; | ||
| 48 | } | ||
| 49 | |||
| 50 | static inline void tegra_gr_comm_deinit(u32 queue_start, | ||
| 51 | u32 num_queues) | ||
| 52 | { | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline int tegra_gr_comm_send(u32 peer, u32 index, | ||
| 56 | void *data, size_t size) | ||
| 57 | { | ||
| 58 | return -ENOSYS; | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline int tegra_gr_comm_recv(u32 index, void **handle, | ||
| 62 | void **data, size_t *size, u32 *sender) | ||
| 63 | { | ||
| 64 | return -ENOSYS; | ||
| 65 | } | ||
| 66 | |||
| 67 | static inline int tegra_gr_comm_sendrecv(u32 peer, u32 index, | ||
| 68 | void **handle, void **data, | ||
| 69 | size_t *size) | ||
| 70 | { | ||
| 71 | return -ENOSYS; | ||
| 72 | } | ||
| 73 | |||
| 74 | static inline void tegra_gr_comm_release(void *handle) {} | ||
| 75 | |||
| 76 | static inline u32 tegra_gr_comm_get_server_vmid(void) | ||
| 77 | { | ||
| 78 | return 0; | ||
| 79 | } | ||
| 80 | |||
| 81 | static inline void *tegra_gr_comm_oob_get_ptr(u32 peer, | ||
| 82 | u32 index, void **ptr, size_t *size) | ||
| 83 | { | ||
| 84 | return NULL; | ||
| 85 | } | ||
| 86 | |||
| 87 | static inline void tegra_gr_comm_oob_put_ptr(void *handle) {} | ||
| 88 | #endif | ||
| 89 | |||
| 90 | #endif | ||
