summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-26 14:13:15 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-27 19:34:44 -0400
commit9d37d8b78c2dac7fa480493d1ab67b95290b87f1 (patch)
tree338d862a37c8639c68a22f9543fa1499f2307762 /drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
parent6431ec360bf7b7baf6dd687b1525c40114ede189 (diff)
gpu: nvgpu: Reorg fecs_trace HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the fecs_trace sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I84485ad64997270c6a0fce3c95dc9ceb0094cf6c Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1527419 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
index 0b26f657..84bf20b8 100644
--- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
@@ -327,7 +327,7 @@ static int gk20a_fecs_trace_ring_read(struct gk20a *g, int index)
327 return 0; 327 return 0;
328} 328}
329 329
330static int gk20a_fecs_trace_poll(struct gk20a *g) 330int gk20a_fecs_trace_poll(struct gk20a *g)
331{ 331{
332 struct gk20a_fecs_trace *trace = g->fecs_trace; 332 struct gk20a_fecs_trace *trace = g->fecs_trace;
333 333
@@ -566,7 +566,7 @@ static inline void gk20a_fecs_trace_debugfs_cleanup(struct gk20a *g)
566 566
567#endif /* CONFIG_DEBUG_FS */ 567#endif /* CONFIG_DEBUG_FS */
568 568
569static int gk20a_fecs_trace_init(struct gk20a *g) 569int gk20a_fecs_trace_init(struct gk20a *g)
570{ 570{
571 struct gk20a_fecs_trace *trace; 571 struct gk20a_fecs_trace *trace;
572 int err; 572 int err;
@@ -610,7 +610,7 @@ clean:
610 return err; 610 return err;
611} 611}
612 612
613static int gk20a_fecs_trace_bind_channel(struct gk20a *g, 613int gk20a_fecs_trace_bind_channel(struct gk20a *g,
614 struct channel_gk20a *ch) 614 struct channel_gk20a *ch)
615{ 615{
616 /* 616 /*
@@ -678,7 +678,7 @@ static int gk20a_fecs_trace_bind_channel(struct gk20a *g,
678 return 0; 678 return 0;
679} 679}
680 680
681static int gk20a_fecs_trace_unbind_channel(struct gk20a *g, struct channel_gk20a *ch) 681int gk20a_fecs_trace_unbind_channel(struct gk20a *g, struct channel_gk20a *ch)
682{ 682{
683 u32 context_ptr = gk20a_fecs_trace_fecs_context_ptr(g, ch); 683 u32 context_ptr = gk20a_fecs_trace_fecs_context_ptr(g, ch);
684 684
@@ -694,7 +694,7 @@ static int gk20a_fecs_trace_unbind_channel(struct gk20a *g, struct channel_gk20a
694 return 0; 694 return 0;
695} 695}
696 696
697static int gk20a_fecs_trace_reset(struct gk20a *g) 697int gk20a_fecs_trace_reset(struct gk20a *g)
698{ 698{
699 gk20a_dbg(gpu_dbg_fn|gpu_dbg_ctxsw, ""); 699 gk20a_dbg(gpu_dbg_fn|gpu_dbg_ctxsw, "");
700 700
@@ -705,7 +705,7 @@ static int gk20a_fecs_trace_reset(struct gk20a *g)
705 return gk20a_fecs_trace_set_read_index(g, 0); 705 return gk20a_fecs_trace_set_read_index(g, 0);
706} 706}
707 707
708static int gk20a_fecs_trace_deinit(struct gk20a *g) 708int gk20a_fecs_trace_deinit(struct gk20a *g)
709{ 709{
710 struct gk20a_fecs_trace *trace = g->fecs_trace; 710 struct gk20a_fecs_trace *trace = g->fecs_trace;
711 711
@@ -722,7 +722,7 @@ static int gk20a_fecs_trace_deinit(struct gk20a *g)
722 return 0; 722 return 0;
723} 723}
724 724
725static int gk20a_gr_max_entries(struct gk20a *g, 725int gk20a_gr_max_entries(struct gk20a *g,
726 struct nvgpu_ctxsw_trace_filter *filter) 726 struct nvgpu_ctxsw_trace_filter *filter)
727{ 727{
728 int n; 728 int n;
@@ -736,7 +736,7 @@ static int gk20a_gr_max_entries(struct gk20a *g,
736 return n * GK20A_FECS_TRACE_NUM_RECORDS; 736 return n * GK20A_FECS_TRACE_NUM_RECORDS;
737} 737}
738 738
739static int gk20a_fecs_trace_enable(struct gk20a *g) 739int gk20a_fecs_trace_enable(struct gk20a *g)
740{ 740{
741 struct gk20a_fecs_trace *trace = g->fecs_trace; 741 struct gk20a_fecs_trace *trace = g->fecs_trace;
742 int write; 742 int write;
@@ -765,7 +765,7 @@ static int gk20a_fecs_trace_enable(struct gk20a *g)
765 return 0; 765 return 0;
766} 766}
767 767
768static int gk20a_fecs_trace_disable(struct gk20a *g) 768int gk20a_fecs_trace_disable(struct gk20a *g)
769{ 769{
770 struct gk20a_fecs_trace *trace = g->fecs_trace; 770 struct gk20a_fecs_trace *trace = g->fecs_trace;
771 771
@@ -775,31 +775,10 @@ static int gk20a_fecs_trace_disable(struct gk20a *g)
775 return -EPERM; 775 return -EPERM;
776} 776}
777 777
778static bool gk20a_fecs_trace_is_enabled(struct gk20a *g) 778bool gk20a_fecs_trace_is_enabled(struct gk20a *g)
779{ 779{
780 struct gk20a_fecs_trace *trace = g->fecs_trace; 780 struct gk20a_fecs_trace *trace = g->fecs_trace;
781 781
782 return (trace && nvgpu_thread_is_running(&trace->poll_task)); 782 return (trace && nvgpu_thread_is_running(&trace->poll_task));
783} 783}
784
785
786void gk20a_init_fecs_trace_ops(struct gpu_ops *ops)
787{
788 gk20a_ctxsw_trace_init_ops(ops);
789 ops->fecs_trace.init = gk20a_fecs_trace_init;
790 ops->fecs_trace.deinit = gk20a_fecs_trace_deinit;
791 ops->fecs_trace.enable = gk20a_fecs_trace_enable;
792 ops->fecs_trace.disable = gk20a_fecs_trace_disable;
793 ops->fecs_trace.is_enabled = gk20a_fecs_trace_is_enabled;
794 ops->fecs_trace.reset = gk20a_fecs_trace_reset;
795 ops->fecs_trace.flush = NULL;
796 ops->fecs_trace.poll = gk20a_fecs_trace_poll;
797 ops->fecs_trace.bind_channel = gk20a_fecs_trace_bind_channel;
798 ops->fecs_trace.unbind_channel = gk20a_fecs_trace_unbind_channel;
799 ops->fecs_trace.max_entries = gk20a_gr_max_entries;
800}
801#else
802void gk20a_init_fecs_trace_ops(struct gpu_ops *ops)
803{
804}
805#endif /* CONFIG_GK20A_CTXSW_TRACE */ 784#endif /* CONFIG_GK20A_CTXSW_TRACE */