From 3f26f6955fc6736384e1d56f9ddff2baaa2102a0 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Wed, 6 Apr 2016 18:01:17 -0700 Subject: include: uapi: nvgpu: add gv11b header Add gv11b header to export gv11b arch info. Bug 1735757 Change-Id: I66551eb6bd46652c2f1af3fe512060f5b7febef2 Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/1121508 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Ken Adams --- include/uapi/linux/nvgpu-t19x.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/uapi/linux/nvgpu-t19x.h (limited to 'include') diff --git a/include/uapi/linux/nvgpu-t19x.h b/include/uapi/linux/nvgpu-t19x.h new file mode 100644 index 00000000..6a10fb77 --- /dev/null +++ b/include/uapi/linux/nvgpu-t19x.h @@ -0,0 +1,30 @@ +/* + * NVGPU Public Interface Header + * + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +/* This file is meant to extend nvgpu.h, not replace it + * as such, be sure that nvgpu.h is actually the file performing the + * inclusion, to the extent that's possible. + */ +#ifndef _UAPI__LINUX_NVGPU_IOCTL_H +# error "This file is to be included within nvgpu.h only." +#endif + +#ifndef _UAPI__LINUX_NVGPU_T19X_IOCTL_H_ +#define _UAPI__LINUX_NVGPU_T19X_IOCTL_H_ + +#define NVGPU_GPU_ARCH_GV110 0x00000150 +#define NVGPU_GPU_IMPL_GV11B 0x0000000B + +#endif /* _UAPI__LINUX_NVGPU_T19X_IOCTL_H_ */ -- cgit v1.2.2 From 7b67abb2edb606b9ad0d0ecf0d94a333770974b1 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 16 Nov 2016 09:33:43 -0800 Subject: gpu: nvgpu: gv11b: support for new littler values Add support for new litter values: GPU_LIT_NUM_SUBCTX GPU_LIT_NUM_SM_PER_TPC Also updated get_litter_value api to use int instead of enum type. JIRA GV11B-21 Change-Id: Ide06245d03743e2d757d27d045701beb25b6707b Signed-off-by: seshendra Gadagottu Reviewed-on: http://git-master/r/1254857 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- include/linux/tegra_gpu_t19x.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/linux/tegra_gpu_t19x.h (limited to 'include') diff --git a/include/linux/tegra_gpu_t19x.h b/include/linux/tegra_gpu_t19x.h new file mode 100644 index 00000000..f6157c12 --- /dev/null +++ b/include/linux/tegra_gpu_t19x.h @@ -0,0 +1,24 @@ +/* + * Tegra GPU Virtualization Interfaces to Server + * + * Copyright (c) 2016, NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __TEGRA_GPU_T19X_H +#define __TEGRA_GPU_T19X_H + +#define GPU_LIT_NUM_SUBCTX 99 + +#endif -- cgit v1.2.2 From 6a25181882cdda68dfa4680b35f12c11b47ea036 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 10 Apr 2017 15:32:59 -0700 Subject: gpu: nvgpu: vgpu: add basic t19x HALs - Added t19x vgpu platform data - Added basic vgpu HAL for gv11b. - Added subctx header HAL. Jira VFND-3796 Change-Id: I2b99364801b41d042b53e057f1a30e1194f354c3 Signed-off-by: Richard Zhao Reviewed-on: https://git-master/r/1474729 GVS: Gerrit_Virtual_Submit Reviewed-by: Aingara Paramakuru Reviewed-by: Terje Bergstrom --- include/linux/tegra_vgpu_t19x.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 include/linux/tegra_vgpu_t19x.h (limited to 'include') diff --git a/include/linux/tegra_vgpu_t19x.h b/include/linux/tegra_vgpu_t19x.h new file mode 100644 index 00000000..f473275d --- /dev/null +++ b/include/linux/tegra_vgpu_t19x.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __TEGRA_VGPU_T19X_H +#define __TEGRA_VGPU_T19X_H + +#define TEGRA_VGPU_CMD_ALLOC_CTX_HEADER 100 +#define TEGRA_VGPU_CMD_FREE_CTX_HEADER 101 + +struct tegra_vgpu_alloc_ctx_header_params { + u64 ch_handle; + u64 ctx_header_va; +}; + +struct tegra_vgpu_free_ctx_header_params { + u64 ch_handle; +}; + +union tegra_vgpu_t19x_params { + struct tegra_vgpu_alloc_ctx_header_params alloc_ctx_header; + struct tegra_vgpu_free_ctx_header_params free_ctx_header; +}; + +#endif -- cgit v1.2.2 From 6d758eb81bcbff4e50df5c9fa67a369a4e1f2074 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Thu, 29 Jun 2017 15:59:05 -0700 Subject: gpu: nvgpu: gv11b: support for full subcontext Changes to enable 64 subcontexts: 1 SYNC + 63 ASYNC Currently all subcontexts with in a tsg can have only single address space. Add support for NVGPU_TSG_IOCTL_BIND_CHANNEL_EX for selecting subctx id by client. Bug 1842197 Change-Id: Icf56a41303bd1ad7fc6f2a6fbc691bb7b4a01d22 Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master/r/1511145 Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit --- include/uapi/linux/nvgpu-t19x.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/uapi/linux/nvgpu-t19x.h b/include/uapi/linux/nvgpu-t19x.h index 6a10fb77..96514a88 100644 --- a/include/uapi/linux/nvgpu-t19x.h +++ b/include/uapi/linux/nvgpu-t19x.h @@ -1,7 +1,7 @@ /* * NVGPU Public Interface Header * - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -27,4 +27,24 @@ #define NVGPU_GPU_ARCH_GV110 0x00000150 #define NVGPU_GPU_IMPL_GV11B 0x0000000B +/* subcontexts are available */ +#define NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS (1ULL << 22) + +struct nvgpu_tsg_bind_channel_ex_args { + /* in: channel fd */ + __s32 channel_fd; + + /* in: VEID in Volta */ + __u32 subcontext_id; + + __u64 reserved[2]; +}; + +#define NVGPU_TSG_IOCTL_BIND_CHANNEL_EX \ + _IOWR(NVGPU_TSG_IOCTL_MAGIC, 11, struct nvgpu_tsg_bind_channel_ex_args) + +#define NVGPU_TSG_IOCTL_MAX NVGPU_TSG_IOCTL_BIND_CHANNEL_EX + +#define NVGPU_TSG_IOCTL_MAX_ARG sizeof(struct nvgpu_tsg_bind_channel_ex_args) + #endif /* _UAPI__LINUX_NVGPU_T19X_IOCTL_H_ */ -- cgit v1.2.2 From afa31cdd8cc6bb04faeed30b2cc30f5e6be888b5 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 3 Jul 2017 16:40:44 +0530 Subject: gpu: nvgpu: add support for L3 cache allocation of buffers Add gv11b implementation of gpu_phys_addr() that checks the t19x GMMU attributes struct to determine if L3 allocation should be enabled. If L3 alloc is enabled then a special physical address bit is set. Add flag NVGPU_AS_MAP_BUFFER_FLAGS_L3_ALLOC to struct nvgpu_as_map_buffer_ex_args so that User space can add a hint to allocate buffer in L3 cache Jira GPUT19X-10 Bug 200279508 Change-Id: I1bb9876a670b252980922aa50e3e69b802be137f Signed-off-by: Deepak Nibade Reviewed-on: https://git-master/r/1512602 GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- include/uapi/linux/nvgpu-t19x.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/uapi/linux/nvgpu-t19x.h b/include/uapi/linux/nvgpu-t19x.h index 96514a88..bc37bc7c 100644 --- a/include/uapi/linux/nvgpu-t19x.h +++ b/include/uapi/linux/nvgpu-t19x.h @@ -27,6 +27,12 @@ #define NVGPU_GPU_ARCH_GV110 0x00000150 #define NVGPU_GPU_IMPL_GV11B 0x0000000B +/* + * this flag is used in struct nvgpu_as_map_buffer_ex_args + * to provide L3 cache allocation hint + */ +#define NVGPU_AS_MAP_BUFFER_FLAGS_L3_ALLOC (1 << 7) + /* subcontexts are available */ #define NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS (1ULL << 22) -- cgit v1.2.2 From de8e057f7eebcfe676278826ab457bf86b1b36fd Mon Sep 17 00:00:00 2001 From: David Nieto Date: Thu, 3 Aug 2017 21:43:50 -0700 Subject: gpu: nvgpu: GV100 support Adds support of GV100 up to devinit. JIRA: EVLR-1693 Change-Id: Ic7aa5f1c20714e05954139f143abb6a3459858fc Signed-off-by: David Nieto Reviewed-on: https://git-master.nvidia.com/r/1532747 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- include/uapi/linux/nvgpu-t19x.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/uapi/linux/nvgpu-t19x.h b/include/uapi/linux/nvgpu-t19x.h index bc37bc7c..f56bc9d7 100644 --- a/include/uapi/linux/nvgpu-t19x.h +++ b/include/uapi/linux/nvgpu-t19x.h @@ -25,7 +25,9 @@ #define _UAPI__LINUX_NVGPU_T19X_IOCTL_H_ #define NVGPU_GPU_ARCH_GV110 0x00000150 +#define NVGPU_GPU_ARCH_GV100 0x00000140 #define NVGPU_GPU_IMPL_GV11B 0x0000000B +#define NVGPU_GPU_IMPL_GV100 0x00000000 /* * this flag is used in struct nvgpu_as_map_buffer_ex_args -- cgit v1.2.2 From 1ac8f6477df7bd1e1b1c5922b1916ae6450c07ad Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 21 Aug 2017 15:36:11 -0700 Subject: gpu: nvgpu: vgpu: add TEGRA_VGPU_ATTRIB_MAX_SUBCTX_COUNT Get max subctx count from RM server. Jira VFND-3797 Change-Id: I95de2271a77bedfa8703231fa45da05c7d2da3e6 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1543018 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- include/linux/tegra_vgpu_t19x.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/tegra_vgpu_t19x.h b/include/linux/tegra_vgpu_t19x.h index f473275d..c2814f16 100644 --- a/include/linux/tegra_vgpu_t19x.h +++ b/include/linux/tegra_vgpu_t19x.h @@ -31,4 +31,6 @@ union tegra_vgpu_t19x_params { struct tegra_vgpu_free_ctx_header_params free_ctx_header; }; +#define TEGRA_VGPU_ATTRIB_MAX_SUBCTX_COUNT 100 + #endif -- cgit v1.2.2 From df4e88a21d51d5e098b66c3094fa91ae633777e5 Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Fri, 4 Aug 2017 17:32:02 -0700 Subject: gpu: nvgpu: vgpu: add support for gv11b syncpoints In t19x, gv11b semaphore read and write operations are translated to host1x syncpoint read and write operations using semaphore syncpoint shim aperture. Implement relevant vgpu hal functions for this in fifo hal. Jira EVLR-1571 Change-Id: I6296cc6e592ea991e1c01bc9662d02fb063ff3c7 Signed-off-by: Aparna Das Reviewed-on: https://git-master.nvidia.com/r/1516367 Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/tegra_vgpu_t19x.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/linux/tegra_vgpu_t19x.h b/include/linux/tegra_vgpu_t19x.h index c2814f16..fe39230e 100644 --- a/include/linux/tegra_vgpu_t19x.h +++ b/include/linux/tegra_vgpu_t19x.h @@ -16,6 +16,7 @@ #define TEGRA_VGPU_CMD_ALLOC_CTX_HEADER 100 #define TEGRA_VGPU_CMD_FREE_CTX_HEADER 101 +#define TEGRA_VGPU_CMD_MAP_SYNCPT 102 struct tegra_vgpu_alloc_ctx_header_params { u64 ch_handle; @@ -26,9 +27,18 @@ struct tegra_vgpu_free_ctx_header_params { u64 ch_handle; }; +struct tegra_vgpu_map_syncpt_params { + u64 as_handle; + u64 gpu_va; + u64 len; + u64 offset; + u8 prot; +}; + union tegra_vgpu_t19x_params { struct tegra_vgpu_alloc_ctx_header_params alloc_ctx_header; struct tegra_vgpu_free_ctx_header_params free_ctx_header; + struct tegra_vgpu_map_syncpt_params map_syncpt; }; #define TEGRA_VGPU_ATTRIB_MAX_SUBCTX_COUNT 100 -- cgit v1.2.2 From 730ba218c1a57486f05e02cfaddf6a75e95ff498 Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Fri, 27 Oct 2017 14:51:17 +0530 Subject: gpu: nvgpu: gv11b: Kernel iface for Dynamic TPC-PG This patch adds kernel interface for dynamic TPC-PG feature. User-space needs to send TPC-PG args to kernel via ioctl. Dynamic TPC-PG feature will allow every context to specify the number of TPC's it will use to run its workload. This way, graphics driver can power off non-required TPC's if a particular context has light to medium workload. JIRA GPUT19x-16 Change-Id: Id4846245a6414b719599d04784cbe2ca5282f4ad Signed-off-by: Deepak Goyal Reviewed-on: https://git-master.nvidia.com/r/1575848 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/uapi/linux/nvgpu-t19x.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/uapi/linux/nvgpu-t19x.h b/include/uapi/linux/nvgpu-t19x.h index f56bc9d7..27db97c0 100644 --- a/include/uapi/linux/nvgpu-t19x.h +++ b/include/uapi/linux/nvgpu-t19x.h @@ -44,8 +44,9 @@ struct nvgpu_tsg_bind_channel_ex_args { /* in: VEID in Volta */ __u32 subcontext_id; - - __u64 reserved[2]; + __u32 num_active_tpcs; + __u8 tpc_pg_enabled; + __u8 reserved[11]; }; #define NVGPU_TSG_IOCTL_BIND_CHANNEL_EX \ -- cgit v1.2.2 From 738bee03730a905d98361cd1260f9b79e3c12bf7 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Mon, 16 Oct 2017 08:58:59 -0700 Subject: gpu: nvgpu: vgpu: add vgpu_gv11b_tsg_bind_channel Add TEGRA_VGPU_CMD_TSG_BIND_CHANNEL_EX command to pass subctx_id and runqueu_sel to RM server. Use this command in gv11b's implementation of gops->fifo.tsg_bind_channel. Jira EVLR-1751 Change-Id: I8ba69c95ea1c6bb7fa106588b6420ed543b2386b Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/1579840 Reviewed-by: svc-mobile-coverity Reviewed-by: Richard Zhao GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/tegra_vgpu_t19x.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/linux/tegra_vgpu_t19x.h b/include/linux/tegra_vgpu_t19x.h index fe39230e..38dbbf60 100644 --- a/include/linux/tegra_vgpu_t19x.h +++ b/include/linux/tegra_vgpu_t19x.h @@ -17,6 +17,7 @@ #define TEGRA_VGPU_CMD_ALLOC_CTX_HEADER 100 #define TEGRA_VGPU_CMD_FREE_CTX_HEADER 101 #define TEGRA_VGPU_CMD_MAP_SYNCPT 102 +#define TEGRA_VGPU_CMD_TSG_BIND_CHANNEL_EX 103 struct tegra_vgpu_alloc_ctx_header_params { u64 ch_handle; @@ -35,10 +36,18 @@ struct tegra_vgpu_map_syncpt_params { u8 prot; }; +struct tegra_vgpu_tsg_bind_channel_ex_params { + u32 tsg_id; + u64 ch_handle; + u32 subctx_id; + u32 runqueue_sel; +}; + union tegra_vgpu_t19x_params { struct tegra_vgpu_alloc_ctx_header_params alloc_ctx_header; struct tegra_vgpu_free_ctx_header_params free_ctx_header; struct tegra_vgpu_map_syncpt_params map_syncpt; + struct tegra_vgpu_tsg_bind_channel_ex_params tsg_bind_channel_ex; }; #define TEGRA_VGPU_ATTRIB_MAX_SUBCTX_COUNT 100 -- cgit v1.2.2