summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
index a08eb047..5351750a 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
@@ -26,6 +26,7 @@
26 26
27#include <nvgpu/kmem.h> 27#include <nvgpu/kmem.h>
28#include <nvgpu/log.h> 28#include <nvgpu/log.h>
29#include <nvgpu/vm.h>
29 30
30#include "gk20a.h" 31#include "gk20a.h"
31#include "gk20a/platform_gk20a.h" 32#include "gk20a/platform_gk20a.h"
@@ -38,6 +39,14 @@
38#include <nvgpu/hw/gk20a/hw_perf_gk20a.h> 39#include <nvgpu/hw/gk20a/hw_perf_gk20a.h>
39 40
40/* 41/*
42 * Currently this code uses nvgpu_vm_map_buffer() since it takes dmabuf FDs from
43 * the dbg ioctls. That has to change; this needs to hide the usage of dmabufs
44 * in Linux specific code. All core driver usage of mapping must be done through
45 * nvgpu_gmmu_map().
46 */
47#include "common/linux/vm_priv.h"
48
49/*
41 * API to get first channel from the list of all channels 50 * API to get first channel from the list of all channels
42 * bound to the debug session 51 * bound to the debug session
43 */ 52 */
@@ -1844,7 +1853,7 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
1844 return -EBUSY; 1853 return -EBUSY;
1845 } 1854 }
1846 1855
1847 err = gk20a_init_vm(mm, vm, big_page_size, 1856 err = nvgpu_init_vm(mm, vm, big_page_size,
1848 big_page_size << 10, 1857 big_page_size << 10,
1849 NV_MM_DEFAULT_KERNEL_SIZE, 1858 NV_MM_DEFAULT_KERNEL_SIZE,
1850 NV_MM_DEFAULT_KERNEL_SIZE + NV_MM_DEFAULT_USER_SIZE, 1859 NV_MM_DEFAULT_KERNEL_SIZE + NV_MM_DEFAULT_USER_SIZE,
@@ -1860,7 +1869,7 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
1860 1869
1861 g->ops.mm.init_inst_block(&mm->perfbuf.inst_block, vm, 0); 1870 g->ops.mm.init_inst_block(&mm->perfbuf.inst_block, vm, 0);
1862 1871
1863 err = gk20a_vm_map_buffer(vm, 1872 err = nvgpu_vm_map_buffer(vm,
1864 args->dmabuf_fd, 1873 args->dmabuf_fd,
1865 &args->offset, 1874 &args->offset,
1866 0, 1875 0,
@@ -1913,7 +1922,7 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
1913 return 0; 1922 return 0;
1914 1923
1915err_unmap: 1924err_unmap:
1916 gk20a_vm_unmap_buffer(vm, args->offset, NULL); 1925 nvgpu_vm_unmap_buffer(vm, args->offset, NULL);
1917err_remove_vm: 1926err_remove_vm:
1918 gk20a_remove_vm(vm, &mm->perfbuf.inst_block); 1927 gk20a_remove_vm(vm, &mm->perfbuf.inst_block);
1919 nvgpu_mutex_release(&g->dbg_sessions_lock); 1928 nvgpu_mutex_release(&g->dbg_sessions_lock);
@@ -1952,7 +1961,7 @@ static int gk20a_perfbuf_release_locked(struct gk20a *g, u64 offset)
1952 1961
1953 err = gk20a_perfbuf_disable_locked(g); 1962 err = gk20a_perfbuf_disable_locked(g);
1954 1963
1955 gk20a_vm_unmap_buffer(vm, offset, NULL); 1964 nvgpu_vm_unmap_buffer(vm, offset, NULL);
1956 gk20a_remove_vm(vm, &mm->perfbuf.inst_block); 1965 gk20a_remove_vm(vm, &mm->perfbuf.inst_block);
1957 1966
1958 g->perfbuf.owner = NULL; 1967 g->perfbuf.owner = NULL;