diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 31358468..b7fb363e 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -39,6 +39,13 @@ | |||
39 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> | 39 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> |
40 | 40 | ||
41 | /* | 41 | /* |
42 | * This is required for nvgpu_vm_find_buffer() which is used in the tracing | ||
43 | * code. Once we can get and access userspace buffers without requiring | ||
44 | * direct dma_buf usage this can be removed. | ||
45 | */ | ||
46 | #include "common/linux/vm_priv.h" | ||
47 | |||
48 | /* | ||
42 | * Although channels do have pointers back to the gk20a struct that they were | 49 | * Although channels do have pointers back to the gk20a struct that they were |
43 | * created under in cases where the driver is killed that pointer can be bad. | 50 | * created under in cases where the driver is killed that pointer can be bad. |
44 | * The channel memory can be freed before the release() function for a given | 51 | * The channel memory can be freed before the release() function for a given |
@@ -550,7 +557,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) | |||
550 | /* | 557 | /* |
551 | * When releasing the channel we unbind the VM - so release the ref. | 558 | * When releasing the channel we unbind the VM - so release the ref. |
552 | */ | 559 | */ |
553 | gk20a_vm_put(ch_vm); | 560 | nvgpu_vm_put(ch_vm); |
554 | 561 | ||
555 | nvgpu_spinlock_acquire(&ch->update_fn_lock); | 562 | nvgpu_spinlock_acquire(&ch->update_fn_lock); |
556 | ch->update_fn = NULL; | 563 | ch->update_fn = NULL; |
@@ -1399,7 +1406,7 @@ static void trace_write_pushbuffer(struct channel_gk20a *c, | |||
1399 | int err; | 1406 | int err; |
1400 | 1407 | ||
1401 | words = pbdma_gp_entry1_length_v(g->entry1); | 1408 | words = pbdma_gp_entry1_length_v(g->entry1); |
1402 | err = gk20a_vm_find_buffer(c->vm, gpu_va, &dmabuf, &offset); | 1409 | err = nvgpu_vm_find_buffer(c->vm, gpu_va, &dmabuf, &offset); |
1403 | if (!err) | 1410 | if (!err) |
1404 | mem = dma_buf_vmap(dmabuf); | 1411 | mem = dma_buf_vmap(dmabuf); |
1405 | } | 1412 | } |
@@ -1901,7 +1908,7 @@ static int gk20a_channel_add_job(struct channel_gk20a *c, | |||
1901 | bool pre_alloc_enabled = channel_gk20a_is_prealloc_enabled(c); | 1908 | bool pre_alloc_enabled = channel_gk20a_is_prealloc_enabled(c); |
1902 | 1909 | ||
1903 | if (!skip_buffer_refcounting) { | 1910 | if (!skip_buffer_refcounting) { |
1904 | err = gk20a_vm_get_buffers(vm, &mapped_buffers, | 1911 | err = nvgpu_vm_get_buffers(vm, &mapped_buffers, |
1905 | &num_mapped_buffers); | 1912 | &num_mapped_buffers); |
1906 | if (err) | 1913 | if (err) |
1907 | return err; | 1914 | return err; |
@@ -1940,7 +1947,7 @@ static int gk20a_channel_add_job(struct channel_gk20a *c, | |||
1940 | return 0; | 1947 | return 0; |
1941 | 1948 | ||
1942 | err_put_buffers: | 1949 | err_put_buffers: |
1943 | gk20a_vm_put_buffers(vm, mapped_buffers, num_mapped_buffers); | 1950 | nvgpu_vm_put_buffers(vm, mapped_buffers, num_mapped_buffers); |
1944 | 1951 | ||
1945 | return err; | 1952 | return err; |
1946 | } | 1953 | } |
@@ -2039,7 +2046,7 @@ static void gk20a_channel_clean_up_jobs(struct channel_gk20a *c, | |||
2039 | } | 2046 | } |
2040 | 2047 | ||
2041 | if (job->num_mapped_buffers) | 2048 | if (job->num_mapped_buffers) |
2042 | gk20a_vm_put_buffers(vm, job->mapped_buffers, | 2049 | nvgpu_vm_put_buffers(vm, job->mapped_buffers, |
2043 | job->num_mapped_buffers); | 2050 | job->num_mapped_buffers); |
2044 | 2051 | ||
2045 | /* Remove job from channel's job list before we close the | 2052 | /* Remove job from channel's job list before we close the |