summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2019-05-09 02:03:35 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-05-14 17:59:33 -0400
commit543a904e630dfe78b193803ad04d2bd12380c2b0 (patch)
tree024f656b7cdc7096b2990c2597cf61c8f97780ea /drivers/gpu/nvgpu/gm20b
parent27625718c4b2e400650885f8c892860c6c7434fd (diff)
gpu: nvgpu: fecs ctxsw trace for gm20b
Register gk20a non-arch-specific functions for gm20b gpu_ops.fecs_trace, Register nvgpu_os_linux_ops.fecs_trace.init_debugfs gp10b_fecs_trace_flush is now replaced by gm20b_fecs_trace_flush in fecs_trace_gm20b.* and the fecs_trace_gp10b.* files are removed. Bug 2052906 Change-Id: I245c91ae8e6015b87bafeb3ec023b98fe4c57501 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2115247 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r--drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.c56
-rw-r--r--drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.h32
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c21
3 files changed, 109 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.c b/drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.c
new file mode 100644
index 00000000..84772af5
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.c
@@ -0,0 +1,56 @@
1/*
2 * GP10B GPU FECS traces
3 *
4 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#include <nvgpu/gk20a.h>
26
27#include "gk20a/fecs_trace_gk20a.h"
28
29#include "fecs_trace_gm20b.h"
30
31#include <nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h>
32#include <nvgpu/hw/gm20b/hw_gr_gm20b.h>
33
34#ifdef CONFIG_GK20A_CTXSW_TRACE
35int gm20b_fecs_trace_flush(struct gk20a *g)
36{
37 struct fecs_method_op_gk20a op = {
38 .mailbox = { .id = 0, .data = 0,
39 .clr = ~0, .ok = 0, .fail = 0},
40 .method.addr = gr_fecs_method_push_adr_write_timestamp_record_v(),
41 .method.data = 0,
42 .cond.ok = GR_IS_UCODE_OP_NOT_EQUAL,
43 .cond.fail = GR_IS_UCODE_OP_SKIP,
44 };
45 int err;
46
47 nvgpu_log(g, gpu_dbg_fn|gpu_dbg_ctxsw, " ");
48
49 err = gr_gk20a_elpg_protected_call(g,
50 gr_gk20a_submit_fecs_method_op(g, op, false));
51 if (err)
52 nvgpu_err(g, "write timestamp record failed");
53
54 return err;
55}
56#endif /* CONFIG_GK20A_CTXSW_TRACE */
diff --git a/drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.h b/drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.h
new file mode 100644
index 00000000..dd98e7c4
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/fecs_trace_gm20b.h
@@ -0,0 +1,32 @@
1/*
2 * GM20B GPU FECS traces
3 *
4 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef NVGPU_FECS_TRACE_GM20B_H
26#define NVGPU_FECS_TRACE_GM20B_H
27
28struct gk20a;
29
30int gm20b_fecs_trace_flush(struct gk20a *g);
31
32#endif /* NVGPU_FECS_TRACE_GM20B_H */
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index c5bf4ff5..6de1dad5 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -29,6 +29,7 @@
29#include <nvgpu/gk20a.h> 29#include <nvgpu/gk20a.h>
30#include <nvgpu/channel.h> 30#include <nvgpu/channel.h>
31#include <nvgpu/tsg.h> 31#include <nvgpu/tsg.h>
32#include <nvgpu/ctxsw_trace.h>
32 33
33#include "common/clock_gating/gm20b_gating_reglist.h" 34#include "common/clock_gating/gm20b_gating_reglist.h"
34#include "common/bus/bus_gm20b.h" 35#include "common/bus/bus_gm20b.h"
@@ -51,6 +52,8 @@
51#include "gk20a/regops_gk20a.h" 52#include "gk20a/regops_gk20a.h"
52#include "gk20a/pmu_gk20a.h" 53#include "gk20a/pmu_gk20a.h"
53#include "gk20a/gr_gk20a.h" 54#include "gk20a/gr_gk20a.h"
55#include "gk20a/fecs_trace_gk20a.h"
56#include "gm20b/fecs_trace_gm20b.h"
54 57
55#include "gr_gm20b.h" 58#include "gr_gm20b.h"
56#include "fifo_gm20b.h" 59#include "fifo_gm20b.h"
@@ -484,6 +487,24 @@ static const struct gpu_ops gm20b_ops = {
484 .get_netlist_name = gr_gm20b_get_netlist_name, 487 .get_netlist_name = gr_gm20b_get_netlist_name,
485 .is_fw_defined = gr_gm20b_is_firmware_defined, 488 .is_fw_defined = gr_gm20b_is_firmware_defined,
486 }, 489 },
490#ifdef CONFIG_GK20A_CTXSW_TRACE
491 .fecs_trace = {
492 .alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc,
493 .free_user_buffer = gk20a_ctxsw_dev_ring_free,
494 .mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer,
495 .init = gk20a_fecs_trace_init,
496 .deinit = gk20a_fecs_trace_deinit,
497 .enable = gk20a_fecs_trace_enable,
498 .disable = gk20a_fecs_trace_disable,
499 .is_enabled = gk20a_fecs_trace_is_enabled,
500 .reset = gk20a_fecs_trace_reset,
501 .flush = gm20b_fecs_trace_flush,
502 .poll = gk20a_fecs_trace_poll,
503 .bind_channel = gk20a_fecs_trace_bind_channel,
504 .unbind_channel = gk20a_fecs_trace_unbind_channel,
505 .max_entries = gk20a_gr_max_entries,
506 },
507#endif /* CONFIG_GK20A_CTXSW_TRACE */
487 .mm = { 508 .mm = {
488 .support_sparse = gm20b_mm_support_sparse, 509 .support_sparse = gm20b_mm_support_sparse,
489 .gmmu_map = gk20a_locked_gmmu_map, 510 .gmmu_map = gk20a_locked_gmmu_map,