diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h | 48 |
2 files changed, 58 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h new file mode 100644 index 00000000..8b1e646e --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __NVGPU_LINUX_NVGPU_MEM_H__ | ||
18 | #define __NVGPU_LINUX_NVGPU_MEM_H__ | ||
19 | |||
20 | struct page; | ||
21 | struct sg_table; | ||
22 | |||
23 | struct nvgpu_mem_priv { | ||
24 | struct page **pages; | ||
25 | struct sg_table *sgt; | ||
26 | unsigned long flags; | ||
27 | }; | ||
28 | |||
29 | #endif | ||
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h index ae5dcc6e..1590ee7a 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h | |||
@@ -17,10 +17,11 @@ | |||
17 | #ifndef __NVGPU_NVGPU_MEM_H__ | 17 | #ifndef __NVGPU_NVGPU_MEM_H__ |
18 | #define __NVGPU_NVGPU_MEM_H__ | 18 | #define __NVGPU_NVGPU_MEM_H__ |
19 | 19 | ||
20 | #include <linux/types.h> | 20 | #include <nvgpu/types.h> |
21 | |||
22 | #include <nvgpu/list.h> | 21 | #include <nvgpu/list.h> |
23 | 22 | ||
23 | #include <nvgpu/linux/nvgpu_mem.h> | ||
24 | |||
24 | struct page; | 25 | struct page; |
25 | struct sg_table; | 26 | struct sg_table; |
26 | 27 | ||
@@ -39,18 +40,32 @@ enum nvgpu_aperture { | |||
39 | }; | 40 | }; |
40 | 41 | ||
41 | struct nvgpu_mem { | 42 | struct nvgpu_mem { |
42 | void *cpu_va; /* sysmem only */ | 43 | /* |
43 | struct page **pages; /* sysmem only */ | 44 | * Populated for all nvgpu_mem structs - vidmem or system. |
44 | struct sg_table *sgt; | 45 | */ |
45 | enum nvgpu_aperture aperture; | 46 | enum nvgpu_aperture aperture; |
46 | size_t size; | 47 | size_t size; |
47 | u64 gpu_va; | 48 | u64 gpu_va; |
48 | bool fixed; /* vidmem only */ | 49 | bool skip_wmb; |
49 | bool user_mem; /* vidmem only */ | 50 | |
50 | struct nvgpu_allocator *allocator; /* vidmem only */ | 51 | /* |
51 | struct nvgpu_list_node clear_list_entry; /* vidmem only */ | 52 | * Only populated for a sysmem allocation. |
52 | bool skip_wmb; | 53 | */ |
53 | unsigned long flags; | 54 | void *cpu_va; |
55 | |||
56 | /* | ||
57 | * Fields only populated for vidmem allocations. | ||
58 | */ | ||
59 | bool fixed; | ||
60 | bool user_mem; | ||
61 | struct nvgpu_allocator *allocator; | ||
62 | struct nvgpu_list_node clear_list_entry; | ||
63 | |||
64 | /* | ||
65 | * This is defined by the system specific header. It can be empty if | ||
66 | * there's no system specific stuff for a given system. | ||
67 | */ | ||
68 | struct nvgpu_mem_priv priv; | ||
54 | }; | 69 | }; |
55 | 70 | ||
56 | static inline struct nvgpu_mem * | 71 | static inline struct nvgpu_mem * |
@@ -61,11 +76,6 @@ nvgpu_mem_from_clear_list_entry(struct nvgpu_list_node *node) | |||
61 | clear_list_entry)); | 76 | clear_list_entry)); |
62 | }; | 77 | }; |
63 | 78 | ||
64 | struct nvgpu_mem_sub { | ||
65 | u32 offset; | ||
66 | u32 size; | ||
67 | }; | ||
68 | |||
69 | static inline const char *nvgpu_aperture_str(enum nvgpu_aperture aperture) | 79 | static inline const char *nvgpu_aperture_str(enum nvgpu_aperture aperture) |
70 | { | 80 | { |
71 | switch (aperture) { | 81 | switch (aperture) { |