summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os/linux/ctxsw_trace.c
diff options
context:
space:
mode:
authorVaibhav Kachore <vkachore@nvidia.com>2018-08-20 07:29:45 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-31 15:16:19 -0400
commit7bf80a1c69a07f81225270e90a57a1c41d202859 (patch)
tree278ed4c9197997734bac69b5695a559ec5278082 /drivers/gpu/nvgpu/os/linux/ctxsw_trace.c
parent064ba6a7ef236a7bb1085715c6ab37810f230bbf (diff)
gpu: nvgpu: remove use of NVGPU_CTXSW_FILTER_ISSET
- Remove the usage of NVGPU_CTXSW_FILTER_ISSET splattered across nvgpu, and replace with a MACRO defined in common code. The usage is still inside Linux, but this helps the subsequent unification efforts, e.g. to unify the fecs trace path. - Remove "uapi/linux/nvgpu.h" from common code. EVLR-3078 Change-Id: I60b0e1627576a4b255671d58530d8c773ea6154c Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1803210 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/ctxsw_trace.c')
-rw-r--r--drivers/gpu/nvgpu/os/linux/ctxsw_trace.c20
1 files changed, 16 insertions, 4 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
247static 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
253static 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
247static int gk20a_ctxsw_dev_ioctl_set_filter(struct gk20a_ctxsw_dev *dev, 259static 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 }