summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
authorSami Kiminki <skiminki@nvidia.com>2015-03-19 15:28:34 -0400
committerIshan Mittal <imittal@nvidia.com>2015-05-18 02:03:19 -0400
commit520ff00e870eadc98a50f58ecd514ced53a8612f (patch)
tree6822d8ad2a51f98c2df421ba9cc7727e06757fcb /drivers/gpu/nvgpu/gk20a/mm_gk20a.h
parent069accc8571716dc616c9f96776d54bf657afaee (diff)
gpu: nvgpu: Implement compbits mapping
Implement NVGPU_AS_IOCTL_GET_BUFFER_COMPBITS_INFO for requesting info on compbits-mappable buffers; and NVGPU_AS_IOCTL_MAP_BUFFER_COMPBITS, which enables mapping compbits to the GPU address space of said buffers. This, subsequently, enables moving comptag swizzling from GPU to CDEH/CDEV formats to userspace. Compbits mapping is conservative and it may map more than what is strictly needed. This is because two reasons: 1) mapping must be done on small page alignment (4kB), and 2) GPU comptags are swizzled all around the aggregate cache line, which means that the whole cache line must be visible even if only some comptag lines are required from it. Cache line size is not necessarily a multiple of the small page size. Bug 200077571 Change-Id: I5ae88fe6b616e5ea37d3bff0dff46c07e9c9267e Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/719710 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index 0ff11d09..e07b95fe 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -186,7 +186,13 @@ struct mapped_buffer_node {
186 u32 ctag_offset; 186 u32 ctag_offset;
187 u32 ctag_lines; 187 u32 ctag_lines;
188 u32 ctag_allocated_lines; 188 u32 ctag_allocated_lines;
189
190 /* For comptag mapping, these are the mapping window parameters */
189 bool ctags_mappable; 191 bool ctags_mappable;
192 u64 ctag_map_win_addr; /* non-zero if mapped */
193 u64 ctag_map_win_size; /* non-zero if ctags_mappable */
194 u32 ctag_map_win_ctagline; /* ctagline at win start, set if
195 * ctags_mappable */
190 196
191 u32 flags; 197 u32 flags;
192 u32 kind; 198 u32 kind;
@@ -504,6 +510,19 @@ u64 gk20a_vm_map(struct vm_gk20a *vm,
504 u64 buffer_offset, 510 u64 buffer_offset,
505 u64 mapping_size); 511 u64 mapping_size);
506 512
513int gk20a_vm_get_compbits_info(struct vm_gk20a *vm,
514 u64 mapping_gva,
515 u64 *compbits_win_size,
516 u32 *compbits_win_ctagline,
517 u32 *mapping_ctagline,
518 u32 *flags);
519
520int gk20a_vm_map_compbits(struct vm_gk20a *vm,
521 u64 mapping_gva,
522 u64 *compbits_win_gva,
523 u64 *mapping_iova,
524 u32 flags);
525
507/* unmap handle from kernel */ 526/* unmap handle from kernel */
508void gk20a_vm_unmap(struct vm_gk20a *vm, u64 offset); 527void gk20a_vm_unmap(struct vm_gk20a *vm, u64 offset);
509 528