diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-06-05 10:40:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-06 14:05:03 -0400 |
commit | 80197d2c9daa8e2320cc0b15741904eb3c1b9ba7 (patch) | |
tree | f6c5d33058f59df536860b4b1209950a63dda5be /drivers/gpu/nvgpu/gk20a | |
parent | 26487b82df0c6604cc40fd6480f7ad7ed4e3efb0 (diff) |
gpu: nvgpu: split vidmem_is_vidmem
As the vidmem_is_vidmem flag has got two separate meanings in one bit,
split it in two bits into the enabled() API:
Add NVGPU_MM_HONORS_APERTURE bit, which is the same as vidmem_is_vidmem
with its original meaning, and use it to test which aperture bits to
write to hardware.
Add NVGPU_MM_UNIFIED_MEMORY bit, which has the opposite meaning: that
the GPU shares the SoC memory. When this flag is false, the GPU has its
own local video memory.
Jira NVGPU-86
Change-Id: I2d0bed3b1ede5a712be99323d3035b154bb23c3a
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1496080
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 08e2e9cc..ec020d5f 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -665,7 +665,8 @@ int gk20a_init_mm_setup_sw(struct gk20a *g) | |||
665 | * this requires fixed allocations in vidmem which must be | 665 | * this requires fixed allocations in vidmem which must be |
666 | * allocated before all other buffers | 666 | * allocated before all other buffers |
667 | */ | 667 | */ |
668 | if (g->ops.pmu.alloc_blob_space && g->mm.vidmem_is_vidmem) { | 668 | if (g->ops.pmu.alloc_blob_space |
669 | && !nvgpu_is_enabled(g, NVGPU_MM_UNIFIED_MEMORY)) { | ||
669 | err = g->ops.pmu.alloc_blob_space(g, 0, &g->acr.ucode_blob); | 670 | err = g->ops.pmu.alloc_blob_space(g, 0, &g->acr.ucode_blob); |
670 | if (err) | 671 | if (err) |
671 | return err; | 672 | return err; |
@@ -1234,10 +1235,12 @@ enum nvgpu_aperture gk20a_dmabuf_aperture(struct gk20a *g, | |||
1234 | struct dma_buf *dmabuf) | 1235 | struct dma_buf *dmabuf) |
1235 | { | 1236 | { |
1236 | struct gk20a *buf_owner = gk20a_vidmem_buf_owner(dmabuf); | 1237 | struct gk20a *buf_owner = gk20a_vidmem_buf_owner(dmabuf); |
1238 | bool unified_memory = nvgpu_is_enabled(g, NVGPU_MM_UNIFIED_MEMORY); | ||
1239 | |||
1237 | if (buf_owner == NULL) { | 1240 | if (buf_owner == NULL) { |
1238 | /* Not nvgpu-allocated, assume system memory */ | 1241 | /* Not nvgpu-allocated, assume system memory */ |
1239 | return APERTURE_SYSMEM; | 1242 | return APERTURE_SYSMEM; |
1240 | } else if (WARN_ON(buf_owner == g && !g->mm.vidmem_is_vidmem)) { | 1243 | } else if (WARN_ON(buf_owner == g && unified_memory)) { |
1241 | /* Looks like our video memory, but this gpu doesn't support | 1244 | /* Looks like our video memory, but this gpu doesn't support |
1242 | * it. Warn about a bug and bail out */ | 1245 | * it. Warn about a bug and bail out */ |
1243 | nvgpu_warn(g, | 1246 | nvgpu_warn(g, |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 5d90cbf6..94342818 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -256,8 +256,6 @@ struct mm_gk20a { | |||
256 | bool disable_bigpage; | 256 | bool disable_bigpage; |
257 | #endif | 257 | #endif |
258 | bool has_physical_mode; | 258 | bool has_physical_mode; |
259 | /* false if vidmem aperture actually points to sysmem */ | ||
260 | bool vidmem_is_vidmem; | ||
261 | 259 | ||
262 | struct nvgpu_mem sysmem_flush; | 260 | struct nvgpu_mem sysmem_flush; |
263 | 261 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index 452b868d..9499f91a 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h | |||
@@ -215,8 +215,10 @@ struct gk20a_platform { | |||
215 | /* soc name for finding firmware files */ | 215 | /* soc name for finding firmware files */ |
216 | const char *soc_name; | 216 | const char *soc_name; |
217 | 217 | ||
218 | /* if vidmem aperture actually points to vidmem*/ | 218 | /* false if vidmem aperture actually points to sysmem */ |
219 | bool vidmem_is_vidmem; | 219 | bool honors_aperture; |
220 | /* unified or split memory with separate vidmem? */ | ||
221 | bool unified_memory; | ||
220 | 222 | ||
221 | /* minimum supported VBIOS version */ | 223 | /* minimum supported VBIOS version */ |
222 | u32 vbios_min_version; | 224 | u32 vbios_min_version; |