summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_as.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_as.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_as.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_as.c b/drivers/gpu/nvgpu/common/linux/ioctl_as.c
index d4242955..cfc4e7ef 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_as.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_as.c
@@ -79,11 +79,22 @@ static int gk20a_as_ioctl_map_buffer_ex(
79 struct gk20a_as_share *as_share, 79 struct gk20a_as_share *as_share,
80 struct nvgpu_as_map_buffer_ex_args *args) 80 struct nvgpu_as_map_buffer_ex_args *args)
81{ 81{
82 s16 compressible_kind;
83 s16 incompressible_kind;
84
82 gk20a_dbg_fn(""); 85 gk20a_dbg_fn("");
83 86
87 if (args->flags & NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL) {
88 compressible_kind = args->compr_kind;
89 incompressible_kind = args->incompr_kind;
90 } else {
91 compressible_kind = args->kind;
92 incompressible_kind = NV_KIND_INVALID;
93 }
94
84 return nvgpu_vm_map_buffer(as_share->vm, args->dmabuf_fd, 95 return nvgpu_vm_map_buffer(as_share->vm, args->dmabuf_fd,
85 &args->offset, args->flags, 96 &args->offset, args->flags,
86 args->kind, 97 compressible_kind, incompressible_kind,
87 args->buffer_offset, 98 args->buffer_offset,
88 args->mapping_size, 99 args->mapping_size,
89 NULL); 100 NULL);
@@ -97,6 +108,7 @@ static int gk20a_as_ioctl_map_buffer(
97 return nvgpu_vm_map_buffer(as_share->vm, args->dmabuf_fd, 108 return nvgpu_vm_map_buffer(as_share->vm, args->dmabuf_fd,
98 &args->o_a.offset, 109 &args->o_a.offset,
99 args->flags, NV_KIND_DEFAULT, 110 args->flags, NV_KIND_DEFAULT,
111 NV_KIND_DEFAULT,
100 0, 0, NULL); 112 0, 0, NULL);
101 /* args->o_a.offset will be set if !err */ 113 /* args->o_a.offset will be set if !err */
102} 114}
@@ -158,6 +170,9 @@ static int gk20a_as_ioctl_map_buffer_batch(
158 } 170 }
159 171
160 for (i = 0; i < args->num_maps; ++i) { 172 for (i = 0; i < args->num_maps; ++i) {
173 s16 compressible_kind;
174 s16 incompressible_kind;
175
161 struct nvgpu_as_map_buffer_ex_args map_args; 176 struct nvgpu_as_map_buffer_ex_args map_args;
162 memset(&map_args, 0, sizeof(map_args)); 177 memset(&map_args, 0, sizeof(map_args));
163 178
@@ -167,10 +182,19 @@ static int gk20a_as_ioctl_map_buffer_batch(
167 break; 182 break;
168 } 183 }
169 184
185 if (map_args.flags &
186 NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL) {
187 compressible_kind = map_args.compr_kind;
188 incompressible_kind = map_args.incompr_kind;
189 } else {
190 compressible_kind = map_args.kind;
191 incompressible_kind = NV_KIND_INVALID;
192 }
193
170 err = nvgpu_vm_map_buffer( 194 err = nvgpu_vm_map_buffer(
171 as_share->vm, map_args.dmabuf_fd, 195 as_share->vm, map_args.dmabuf_fd,
172 &map_args.offset, map_args.flags, 196 &map_args.offset, map_args.flags,
173 map_args.kind, 197 compressible_kind, incompressible_kind,
174 map_args.buffer_offset, 198 map_args.buffer_offset,
175 map_args.mapping_size, 199 map_args.mapping_size,
176 &batch); 200 &batch);