summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/sched.h42
2 files changed, 45 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
index 238329be..a0af0c5c 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2011-2020, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * GK20A Graphics 4 * GK20A Graphics
5 * 5 *
@@ -71,6 +71,7 @@ struct nvgpu_setup_bind_args;
71#include <nvgpu/ecc.h> 71#include <nvgpu/ecc.h>
72#include <nvgpu/tsg.h> 72#include <nvgpu/tsg.h>
73#include <nvgpu/sec2.h> 73#include <nvgpu/sec2.h>
74#include <nvgpu/sched.h>
74 75
75#include "gk20a/clk_gk20a.h" 76#include "gk20a/clk_gk20a.h"
76#include "gk20a/ce2_gk20a.h" 77#include "gk20a/ce2_gk20a.h"
@@ -1478,6 +1479,7 @@ struct gk20a {
1478 struct pmgr_pmupstate pmgr_pmu; 1479 struct pmgr_pmupstate pmgr_pmu;
1479 struct therm_pmupstate therm_pmu; 1480 struct therm_pmupstate therm_pmu;
1480 struct nvgpu_sec2 sec2; 1481 struct nvgpu_sec2 sec2;
1482 struct nvgpu_sched_ctrl sched_ctrl;
1481 1483
1482#ifdef CONFIG_DEBUG_FS 1484#ifdef CONFIG_DEBUG_FS
1483 struct railgate_stats pstats; 1485 struct railgate_stats pstats;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/sched.h b/drivers/gpu/nvgpu/include/nvgpu/sched.h
new file mode 100644
index 00000000..c49b7d1a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/sched.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22#ifndef __NVGPU_SCHED_COMMON_H
23#define __NVGPU_SCHED_COMMON_H
24
25struct nvgpu_sched_ctrl {
26 struct nvgpu_mutex control_lock;
27 bool control_locked;
28 bool sw_ready;
29 struct nvgpu_mutex status_lock;
30 struct nvgpu_mutex busy_lock;
31
32 u64 status;
33
34 size_t bitmap_size;
35 u64 *active_tsg_bitmap;
36 u64 *recent_tsg_bitmap;
37 u64 *ref_tsg_bitmap;
38
39 struct nvgpu_cond readout_wq;
40};
41
42#endif /* __NVGPU_SCHED_COMMON_H */