summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c13
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c41
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h20
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c22
-rw-r--r--drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c12
-rw-r--r--drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h4
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c22
8 files changed, 78 insertions, 60 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
index f3866d6a..cc05ceff 100644
--- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c
@@ -170,7 +170,7 @@ static int gk20a_ctxsw_dev_alloc_buffer(struct gk20a_ctxsw_dev *dev,
170 return 0; 170 return 0;
171} 171}
172 172
173static int gk20a_ctxsw_dev_ring_alloc(struct gk20a *g, 173int gk20a_ctxsw_dev_ring_alloc(struct gk20a *g,
174 void **buf, size_t *size) 174 void **buf, size_t *size)
175{ 175{
176 struct nvgpu_ctxsw_ring_header *hdr; 176 struct nvgpu_ctxsw_ring_header *hdr;
@@ -194,7 +194,7 @@ static int gk20a_ctxsw_dev_ring_alloc(struct gk20a *g,
194 return 0; 194 return 0;
195} 195}
196 196
197static int gk20a_ctxsw_dev_ring_free(struct gk20a *g) 197int gk20a_ctxsw_dev_ring_free(struct gk20a *g)
198{ 198{
199 struct gk20a_ctxsw_dev *dev = &g->ctxsw_trace->devs[0]; 199 struct gk20a_ctxsw_dev *dev = &g->ctxsw_trace->devs[0];
200 200
@@ -457,7 +457,7 @@ static struct vm_operations_struct gk20a_ctxsw_dev_vma_ops = {
457 .close = gk20a_ctxsw_dev_vma_close, 457 .close = gk20a_ctxsw_dev_vma_close,
458}; 458};
459 459
460static int gk20a_ctxsw_dev_mmap_buffer(struct gk20a *g, 460int gk20a_ctxsw_dev_mmap_buffer(struct gk20a *g,
461 struct vm_area_struct *vma) 461 struct vm_area_struct *vma)
462{ 462{
463 return remap_vmalloc_range(vma, g->ctxsw_trace->devs[0].hdr, 0); 463 return remap_vmalloc_range(vma, g->ctxsw_trace->devs[0].hdr, 0);
@@ -715,10 +715,3 @@ void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg)
715#endif 715#endif
716 trace_gk20a_channel_reset(~0, tsg->tsgid); 716 trace_gk20a_channel_reset(~0, tsg->tsgid);
717} 717}
718
719void gk20a_ctxsw_trace_init_ops(struct gpu_ops *ops)
720{
721 ops->fecs_trace.alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc;
722 ops->fecs_trace.free_user_buffer = gk20a_ctxsw_dev_ring_free;
723 ops->fecs_trace.mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer;
724}
diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h
index 5262538a..887fe415 100644
--- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h
@@ -35,12 +35,14 @@ long gk20a_ctxsw_dev_ioctl(struct file *filp,
35ssize_t gk20a_ctxsw_dev_read(struct file *, char __user *, size_t, loff_t *); 35ssize_t gk20a_ctxsw_dev_read(struct file *, char __user *, size_t, loff_t *);
36unsigned int gk20a_ctxsw_dev_poll(struct file *, struct poll_table_struct *); 36unsigned int gk20a_ctxsw_dev_poll(struct file *, struct poll_table_struct *);
37int gk20a_ctxsw_dev_mmap(struct file *, struct vm_area_struct *); 37int gk20a_ctxsw_dev_mmap(struct file *, struct vm_area_struct *);
38int gk20a_ctxsw_dev_ring_alloc(struct gk20a *g, void **buf, size_t *size);
39int gk20a_ctxsw_dev_ring_free(struct gk20a *g);
40int gk20a_ctxsw_dev_mmap_buffer(struct gk20a *g, struct vm_area_struct *vma);
38 41
39int gk20a_ctxsw_trace_init(struct gk20a *); 42int gk20a_ctxsw_trace_init(struct gk20a *);
40void gk20a_ctxsw_trace_cleanup(struct gk20a *); 43void gk20a_ctxsw_trace_cleanup(struct gk20a *);
41int gk20a_ctxsw_trace_write(struct gk20a *, struct nvgpu_ctxsw_trace_entry *); 44int gk20a_ctxsw_trace_write(struct gk20a *, struct nvgpu_ctxsw_trace_entry *);
42void gk20a_ctxsw_trace_wake_up(struct gk20a *g, int vmid); 45void gk20a_ctxsw_trace_wake_up(struct gk20a *g, int vmid);
43void gk20a_ctxsw_trace_init_ops(struct gpu_ops *ops);
44 46
45void gk20a_ctxsw_trace_channel_reset(struct gk20a *g, struct channel_gk20a *ch); 47void gk20a_ctxsw_trace_channel_reset(struct gk20a *g, struct channel_gk20a *ch);
46void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg); 48void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg);
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 */
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h
index 4979d6c6..454a33e8 100644
--- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -14,7 +14,21 @@
14#ifndef __FECS_TRACE_GK20A_H 14#ifndef __FECS_TRACE_GK20A_H
15#define __FECS_TRACE_GK20A_H 15#define __FECS_TRACE_GK20A_H
16 16
17struct gpu_ops; 17struct gk20a;
18void gk20a_init_fecs_trace_ops(struct gpu_ops *ops); 18struct channel_gk20a;
19struct nvgpu_ctxsw_trace_filter;
20
21int gk20a_fecs_trace_poll(struct gk20a *g);
22int gk20a_fecs_trace_init(struct gk20a *g);
23int gk20a_fecs_trace_bind_channel(struct gk20a *g,
24 struct channel_gk20a *ch);
25int gk20a_fecs_trace_unbind_channel(struct gk20a *g, struct channel_gk20a *ch);
26int gk20a_fecs_trace_reset(struct gk20a *g);
27int gk20a_fecs_trace_deinit(struct gk20a *g);
28int gk20a_gr_max_entries(struct gk20a *g,
29 struct nvgpu_ctxsw_trace_filter *filter);
30int gk20a_fecs_trace_enable(struct gk20a *g);
31int gk20a_fecs_trace_disable(struct gk20a *g);
32bool gk20a_fecs_trace_is_enabled(struct gk20a *g);
19 33
20#endif /* __FECS_TRACE_GK20A_H */ 34#endif /* __FECS_TRACE_GK20A_H */
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index 763dab44..dd162109 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -15,6 +15,8 @@
15 15
16#include "gk20a/gk20a.h" 16#include "gk20a/gk20a.h"
17#include "gk20a/fifo_gk20a.h" 17#include "gk20a/fifo_gk20a.h"
18#include "gk20a/ctxsw_trace_gk20a.h"
19#include "gk20a/fecs_trace_gk20a.h"
18#include "gk20a/dbg_gpu_gk20a.h" 20#include "gk20a/dbg_gpu_gk20a.h"
19#include "gk20a/css_gr_gk20a.h" 21#include "gk20a/css_gr_gk20a.h"
20#include "gk20a/bus_gk20a.h" 22#include "gk20a/bus_gk20a.h"
@@ -317,6 +319,24 @@ static const struct gpu_ops gp106_ops = {
317 .get_netlist_name = gr_gp106_get_netlist_name, 319 .get_netlist_name = gr_gp106_get_netlist_name,
318 .is_fw_defined = gr_gp106_is_firmware_defined, 320 .is_fw_defined = gr_gp106_is_firmware_defined,
319 }, 321 },
322#ifdef CONFIG_GK20A_CTXSW_TRACE
323 .fecs_trace = {
324 .alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc,
325 .free_user_buffer = gk20a_ctxsw_dev_ring_free,
326 .mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer,
327 .init = gk20a_fecs_trace_init,
328 .deinit = gk20a_fecs_trace_deinit,
329 .enable = gk20a_fecs_trace_enable,
330 .disable = gk20a_fecs_trace_disable,
331 .is_enabled = gk20a_fecs_trace_is_enabled,
332 .reset = gk20a_fecs_trace_reset,
333 .flush = gp10b_fecs_trace_flush,
334 .poll = gk20a_fecs_trace_poll,
335 .bind_channel = gk20a_fecs_trace_bind_channel,
336 .unbind_channel = gk20a_fecs_trace_unbind_channel,
337 .max_entries = gk20a_gr_max_entries,
338 },
339#endif /* CONFIG_GK20A_CTXSW_TRACE */
320 .mc = { 340 .mc = {
321 .intr_enable = mc_gp10b_intr_enable, 341 .intr_enable = mc_gp10b_intr_enable,
322 .intr_unit_config = mc_gp10b_intr_unit_config, 342 .intr_unit_config = mc_gp10b_intr_unit_config,
@@ -408,6 +428,7 @@ int gp106_init_hal(struct gk20a *g)
408 gops->clock_gating = gp106_ops.clock_gating; 428 gops->clock_gating = gp106_ops.clock_gating;
409 gops->fifo = gp106_ops.fifo; 429 gops->fifo = gp106_ops.fifo;
410 gops->gr_ctx = gp106_ops.gr_ctx; 430 gops->gr_ctx = gp106_ops.gr_ctx;
431 gops->fecs_trace = gp106_ops.fecs_trace;
411 gops->mc = gp106_ops.mc; 432 gops->mc = gp106_ops.mc;
412 gops->debug = gp106_ops.debug; 433 gops->debug = gp106_ops.debug;
413 gops->dbg_session_ops = gp106_ops.dbg_session_ops; 434 gops->dbg_session_ops = gp106_ops.dbg_session_ops;
@@ -433,7 +454,6 @@ int gp106_init_hal(struct gk20a *g)
433 454
434 g->bootstrap_owner = LSF_FALCON_ID_SEC2; 455 g->bootstrap_owner = LSF_FALCON_ID_SEC2;
435 gp106_init_gr(g); 456 gp106_init_gr(g);
436 gp10b_init_fecs_trace_ops(gops);
437 gp106_init_fb(gops); 457 gp106_init_fb(gops);
438 gp106_init_mm(gops); 458 gp106_init_mm(gops);
439 gp106_init_pmu_ops(g); 459 gp106_init_pmu_ops(g);
diff --git a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c
index 723da1a2..bec40512 100644
--- a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.c
@@ -22,7 +22,7 @@
22#include <nvgpu/hw/gp10b/hw_gr_gp10b.h> 22#include <nvgpu/hw/gp10b/hw_gr_gp10b.h>
23 23
24#ifdef CONFIG_GK20A_CTXSW_TRACE 24#ifdef CONFIG_GK20A_CTXSW_TRACE
25static int gp10b_fecs_trace_flush(struct gk20a *g) 25int gp10b_fecs_trace_flush(struct gk20a *g)
26{ 26{
27 struct fecs_method_op_gk20a op = { 27 struct fecs_method_op_gk20a op = {
28 .mailbox = { .id = 0, .data = 0, 28 .mailbox = { .id = 0, .data = 0,
@@ -43,14 +43,4 @@ static int gp10b_fecs_trace_flush(struct gk20a *g)
43 43
44 return err; 44 return err;
45} 45}
46
47void gp10b_init_fecs_trace_ops(struct gpu_ops *ops)
48{
49 gk20a_init_fecs_trace_ops(ops);
50 ops->fecs_trace.flush = gp10b_fecs_trace_flush;
51}
52#else
53void gp10b_init_fecs_trace_ops(struct gpu_ops *ops)
54{
55}
56#endif /* CONFIG_GK20A_CTXSW_TRACE */ 46#endif /* CONFIG_GK20A_CTXSW_TRACE */
diff --git a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h
index 656bc551..43ecb6fc 100644
--- a/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/fecs_trace_gp10b.h
@@ -16,8 +16,8 @@
16#ifndef _NVGPU_FECS_TRACE_GP10B_H_ 16#ifndef _NVGPU_FECS_TRACE_GP10B_H_
17#define _NVGPU_FECS_TRACE_GP10B_H_ 17#define _NVGPU_FECS_TRACE_GP10B_H_
18 18
19struct gpu_ops; 19struct gk20a;
20 20
21void gp10b_init_fecs_trace_ops(struct gpu_ops *); 21int gp10b_fecs_trace_flush(struct gk20a *g);
22 22
23#endif 23#endif
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 80018910..1574ac56 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -15,6 +15,8 @@
15 15
16#include "gk20a/gk20a.h" 16#include "gk20a/gk20a.h"
17#include "gk20a/fifo_gk20a.h" 17#include "gk20a/fifo_gk20a.h"
18#include "gk20a/ctxsw_trace_gk20a.h"
19#include "gk20a/fecs_trace_gk20a.h"
18#include "gk20a/dbg_gpu_gk20a.h" 20#include "gk20a/dbg_gpu_gk20a.h"
19#include "gk20a/css_gr_gk20a.h" 21#include "gk20a/css_gr_gk20a.h"
20#include "gk20a/bus_gk20a.h" 22#include "gk20a/bus_gk20a.h"
@@ -283,6 +285,24 @@ static const struct gpu_ops gp10b_ops = {
283 .get_netlist_name = gr_gp10b_get_netlist_name, 285 .get_netlist_name = gr_gp10b_get_netlist_name,
284 .is_fw_defined = gr_gp10b_is_firmware_defined, 286 .is_fw_defined = gr_gp10b_is_firmware_defined,
285 }, 287 },
288#ifdef CONFIG_GK20A_CTXSW_TRACE
289 .fecs_trace = {
290 .alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc,
291 .free_user_buffer = gk20a_ctxsw_dev_ring_free,
292 .mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer,
293 .init = gk20a_fecs_trace_init,
294 .deinit = gk20a_fecs_trace_deinit,
295 .enable = gk20a_fecs_trace_enable,
296 .disable = gk20a_fecs_trace_disable,
297 .is_enabled = gk20a_fecs_trace_is_enabled,
298 .reset = gk20a_fecs_trace_reset,
299 .flush = gp10b_fecs_trace_flush,
300 .poll = gk20a_fecs_trace_poll,
301 .bind_channel = gk20a_fecs_trace_bind_channel,
302 .unbind_channel = gk20a_fecs_trace_unbind_channel,
303 .max_entries = gk20a_gr_max_entries,
304 },
305#endif /* CONFIG_GK20A_CTXSW_TRACE */
286 .mc = { 306 .mc = {
287 .intr_enable = mc_gp10b_intr_enable, 307 .intr_enable = mc_gp10b_intr_enable,
288 .intr_unit_config = mc_gp10b_intr_unit_config, 308 .intr_unit_config = mc_gp10b_intr_unit_config,
@@ -357,6 +377,7 @@ int gp10b_init_hal(struct gk20a *g)
357 gops->clock_gating = gp10b_ops.clock_gating; 377 gops->clock_gating = gp10b_ops.clock_gating;
358 gops->fifo = gp10b_ops.fifo; 378 gops->fifo = gp10b_ops.fifo;
359 gops->gr_ctx = gp10b_ops.gr_ctx; 379 gops->gr_ctx = gp10b_ops.gr_ctx;
380 gops->fecs_trace = gp10b_ops.fecs_trace;
360 gops->mc = gp10b_ops.mc; 381 gops->mc = gp10b_ops.mc;
361 gops->debug = gp10b_ops.debug; 382 gops->debug = gp10b_ops.debug;
362 gops->dbg_session_ops = gp10b_ops.dbg_session_ops; 383 gops->dbg_session_ops = gp10b_ops.dbg_session_ops;
@@ -416,7 +437,6 @@ int gp10b_init_hal(struct gk20a *g)
416 437
417 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT; 438 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT;
418 gp10b_init_gr(g); 439 gp10b_init_gr(g);
419 gp10b_init_fecs_trace_ops(gops);
420 gp10b_init_fb(gops); 440 gp10b_init_fb(gops);
421 gp10b_init_mm(gops); 441 gp10b_init_mm(gops);
422 gp10b_init_pmu_ops(g); 442 gp10b_init_pmu_ops(g);