diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-04-06 18:30:01 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-20 19:14:32 -0400 |
commit | e32f62fadfcde413bcd9b5af61ad884e27ba2bf1 (patch) | |
tree | eff606a0826841eae6ade5906acd9da589d1179a /drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h | |
parent | 52bd58b560d0b3b49c03ef5c2637b67adeac8193 (diff) |
gpu: nvgpu: Move Linux nvgpu_mem fields
Hide the Linux specific nvgpu_mem fields so that in subsequent patches
core code can instead of using struct sg_table it can use mem_desc.
Routines for accessing system specific fields will be added as needed.
This is the first step in a fairly major overhaul of the GMMU mapping
routines. There are numerous issues with the current design (or lack
there of): massively coupled code, system dependencies, disorganization,
etc.
JIRA NVGPU-12
JIRA NVGPU-30
Change-Id: I2e7d3ae3a07468cfc17c1c642d28ed1b0952474d
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1464076
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h | 48 |
1 files changed, 29 insertions, 19 deletions
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) { |