summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
index 04109df0..3f39ced1 100644
--- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
@@ -23,6 +23,7 @@
23#include <linux/hashtable.h> 23#include <linux/hashtable.h>
24#include <linux/debugfs.h> 24#include <linux/debugfs.h>
25#include <linux/log2.h> 25#include <linux/log2.h>
26#include <trace/events/gk20a.h>
26#include <uapi/linux/nvgpu.h> 27#include <uapi/linux/nvgpu.h>
27#include "ctxsw_trace_gk20a.h" 28#include "ctxsw_trace_gk20a.h"
28#include "gk20a.h" 29#include "gk20a.h"
@@ -620,6 +621,47 @@ void gk20a_ctxsw_trace_wake_up(struct gk20a *g, int vmid)
620 wake_up_interruptible(&dev->readout_wq); 621 wake_up_interruptible(&dev->readout_wq);
621} 622}
622 623
624void gk20a_ctxsw_trace_channel_reset(struct gk20a *g, struct channel_gk20a *ch)
625{
626#ifdef CONFIG_GK20A_CTXSW_TRACE
627 struct nvgpu_ctxsw_trace_entry entry = {
628 .vmid = 0,
629 .tag = NVGPU_CTXSW_TAG_RESET,
630 .timestamp = gk20a_read_ptimer(g),
631 .context_id = 0,
632 .pid = ch->pid,
633 };
634
635 gk20a_ctxsw_trace_write(g, &entry);
636#endif
637 trace_gk20a_channel_reset(ch->hw_chid, ch->tsgid);
638 gk20a_ctxsw_trace_wake_up(g, 0);
639}
640
641void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg)
642{
643#ifdef CONFIG_GK20A_CTXSW_TRACE
644 struct nvgpu_ctxsw_trace_entry entry = {
645 .vmid = 0,
646 .tag = NVGPU_CTXSW_TAG_RESET,
647 .timestamp = gk20a_read_ptimer(g),
648 .context_id = 0,
649 .pid = 0,
650 };
651 struct channel_gk20a *ch;
652
653 mutex_lock(&tsg->ch_list_lock);
654 ch = list_entry(&tsg->ch_list, struct channel_gk20a, ch_entry);
655 mutex_unlock(&tsg->ch_list_lock);
656
657 entry.pid = ch->pid;
658
659 gk20a_ctxsw_trace_write(g, &entry);
660#endif
661 trace_gk20a_channel_reset(~0, tsg->tsgid);
662 gk20a_ctxsw_trace_wake_up(g, 0);
663}
664
623void gk20a_ctxsw_trace_init_ops(struct gpu_ops *ops) 665void gk20a_ctxsw_trace_init_ops(struct gpu_ops *ops)
624{ 666{
625 ops->fecs_trace.alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc; 667 ops->fecs_trace.alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc;