diff options
author | Sami Kiminki <skiminki@nvidia.com> | 2017-11-02 16:03:15 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-10 11:38:19 -0500 |
commit | cefabe7eb1f1f1dba9692e21ab4f1b88b9163489 (patch) | |
tree | b0f4e6ce64cd408e780925b8b3365b45805b7d95 /drivers/gpu/nvgpu/include | |
parent | b584bf8aa814d026498ebcee23480d1963338e47 (diff) |
gpu: nvgpu: Remove PTE kind logic
Since NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL was made mandatory,
kernel does not need to know the details about the PTE kinds
anymore. Thus, we can remove the kind_gk20a.h header and the code
related to kind table setup, as well as simplify buffer mapping code
a bit.
Bug 1902982
Change-Id: Iaf798023c219a64fb0a84da09431c5ce4bc046eb
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1560933
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/linux/vm.h | 21 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/vm.h | 12 |
2 files changed, 6 insertions, 27 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h index d810f95f..dee8fa09 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | |||
@@ -38,25 +38,13 @@ struct vm_gk20a; | |||
38 | struct vm_gk20a_mapping_batch; | 38 | struct vm_gk20a_mapping_batch; |
39 | struct nvgpu_vm_area; | 39 | struct nvgpu_vm_area; |
40 | 40 | ||
41 | /* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */ | ||
41 | int nvgpu_vm_map_linux(struct vm_gk20a *vm, | 42 | int nvgpu_vm_map_linux(struct vm_gk20a *vm, |
42 | struct dma_buf *dmabuf, | 43 | struct dma_buf *dmabuf, |
43 | u64 offset_align, | 44 | u64 offset_align, |
44 | u32 flags, | 45 | u32 flags, |
45 | |||
46 | /* | ||
47 | * compressible kind if | ||
48 | * NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is | ||
49 | * specified, otherwise just the kind | ||
50 | */ | ||
51 | s16 compr_kind, | 46 | s16 compr_kind, |
52 | |||
53 | /* | ||
54 | * incompressible kind if | ||
55 | * NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is | ||
56 | * specified, otherwise ignored | ||
57 | */ | ||
58 | s16 incompr_kind, | 47 | s16 incompr_kind, |
59 | |||
60 | int rw_flag, | 48 | int rw_flag, |
61 | u64 buffer_offset, | 49 | u64 buffer_offset, |
62 | u64 mapping_size, | 50 | u64 mapping_size, |
@@ -66,12 +54,7 @@ int nvgpu_vm_map_linux(struct vm_gk20a *vm, | |||
66 | /* | 54 | /* |
67 | * Notes: | 55 | * Notes: |
68 | * - Batch may be NULL if map op is not part of a batch. | 56 | * - Batch may be NULL if map op is not part of a batch. |
69 | * - If NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is set, | 57 | * - NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set |
70 | * compr_kind and incompr_kind work as explained in nvgpu.h. | ||
71 | * - If NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is NOT set, | ||
72 | * compr_kind holds the kind and kernel will figure out whether | ||
73 | * it is a compressible or incompressible kind. If compressible, kernel will | ||
74 | * also figure out the incompressible counterpart or return an error. | ||
75 | */ | 58 | */ |
76 | int nvgpu_vm_map_buffer(struct vm_gk20a *vm, | 59 | int nvgpu_vm_map_buffer(struct vm_gk20a *vm, |
77 | int dmabuf_fd, | 60 | int dmabuf_fd, |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h index 801fb8ed..10a7f7ce 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h | |||
@@ -127,10 +127,8 @@ struct nvgpu_ctag_buffer_info { | |||
127 | enum gmmu_pgsz_gk20a pgsz_idx; | 127 | enum gmmu_pgsz_gk20a pgsz_idx; |
128 | u32 flags; | 128 | u32 flags; |
129 | 129 | ||
130 | u8 kind_v; | 130 | s16 compr_kind; |
131 | u8 uc_kind_v; | 131 | s16 incompr_kind; |
132 | bool use_kind_v; | ||
133 | bool use_uc_kind_v; | ||
134 | 132 | ||
135 | u32 ctag_lines; | 133 | u32 ctag_lines; |
136 | }; | 134 | }; |
@@ -202,10 +200,8 @@ void nvgpu_vm_put(struct vm_gk20a *vm); | |||
202 | int vm_aspace_id(struct vm_gk20a *vm); | 200 | int vm_aspace_id(struct vm_gk20a *vm); |
203 | int nvgpu_big_pages_possible(struct vm_gk20a *vm, u64 base, u64 size); | 201 | int nvgpu_big_pages_possible(struct vm_gk20a *vm, u64 base, u64 size); |
204 | 202 | ||
205 | int nvgpu_vm_init_kind_info(struct nvgpu_ctag_buffer_info *binfo, | 203 | int nvgpu_vm_compute_compression(struct vm_gk20a *vm, |
206 | s16 compr_kind, s16 incompr_kind); | 204 | struct nvgpu_ctag_buffer_info *binfo); |
207 | int nvgpu_vm_compute_kind_and_compression(struct vm_gk20a *vm, | ||
208 | struct nvgpu_ctag_buffer_info *binfo); | ||
209 | 205 | ||
210 | /* batching eliminates redundant cache flushes and invalidates */ | 206 | /* batching eliminates redundant cache flushes and invalidates */ |
211 | void nvgpu_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch); | 207 | void nvgpu_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch); |