mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
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>
This commit is contained in:
committed by
Tejal Kudav
parent
1e889871bc
commit
1b71581b9e
@@ -73,9 +73,15 @@ static void nvgpu_init_vars(struct gk20a *g)
|
||||
dev->dma_parms = &l->dma_parms;
|
||||
dma_set_max_seg_size(dev, UINT_MAX);
|
||||
|
||||
/* 34 bit mask - can be expanded for later chips is needed. */
|
||||
dma_set_mask(dev, DMA_BIT_MASK(34));
|
||||
dma_set_coherent_mask(dev, DMA_BIT_MASK(34));
|
||||
/*
|
||||
* A default of 16GB is the largest supported DMA size that is
|
||||
* acceptable to all currently supported Tegra SoCs.
|
||||
*/
|
||||
if (!platform->dma_mask)
|
||||
platform->dma_mask = DMA_BIT_MASK(34);
|
||||
|
||||
dma_set_mask(dev, platform->dma_mask);
|
||||
dma_set_coherent_mask(dev, platform->dma_mask);
|
||||
|
||||
nvgpu_init_list_node(&g->profiler_objects);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user