diff options
| author | Shridhar Rasal <srasal@nvidia.com> | 2016-04-17 00:43:36 -0400 |
|---|---|---|
| committer | Kyle Guo <kyleg@nvidia.com> | 2018-08-16 16:16:17 -0400 |
| commit | fac488e5270510366133cbc2e8bfe1ffb9dcb40b (patch) | |
| tree | 83eb64bf52133a101208ee16efead9e5dee5f1fd /include/linux | |
| parent | 252b7276085f2ec3058d15bae9baed42537be24e (diff) | |
video: tegra: virt: add virt include file
This copies virtualization interface include file in kernel-next
[b99549f] <Aingara Paramakuru> video: tegra: virt: update comm framework
[e0c27a2] <Aingara Paramakuru> video: tegra: virt: add virtualization interfaces
Change-Id: Ie51931ff2fd5c80d430591bba057d123d10c8b7b
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1127824
(cherry picked from commit 39df7d7844fba18e69a317628235570d9b8ed4a5)
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1314848
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/tegra_gr_comm.h | 95 |
1 files changed, 95 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..4c53ed686 --- /dev/null +++ b/include/linux/tegra_gr_comm.h | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | /* | ||
| 2 | * Tegra Graphics Virtualization Communication Framework | ||
| 3 | * | ||
| 4 | * Copyright (c) 2013-2014, 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 | enum { | ||
| 25 | TEGRA_GR_COMM_CTX_CLIENT = 0, | ||
| 26 | TEGRA_GR_COMM_CTX_SERVER | ||
| 27 | }; | ||
| 28 | |||
| 29 | #define TEGRA_GR_COMM_ID_SELF (0xFF) | ||
| 30 | |||
| 31 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION | ||
| 32 | int tegra_gr_comm_init(struct platform_device *pdev, u32 virt_ctx, u32 elems, | ||
| 33 | const size_t *queue_sizes, u32 queue_start, u32 num_queues); | ||
| 34 | void tegra_gr_comm_deinit(u32 virt_ctx, u32 queue_start, u32 num_queues); | ||
| 35 | int tegra_gr_comm_send(u32 virt_ctx, u32 peer, u32 index, void *data, | ||
| 36 | size_t size); | ||
| 37 | int tegra_gr_comm_recv(u32 virt_ctx, u32 index, void **handle, void **data, | ||
| 38 | size_t *size, u32 *sender); | ||
| 39 | int tegra_gr_comm_sendrecv(u32 virt_ctx, u32 peer, u32 index, void **handle, | ||
| 40 | void **data, size_t *size); | ||
| 41 | void tegra_gr_comm_release(void *handle); | ||
| 42 | u32 tegra_gr_comm_get_server_vmid(void); | ||
| 43 | void *tegra_gr_comm_oob_get_ptr(u32 virt_ctx, u32 peer, u32 index, | ||
| 44 | void **ptr, size_t *size); | ||
| 45 | void tegra_gr_comm_oob_put_ptr(void *handle); | ||
| 46 | #else | ||
| 47 | static inline int tegra_gr_comm_init(struct platform_device *pdev, | ||
| 48 | u32 virt_ctx, u32 elems, | ||
| 49 | const size_t *queue_sizes, u32 queue_start, | ||
| 50 | u32 num_queues) | ||
| 51 | { | ||
| 52 | return -ENOSYS; | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline void tegra_gr_comm_deinit(u32 virt_ctx, u32 queue_start, | ||
| 56 | u32 num_queues) | ||
| 57 | { | ||
| 58 | } | ||
| 59 | |||
| 60 | static inline int tegra_gr_comm_send(u32 virt_ctx, u32 peer, u32 index, | ||
| 61 | void *data, size_t size) | ||
| 62 | { | ||
| 63 | return -ENOSYS; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline int tegra_gr_comm_recv(u32 virt_ctx, u32 index, void **handle, | ||
| 67 | void **data, size_t *size, u32 *sender) | ||
| 68 | { | ||
| 69 | return -ENOSYS; | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline int tegra_gr_comm_sendrecv(u32 virt_ctx, u32 peer, u32 index, | ||
| 73 | void **handle, void **data, | ||
| 74 | size_t *size) | ||
| 75 | { | ||
| 76 | return -ENOSYS; | ||
| 77 | } | ||
| 78 | |||
| 79 | static inline void tegra_gr_comm_release(void *handle) {} | ||
| 80 | |||
| 81 | static inline u32 tegra_gr_comm_get_server_vmid(void) | ||
| 82 | { | ||
| 83 | return 0; | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline void *tegra_gr_comm_oob_get_ptr(u32 virt_ctx, u32 peer, | ||
| 87 | u32 index, void **ptr, size_t *size) | ||
| 88 | { | ||
| 89 | return NULL; | ||
| 90 | } | ||
| 91 | |||
| 92 | static inline void tegra_gr_comm_oob_put_ptr(void *handle) {} | ||
| 93 | #endif | ||
| 94 | |||
| 95 | #endif | ||
