diff options
author | Sami Kiminki <skiminki@nvidia.com> | 2014-05-09 11:58:13 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:26 -0400 |
commit | 465d76f91c3d5b0bfe29f3959a0071fa2dae2b94 (patch) | |
tree | 4adf785f69dd068445d2209e3f16a9405086ed27 /drivers/gpu/nvgpu/gk20a | |
parent | 3899f3b997b2d770e6689cde938a359f28172c27 (diff) |
gpu: nvgpu: Handle missing DMA address
If DMA address is not defined, use the physical address.
Bug 1500983
Change-Id: Ic33b21f74c8c2760e43146b87eec7ea467fc87be
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
(cherry picked from commit 8ae9a6567349241ce1cfff383526b0d9d39c28a1)
Reviewed-on: http://git-master/r/415238
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index af7e0b51..d2174f37 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -1284,6 +1284,7 @@ u64 gk20a_vm_map(struct vm_gk20a *vm, | |||
1284 | int err = 0; | 1284 | int err = 0; |
1285 | struct buffer_attrs bfr = {0}; | 1285 | struct buffer_attrs bfr = {0}; |
1286 | struct gk20a_comptags comptags; | 1286 | struct gk20a_comptags comptags; |
1287 | u64 buf_addr; | ||
1287 | 1288 | ||
1288 | mutex_lock(&vm->update_gmmu_lock); | 1289 | mutex_lock(&vm->update_gmmu_lock); |
1289 | 1290 | ||
@@ -1316,7 +1317,10 @@ u64 gk20a_vm_map(struct vm_gk20a *vm, | |||
1316 | 1317 | ||
1317 | bfr.kind_v = kind; | 1318 | bfr.kind_v = kind; |
1318 | bfr.size = dmabuf->size; | 1319 | bfr.size = dmabuf->size; |
1319 | bfr.align = 1 << __ffs((u64)sg_dma_address(bfr.sgt->sgl)); | 1320 | buf_addr = (u64)sg_dma_address(bfr.sgt->sgl); |
1321 | if (unlikely(!buf_addr)) | ||
1322 | buf_addr = (u64)sg_phys(bfr.sgt->sgl); | ||
1323 | bfr.align = 1 << __ffs(buf_addr); | ||
1320 | bfr.pgsz_idx = -1; | 1324 | bfr.pgsz_idx = -1; |
1321 | 1325 | ||
1322 | /* If FIX_OFFSET is set, pgsz is determined. Otherwise, select | 1326 | /* If FIX_OFFSET is set, pgsz is determined. Otherwise, select |