summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2016-05-16 04:33:38 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-05-24 15:39:06 -0400
commit3e431e26c5c3aba6da8a6555ec3d7b7df53f534a (patch)
treede7baabb5bbc4a5d27af36d62c00827b7bad3f54 /drivers/gpu/nvgpu/gk20a/mm_gk20a.h
parentdc7af18bf8056c213165d4cd1c55ea0fba9f1341 (diff)
gpu: nvgpu: add PRAMIN support for mem accessors
To support vidmem, implement a way to access buffers via the PRAMIN window instead of just kernel-mapped sysmem buffers for iGPU as of now. Depending on the buffer aperture, choose between the two access types in the buffer memory accessor functions. vmap()/vunmap() pairs are no-ops for buffers that can't be cpu-mapped. Two uses of DMA_ATTR_READ_ONLY are removed in the ucode loading path to support writing to them too via the indirection in addition to cpu. JIRA DNVGPU-23 Change-Id: I282dba6741c6b8224bc12e69c1fb3936bde7e6ed Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1141314 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.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index d943b231..c58a4fec 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -40,10 +40,17 @@
40 outer_flush_range(pa, pa + (size_t)(size)); \ 40 outer_flush_range(pa, pa + (size_t)(size)); \
41 } while (0) 41 } while (0)
42 42
43enum gk20a_aperture {
44 APERTURE_INVALID, /* e.g., unallocated */
45 APERTURE_SYSMEM,
46 APERTURE_VIDMEM
47};
48
43struct mem_desc { 49struct mem_desc {
44 void *cpu_va; 50 void *cpu_va;
45 struct page **pages; 51 struct page **pages;
46 struct sg_table *sgt; 52 struct sg_table *sgt;
53 enum gk20a_aperture aperture;
47 size_t size; 54 size_t size;
48 u64 gpu_va; 55 u64 gpu_va;
49}; 56};
@@ -357,6 +364,14 @@ struct mm_gk20a {
357 bool vidmem_is_vidmem; 364 bool vidmem_is_vidmem;
358 365
359 struct mem_desc sysmem_flush; 366 struct mem_desc sysmem_flush;
367
368 u32 pramin_base;
369 spinlock_t pramin_base_lock;
370#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
371 u32 force_pramin; /* via debugfs */
372#else
373 bool force_pramin; /* via debugfs */
374#endif
360}; 375};
361 376
362int gk20a_mm_init(struct mm_gk20a *mm); 377int gk20a_mm_init(struct mm_gk20a *mm);