diff options
-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 |