diff options
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ctxsw_trace.c | 20 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vgpu/fecs_trace_vgpu.c | 4 |
2 files changed, 18 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c b/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c index 4983061b..16b040da 100644 --- a/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c +++ b/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c | |||
@@ -46,7 +46,7 @@ struct gk20a_ctxsw_dev { | |||
46 | 46 | ||
47 | struct nvgpu_ctxsw_ring_header *hdr; | 47 | struct nvgpu_ctxsw_ring_header *hdr; |
48 | struct nvgpu_gpu_ctxsw_trace_entry *ents; | 48 | struct nvgpu_gpu_ctxsw_trace_entry *ents; |
49 | struct nvgpu_ctxsw_trace_filter filter; | 49 | struct nvgpu_gpu_ctxsw_trace_filter filter; |
50 | bool write_enabled; | 50 | bool write_enabled; |
51 | struct nvgpu_cond readout_wq; | 51 | struct nvgpu_cond readout_wq; |
52 | size_t size; | 52 | size_t size; |
@@ -244,13 +244,25 @@ static int gk20a_ctxsw_dev_ioctl_ring_setup(struct gk20a_ctxsw_dev *dev, | |||
244 | return ret; | 244 | return ret; |
245 | } | 245 | } |
246 | 246 | ||
247 | static void nvgpu_set_ctxsw_trace_filter_args(struct nvgpu_gpu_ctxsw_trace_filter *filter_dst, | ||
248 | struct nvgpu_ctxsw_trace_filter *filter_src) | ||
249 | { | ||
250 | memcpy(filter_dst->tag_bits, filter_src->tag_bits, (NVGPU_CTXSW_FILTER_SIZE + 63) / 64); | ||
251 | } | ||
252 | |||
253 | static void nvgpu_get_ctxsw_trace_filter_args(struct nvgpu_ctxsw_trace_filter *filter_dst, | ||
254 | struct nvgpu_gpu_ctxsw_trace_filter *filter_src) | ||
255 | { | ||
256 | memcpy(filter_dst->tag_bits, filter_src->tag_bits, (NVGPU_CTXSW_FILTER_SIZE + 63) / 64); | ||
257 | } | ||
258 | |||
247 | static int gk20a_ctxsw_dev_ioctl_set_filter(struct gk20a_ctxsw_dev *dev, | 259 | static int gk20a_ctxsw_dev_ioctl_set_filter(struct gk20a_ctxsw_dev *dev, |
248 | struct nvgpu_ctxsw_trace_filter_args *args) | 260 | struct nvgpu_ctxsw_trace_filter_args *args) |
249 | { | 261 | { |
250 | struct gk20a *g = dev->g; | 262 | struct gk20a *g = dev->g; |
251 | 263 | ||
252 | nvgpu_mutex_acquire(&dev->write_lock); | 264 | nvgpu_mutex_acquire(&dev->write_lock); |
253 | dev->filter = args->filter; | 265 | nvgpu_set_ctxsw_trace_filter_args(&dev->filter, &args->filter); |
254 | nvgpu_mutex_release(&dev->write_lock); | 266 | nvgpu_mutex_release(&dev->write_lock); |
255 | 267 | ||
256 | if (g->ops.fecs_trace.set_filter) | 268 | if (g->ops.fecs_trace.set_filter) |
@@ -262,7 +274,7 @@ static int gk20a_ctxsw_dev_ioctl_get_filter(struct gk20a_ctxsw_dev *dev, | |||
262 | struct nvgpu_ctxsw_trace_filter_args *args) | 274 | struct nvgpu_ctxsw_trace_filter_args *args) |
263 | { | 275 | { |
264 | nvgpu_mutex_acquire(&dev->write_lock); | 276 | nvgpu_mutex_acquire(&dev->write_lock); |
265 | args->filter = dev->filter; | 277 | nvgpu_get_ctxsw_trace_filter_args(&args->filter, &dev->filter); |
266 | nvgpu_mutex_release(&dev->write_lock); | 278 | nvgpu_mutex_release(&dev->write_lock); |
267 | 279 | ||
268 | return 0; | 280 | return 0; |
@@ -650,7 +662,7 @@ int gk20a_ctxsw_trace_write(struct gk20a *g, | |||
650 | goto drop; | 662 | goto drop; |
651 | } | 663 | } |
652 | 664 | ||
653 | if (!NVGPU_CTXSW_FILTER_ISSET(entry->tag, &dev->filter)) { | 665 | if (!NVGPU_GPU_CTXSW_FILTER_ISSET(entry->tag, &dev->filter)) { |
654 | reason = "filtered out"; | 666 | reason = "filtered out"; |
655 | goto filter; | 667 | goto filter; |
656 | } | 668 | } |
diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/fecs_trace_vgpu.c b/drivers/gpu/nvgpu/os/linux/vgpu/fecs_trace_vgpu.c index 255ee2bd..c878316a 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/fecs_trace_vgpu.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/fecs_trace_vgpu.c | |||
@@ -190,7 +190,7 @@ int vgpu_mmap_user_buffer(struct gk20a *g, struct vm_area_struct *vma) | |||
190 | 190 | ||
191 | #ifdef CONFIG_GK20A_CTXSW_TRACE | 191 | #ifdef CONFIG_GK20A_CTXSW_TRACE |
192 | int vgpu_fecs_trace_max_entries(struct gk20a *g, | 192 | int vgpu_fecs_trace_max_entries(struct gk20a *g, |
193 | struct nvgpu_ctxsw_trace_filter *filter) | 193 | struct nvgpu_gpu_ctxsw_trace_filter *filter) |
194 | { | 194 | { |
195 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 195 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
196 | 196 | ||
@@ -202,7 +202,7 @@ int vgpu_fecs_trace_max_entries(struct gk20a *g, | |||
202 | #endif | 202 | #endif |
203 | 203 | ||
204 | int vgpu_fecs_trace_set_filter(struct gk20a *g, | 204 | int vgpu_fecs_trace_set_filter(struct gk20a *g, |
205 | struct nvgpu_ctxsw_trace_filter *filter) | 205 | struct nvgpu_gpu_ctxsw_trace_filter *filter) |
206 | { | 206 | { |
207 | struct tegra_vgpu_cmd_msg msg = { | 207 | struct tegra_vgpu_cmd_msg msg = { |
208 | .cmd = TEGRA_VGPU_CMD_FECS_TRACE_SET_FILTER, | 208 | .cmd = TEGRA_VGPU_CMD_FECS_TRACE_SET_FILTER, |