summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/driver_common.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-04-23 15:28:09 -0400
committerTejal Kudav <tkudav@nvidia.com>2018-06-14 09:44:06 -0400
commit1b71581b9e3534661b4552faadf38bbb98851c45 (patch)
tree68667bc04c737b8963d5507aa446f69233201c5a /drivers/gpu/nvgpu/common/linux/driver_common.c
parent1e889871bc0ec3af05280f27497c0e7bd7a023b5 (diff)
gpu: nvgpu: Set DMA mask on a per-platform basis
Each GPU platform has different DMA limitations. For older chips the maximum size of a DMA buffer was more limited than newer SoCs (read: Xavier) and discrete GPUs. This patch adds support to set the DMA mask for a GPU on a per platform basis by adding a platform field that is populated with the maximum allowed DMA mask. That mask is programmed by the driver common code. If no mask is specified then the default mask size is 16GB (34 bits). Bug 2043276 Change-Id: I9c3c76c86bac6c485eb1197326e662516fbcaa41 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1700980 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/driver_common.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/driver_common.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c
index 8086cb29..015046dd 100644
--- a/drivers/gpu/nvgpu/common/linux/driver_common.c
+++ b/drivers/gpu/nvgpu/common/linux/driver_common.c
@@ -73,9 +73,15 @@ static void nvgpu_init_vars(struct gk20a *g)
73 dev->dma_parms = &l->dma_parms; 73 dev->dma_parms = &l->dma_parms;
74 dma_set_max_seg_size(dev, UINT_MAX); 74 dma_set_max_seg_size(dev, UINT_MAX);
75 75
76 /* 34 bit mask - can be expanded for later chips is needed. */ 76 /*
77 dma_set_mask(dev, DMA_BIT_MASK(34)); 77 * A default of 16GB is the largest supported DMA size that is
78 dma_set_coherent_mask(dev, DMA_BIT_MASK(34)); 78 * acceptable to all currently supported Tegra SoCs.
79 */
80 if (!platform->dma_mask)
81 platform->dma_mask = DMA_BIT_MASK(34);
82
83 dma_set_mask(dev, platform->dma_mask);
84 dma_set_coherent_mask(dev, platform->dma_mask);
79 85
80 nvgpu_init_list_node(&g->profiler_objects); 86 nvgpu_init_list_node(&g->profiler_objects);
81 87