diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-10-31 15:21:07 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-01 23:15:47 -0400 |
commit | 31e594befefe63d430885e340175b3f9549b8cc4 (patch) | |
tree | c3f2e879ec1e314d68aa455d37f5965edde26456 /drivers/gpu/nvgpu/include | |
parent | 5eedf06bf56489bc559a08347f60a7680ccd6897 (diff) |
gpu: nvgpu: Split ctxsw_trace API into non-Linux component
Split the ctxsw trace "core" API code into <nvgpu/ctxsw_trace.h>. This
is not perect though since there's some Linuxisms present in the HAL
and as such that code has to be hidden by the ctxsw tracing CONFIG. But
this patch should work for QNX such that it will allow the code to
build as long as CONFIG_GK20A_CTXSW_TRACE is not set.
Also fix the copywrite notice in the ctxsw code present under
common/linux to be GPL.
JIRA NVGPU-287
Change-Id: I94715864caf335b7220185492e4629d713b025e0
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1589429
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h b/drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h new file mode 100644 index 00000000..cc6edb49 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #ifndef __NVGPU_CTXSW_TRACE_H__ | ||
24 | #define __NVGPU_CTXSW_TRACE_H__ | ||
25 | |||
26 | #include <nvgpu/types.h> | ||
27 | |||
28 | struct gk20a; | ||
29 | struct tsg_gk20a; | ||
30 | struct channel_gk20a; | ||
31 | struct nvgpu_ctxsw_trace_entry; | ||
32 | |||
33 | int gk20a_ctxsw_trace_init(struct gk20a *g); | ||
34 | |||
35 | void gk20a_ctxsw_trace_channel_reset(struct gk20a *g, struct channel_gk20a *ch); | ||
36 | void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg); | ||
37 | |||
38 | void gk20a_ctxsw_trace_cleanup(struct gk20a *g); | ||
39 | int gk20a_ctxsw_trace_write(struct gk20a *g, | ||
40 | struct nvgpu_ctxsw_trace_entry *entry); | ||
41 | void gk20a_ctxsw_trace_wake_up(struct gk20a *g, int vmid); | ||
42 | |||
43 | #ifdef CONFIG_GK20A_CTXSW_TRACE | ||
44 | struct file; | ||
45 | struct vm_area_struct; | ||
46 | |||
47 | int gk20a_ctxsw_dev_mmap(struct file *filp, struct vm_area_struct *vma); | ||
48 | int gk20a_ctxsw_dev_ring_alloc(struct gk20a *g, void **buf, size_t *size); | ||
49 | int gk20a_ctxsw_dev_ring_free(struct gk20a *g); | ||
50 | int gk20a_ctxsw_dev_mmap_buffer(struct gk20a *g, struct vm_area_struct *vma); | ||
51 | #endif | ||
52 | |||
53 | #endif | ||