summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-05-12 20:26:39 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-08-30 13:04:23 -0400
commit0e69c6707b974726459759464bc7876afe894740 (patch)
tree66fd423431695a8f319597078b32eb904ee27b9b /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent39624a04d8c325958c40c0e44acd4fcc9cfeed95 (diff)
gpu: nvgpu: Add gpu_dbg_map_v message type
Add a new debug message type: gpu_dbg_map_v. This is used for mapping messages that are not specifically memory map operations. Also cleanup the memory mapping debugging a bit since there was one duplicate print and the memory map print was difficult to parse visually. As a result the message has been modified to put the most important information first in an easily readable format. Bug 1732449 JIRA DNVGPU-12 Change-Id: Ib19c9371ee958009ab5a2d89b9610e699d070ee2 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1198593 (cherry picked from commit 51dba53b06ca171cdb13d1707f2d026b0ce29f07) Reviewed-on: http://git-master/r/1147670 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c85
1 files changed, 34 insertions, 51 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index cab10902..7ace85d7 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -1685,20 +1685,18 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,
1685 } 1685 }
1686 1686
1687 gk20a_dbg(gpu_dbg_map, 1687 gk20a_dbg(gpu_dbg_map,
1688 "as=%d pgsz=%d " 1688 "gv: 0x%04x_%08x + 0x%-7llx "
1689 "kind=0x%x flags=0x%x " 1689 "[dma: 0x%02x_%08x, pa: 0x%02x_%08x] "
1690 "ctags=%d start=%d gv=0x%x,%08x -> 0x%x,%08x -> 0x%x,%08x + %llx size=%lld aperture=%s", 1690 "pgsz=%-3dKb as=%-2d ctags=%d start=%d "
1691 vm_aspace_id(vm), pgsz_idx, 1691 "kind=0x%x flags=0x%x apt=%s",
1692 kind_v, flags, 1692 hi32(map_offset), lo32(map_offset), size,
1693 ctag_lines, ctag_offset, 1693 sgt ? hi32((u64)sg_dma_address(sgt->sgl)) : 0,
1694 hi32(map_offset), lo32(map_offset), 1694 sgt ? lo32((u64)sg_dma_address(sgt->sgl)) : 0,
1695 hi32((u64)sg_dma_address(sgt->sgl)), 1695 sgt ? hi32((u64)sg_phys(sgt->sgl)) : 0,
1696 lo32((u64)sg_dma_address(sgt->sgl)), 1696 sgt ? lo32((u64)sg_phys(sgt->sgl)) : 0,
1697 hi32((u64)sg_phys(sgt->sgl)), 1697 vm->gmmu_page_sizes[pgsz_idx] >> 10, vm_aspace_id(vm),
1698 lo32((u64)sg_phys(sgt->sgl)), 1698 ctag_lines, ctag_offset,
1699 buffer_offset, 1699 kind_v, flags, gk20a_aperture_str(aperture));
1700 size,
1701 gk20a_aperture_str(aperture));
1702 1700
1703 err = update_gmmu_ptes_locked(vm, pgsz_idx, 1701 err = update_gmmu_ptes_locked(vm, pgsz_idx,
1704 sgt, 1702 sgt,
@@ -1857,21 +1855,21 @@ static u64 gk20a_vm_map_duplicate_locked(struct vm_gk20a *vm,
1857 kref_get(&mapped_buffer->ref); 1855 kref_get(&mapped_buffer->ref);
1858 1856
1859 gk20a_dbg(gpu_dbg_map, 1857 gk20a_dbg(gpu_dbg_map,
1860 "reusing as=%d pgsz=%d flags=0x%x ctags=%d " 1858 "gv: 0x%04x_%08x + 0x%-7zu "
1861 "start=%d gv=0x%x,%08x -> 0x%x,%08x -> 0x%x,%08x " 1859 "[dma: 0x%02x_%08x, pa: 0x%02x_%08x] "
1862 "own_mem_ref=%d user_mapped=%d size=%zu aperture=%s", 1860 "pgsz=%-3dKb as=%-2d ctags=%d start=%d "
1863 vm_aspace_id(vm), mapped_buffer->pgsz_idx, 1861 "flags=0x%x apt=%s (reused)",
1864 mapped_buffer->flags, 1862 hi32(mapped_buffer->addr), lo32(mapped_buffer->addr),
1865 mapped_buffer->ctag_lines, 1863 dmabuf->size,
1866 mapped_buffer->ctag_offset, 1864 hi32((u64)sg_dma_address(mapped_buffer->sgt->sgl)),
1867 hi32(mapped_buffer->addr), lo32(mapped_buffer->addr), 1865 lo32((u64)sg_dma_address(mapped_buffer->sgt->sgl)),
1868 hi32((u64)sg_dma_address(mapped_buffer->sgt->sgl)), 1866 hi32((u64)sg_phys(mapped_buffer->sgt->sgl)),
1869 lo32((u64)sg_dma_address(mapped_buffer->sgt->sgl)), 1867 lo32((u64)sg_phys(mapped_buffer->sgt->sgl)),
1870 hi32((u64)sg_phys(mapped_buffer->sgt->sgl)), 1868 vm->gmmu_page_sizes[mapped_buffer->pgsz_idx] >> 10,
1871 lo32((u64)sg_phys(mapped_buffer->sgt->sgl)), 1869 vm_aspace_id(vm),
1872 mapped_buffer->own_mem_ref, user_mapped, 1870 mapped_buffer->ctag_lines, mapped_buffer->ctag_offset,
1873 dmabuf->size, 1871 mapped_buffer->flags,
1874 gk20a_aperture_str(gk20a_dmabuf_aperture(g, dmabuf))); 1872 gk20a_aperture_str(gk20a_dmabuf_aperture(g, dmabuf)));
1875 1873
1876 if (sgt) 1874 if (sgt)
1877 *sgt = mapped_buffer->sgt; 1875 *sgt = mapped_buffer->sgt;
@@ -2260,22 +2258,6 @@ u64 gk20a_vm_map(struct vm_gk20a *vm,
2260 if (!map_offset) 2258 if (!map_offset)
2261 goto clean_up; 2259 goto clean_up;
2262 2260
2263 gk20a_dbg(gpu_dbg_map,
2264 "as=%d pgsz=%d "
2265 "kind=0x%x kind_uc=0x%x flags=0x%x "
2266 "ctags=%d start=%d ctags_allocated=%d ctags_mappable=%d gv=0x%x,%08x -> 0x%x,%08x -> 0x%x,%08x size=%lld/%lld aperture=%s",
2267 vm_aspace_id(vm), gmmu_page_size,
2268 bfr.kind_v, bfr.uc_kind_v, flags,
2269 bfr.ctag_lines, bfr.ctag_offset,
2270 bfr.ctag_allocated_lines, bfr.ctag_user_mappable,
2271 hi32(map_offset), lo32(map_offset),
2272 hi32((u64)sg_dma_address(bfr.sgt->sgl)),
2273 lo32((u64)sg_dma_address(bfr.sgt->sgl)),
2274 hi32((u64)sg_phys(bfr.sgt->sgl)),
2275 lo32((u64)sg_phys(bfr.sgt->sgl)),
2276 bfr.size, mapping_size,
2277 gk20a_aperture_str(aperture));
2278
2279#if defined(NVHOST_DEBUG) 2261#if defined(NVHOST_DEBUG)
2280 { 2262 {
2281 int i; 2263 int i;
@@ -3437,7 +3419,7 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm,
3437 } 3419 }
3438 } 3420 }
3439 3421
3440 gk20a_dbg(gpu_dbg_map, "size_idx=%d, gpu_va=[%llx,%llx], iova=%llx", 3422 gk20a_dbg(gpu_dbg_map_v, "size_idx=%d, gpu_va=[%llx,%llx], iova=%llx",
3441 pgsz_idx, gpu_va, gpu_end-1, iova); 3423 pgsz_idx, gpu_va, gpu_end-1, iova);
3442 err = map_gmmu_pages(g, &vm->pdb); 3424 err = map_gmmu_pages(g, &vm->pdb);
3443 if (err) { 3425 if (err) {
@@ -3493,11 +3475,12 @@ void gk20a_vm_unmap_locked(struct mapped_buffer_node *mapped_buffer,
3493 mapped_buffer->va_node->sparse : false, 3475 mapped_buffer->va_node->sparse : false,
3494 batch); 3476 batch);
3495 3477
3496 gk20a_dbg(gpu_dbg_map, "as=%d pgsz=%d gv=0x%x,%08x own_mem_ref=%d", 3478 gk20a_dbg(gpu_dbg_map,
3497 vm_aspace_id(vm), 3479 "gv: 0x%04x_%08x pgsz=%-3dKb as=%-2d own_mem_ref=%d",
3498 vm->gmmu_page_sizes[mapped_buffer->pgsz_idx], 3480 hi32(mapped_buffer->addr), lo32(mapped_buffer->addr),
3499 hi32(mapped_buffer->addr), lo32(mapped_buffer->addr), 3481 vm->gmmu_page_sizes[mapped_buffer->pgsz_idx] >> 10,
3500 mapped_buffer->own_mem_ref); 3482 vm_aspace_id(vm),
3483 mapped_buffer->own_mem_ref);
3501 3484
3502 gk20a_mm_unpin(dev_from_vm(vm), mapped_buffer->dmabuf, 3485 gk20a_mm_unpin(dev_from_vm(vm), mapped_buffer->dmabuf,
3503 mapped_buffer->sgt); 3486 mapped_buffer->sgt);