diff options
author | Antony Clince Alex <aalex@nvidia.com> | 2018-05-28 06:35:58 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-06-15 00:41:22 -0400 |
commit | d27d9ff7a89ab1a590a9cc8367af7f3a3ea698a8 (patch) | |
tree | ae4220f4ab040c702b39c6e9f1559342e3d569fa /drivers | |
parent | 4d94b32d01e66cb0ba2799775ce2d79c5ff0f2ec (diff) |
gpu: nvgpu: removed linux includes from CSS HAL
- removed inclusion of linux includes.
- replaced with nvgpu/*.h's
- reformated the function signature of
"css_hw_get_pending_snapshot" and
"css_hw_get_overflow_status" be global instead of
static.
- added get_pending_snapshot and get_overflow_status
to ops->css.
JIRA: VQRM-3699
Change-Id: I177904c263e143b414924c2c28ad6fd3cfd00132
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1732783
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c | 9 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hal_gp106.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv100/hal_gv100.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c | 15 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/css_gr_gv11b.h | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 2 |
10 files changed, 29 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c index 0fc39bf4..764ffe1a 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c | |||
@@ -22,9 +22,6 @@ | |||
22 | * DEALINGS IN THE SOFTWARE. | 22 | * DEALINGS IN THE SOFTWARE. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/dma-mapping.h> | ||
26 | #include <linux/dma-buf.h> | ||
27 | |||
28 | #include <nvgpu/bitops.h> | 25 | #include <nvgpu/bitops.h> |
29 | #include <nvgpu/kmem.h> | 26 | #include <nvgpu/kmem.h> |
30 | #include <nvgpu/lock.h> | 27 | #include <nvgpu/lock.h> |
@@ -61,14 +58,14 @@ | |||
61 | #define CSS_MAX_PERFMON_IDS 256 | 58 | #define CSS_MAX_PERFMON_IDS 256 |
62 | 59 | ||
63 | /* reports whether the hw queue overflowed */ | 60 | /* reports whether the hw queue overflowed */ |
64 | static inline bool css_hw_get_overflow_status(struct gk20a *g) | 61 | bool css_hw_get_overflow_status(struct gk20a *g) |
65 | { | 62 | { |
66 | const u32 st = perf_pmasys_control_membuf_status_overflowed_f(); | 63 | const u32 st = perf_pmasys_control_membuf_status_overflowed_f(); |
67 | return st == (gk20a_readl(g, perf_pmasys_control_r()) & st); | 64 | return st == (gk20a_readl(g, perf_pmasys_control_r()) & st); |
68 | } | 65 | } |
69 | 66 | ||
70 | /* returns how many pending snapshot entries are pending */ | 67 | /* returns how many pending snapshot entries are pending */ |
71 | static inline u32 css_hw_get_pending_snapshots(struct gk20a *g) | 68 | u32 css_hw_get_pending_snapshots(struct gk20a *g) |
72 | { | 69 | { |
73 | return gk20a_readl(g, perf_pmasys_mem_bytes_r()) / | 70 | return gk20a_readl(g, perf_pmasys_mem_bytes_r()) / |
74 | sizeof(struct gk20a_cs_snapshot_fifo_entry); | 71 | sizeof(struct gk20a_cs_snapshot_fifo_entry); |
@@ -245,7 +242,7 @@ static void css_gr_free_shared_data(struct gr_gk20a *gr) | |||
245 | } | 242 | } |
246 | 243 | ||
247 | 244 | ||
248 | static struct gk20a_cs_snapshot_client* | 245 | struct gk20a_cs_snapshot_client* |
249 | css_gr_search_client(struct nvgpu_list_node *clients, u32 perfmon) | 246 | css_gr_search_client(struct nvgpu_list_node *clients, u32 perfmon) |
250 | { | 247 | { |
251 | struct gk20a_cs_snapshot_client *client; | 248 | struct gk20a_cs_snapshot_client *client; |
diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h index bee8f4fb..8aefe848 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h | |||
@@ -129,6 +129,8 @@ struct gk20a_cs_snapshot { | |||
129 | struct gk20a_cs_snapshot_fifo_entry *hw_get; | 129 | struct gk20a_cs_snapshot_fifo_entry *hw_get; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | bool css_hw_get_overflow_status(struct gk20a *g); | ||
133 | u32 css_hw_get_pending_snapshots(struct gk20a *g); | ||
132 | void css_hw_set_handled_snapshots(struct gk20a *g, u32 done); | 134 | void css_hw_set_handled_snapshots(struct gk20a *g, u32 done); |
133 | int css_hw_enable_snapshot(struct channel_gk20a *ch, | 135 | int css_hw_enable_snapshot(struct channel_gk20a *ch, |
134 | struct gk20a_cs_snapshot_client *cs_client); | 136 | struct gk20a_cs_snapshot_client *cs_client); |
@@ -140,5 +142,7 @@ u32 css_gr_release_perfmon_ids(struct gk20a_cs_snapshot *data, | |||
140 | u32 count); | 142 | u32 count); |
141 | int css_hw_check_data_available(struct channel_gk20a *ch, u32 *pending, | 143 | int css_hw_check_data_available(struct channel_gk20a *ch, u32 *pending, |
142 | bool *hw_overflow); | 144 | bool *hw_overflow); |
145 | struct gk20a_cs_snapshot_client* | ||
146 | css_gr_search_client(struct nvgpu_list_node *clients, u32 perfmon); | ||
143 | 147 | ||
144 | #endif /* CSS_GR_GK20A_H */ | 148 | #endif /* CSS_GR_GK20A_H */ |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index bc4bd682..2605f954 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1185,6 +1185,8 @@ struct gpu_ops { | |||
1185 | u32 count); | 1185 | u32 count); |
1186 | int (*detach_snapshot)(struct channel_gk20a *ch, | 1186 | int (*detach_snapshot)(struct channel_gk20a *ch, |
1187 | struct gk20a_cs_snapshot_client *client); | 1187 | struct gk20a_cs_snapshot_client *client); |
1188 | bool (*get_overflow_status)(struct gk20a *g); | ||
1189 | u32 (*get_pending_snapshots)(struct gk20a *g); | ||
1188 | } css; | 1190 | } css; |
1189 | #endif | 1191 | #endif |
1190 | struct { | 1192 | struct { |
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 715946be..6bc13a7f 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |||
@@ -625,6 +625,8 @@ static const struct gpu_ops gm20b_ops = { | |||
625 | .set_handled_snapshots = css_hw_set_handled_snapshots, | 625 | .set_handled_snapshots = css_hw_set_handled_snapshots, |
626 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, | 626 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, |
627 | .release_perfmon_ids = css_gr_release_perfmon_ids, | 627 | .release_perfmon_ids = css_gr_release_perfmon_ids, |
628 | .get_overflow_status = css_hw_get_overflow_status, | ||
629 | .get_pending_snapshots = css_hw_get_pending_snapshots, | ||
628 | }, | 630 | }, |
629 | #endif | 631 | #endif |
630 | .falcon = { | 632 | .falcon = { |
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 632f1063..f46f20ef 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -742,6 +742,8 @@ static const struct gpu_ops gp106_ops = { | |||
742 | .set_handled_snapshots = css_hw_set_handled_snapshots, | 742 | .set_handled_snapshots = css_hw_set_handled_snapshots, |
743 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, | 743 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, |
744 | .release_perfmon_ids = css_gr_release_perfmon_ids, | 744 | .release_perfmon_ids = css_gr_release_perfmon_ids, |
745 | .get_overflow_status = css_hw_get_overflow_status, | ||
746 | .get_pending_snapshots = css_hw_get_pending_snapshots, | ||
745 | }, | 747 | }, |
746 | #endif | 748 | #endif |
747 | .xve = { | 749 | .xve = { |
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 80e07b78..d8e69dd8 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -672,6 +672,8 @@ static const struct gpu_ops gp10b_ops = { | |||
672 | .set_handled_snapshots = css_hw_set_handled_snapshots, | 672 | .set_handled_snapshots = css_hw_set_handled_snapshots, |
673 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, | 673 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, |
674 | .release_perfmon_ids = css_gr_release_perfmon_ids, | 674 | .release_perfmon_ids = css_gr_release_perfmon_ids, |
675 | .get_overflow_status = css_hw_get_overflow_status, | ||
676 | .get_pending_snapshots = css_hw_get_pending_snapshots, | ||
675 | }, | 677 | }, |
676 | #endif | 678 | #endif |
677 | .falcon = { | 679 | .falcon = { |
diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 4e1c3fb8..b881aaf7 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c | |||
@@ -832,6 +832,8 @@ static const struct gpu_ops gv100_ops = { | |||
832 | .set_handled_snapshots = gv11b_css_hw_set_handled_snapshots, | 832 | .set_handled_snapshots = gv11b_css_hw_set_handled_snapshots, |
833 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, | 833 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, |
834 | .release_perfmon_ids = css_gr_release_perfmon_ids, | 834 | .release_perfmon_ids = css_gr_release_perfmon_ids, |
835 | .get_overflow_status = gv11b_css_hw_get_overflow_status, | ||
836 | .get_pending_snapshots = gv11b_css_hw_get_pending_snapshots, | ||
835 | }, | 837 | }, |
836 | #endif | 838 | #endif |
837 | .xve = { | 839 | .xve = { |
diff --git a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c index b4e2cb79..7f03be64 100644 --- a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c | |||
@@ -22,9 +22,6 @@ | |||
22 | * DEALINGS IN THE SOFTWARE. | 22 | * DEALINGS IN THE SOFTWARE. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/dma-mapping.h> | ||
26 | #include <linux/dma-buf.h> | ||
27 | |||
28 | #include <nvgpu/bitops.h> | 25 | #include <nvgpu/bitops.h> |
29 | #include <nvgpu/kmem.h> | 26 | #include <nvgpu/kmem.h> |
30 | #include <nvgpu/lock.h> | 27 | #include <nvgpu/lock.h> |
@@ -33,7 +30,9 @@ | |||
33 | #include <nvgpu/sizes.h> | 30 | #include <nvgpu/sizes.h> |
34 | #include <nvgpu/enabled.h> | 31 | #include <nvgpu/enabled.h> |
35 | #include <nvgpu/log.h> | 32 | #include <nvgpu/log.h> |
33 | #include <nvgpu/nvgpu_mem.h> | ||
36 | #include <nvgpu/bug.h> | 34 | #include <nvgpu/bug.h> |
35 | #include <nvgpu/dma.h> | ||
37 | 36 | ||
38 | #include "gk20a/gk20a.h" | 37 | #include "gk20a/gk20a.h" |
39 | #include "gk20a/css_gr_gk20a.h" | 38 | #include "gk20a/css_gr_gk20a.h" |
@@ -44,14 +43,14 @@ | |||
44 | 43 | ||
45 | 44 | ||
46 | /* reports whether the hw queue overflowed */ | 45 | /* reports whether the hw queue overflowed */ |
47 | static inline bool css_hw_get_overflow_status(struct gk20a *g) | 46 | bool gv11b_css_hw_get_overflow_status(struct gk20a *g) |
48 | { | 47 | { |
49 | const u32 st = perf_pmasys_control_membuf_status_overflowed_f(); | 48 | const u32 st = perf_pmasys_control_membuf_status_overflowed_f(); |
50 | return st == (gk20a_readl(g, perf_pmasys_control_r()) & st); | 49 | return st == (gk20a_readl(g, perf_pmasys_control_r()) & st); |
51 | } | 50 | } |
52 | 51 | ||
53 | /* returns how many pending snapshot entries are pending */ | 52 | /* returns how many pending snapshot entries are pending */ |
54 | static inline u32 css_hw_get_pending_snapshots(struct gk20a *g) | 53 | u32 gv11b_css_hw_get_pending_snapshots(struct gk20a *g) |
55 | { | 54 | { |
56 | return gk20a_readl(g, perf_pmasys_mem_bytes_r()) / | 55 | return gk20a_readl(g, perf_pmasys_mem_bytes_r()) / |
57 | sizeof(struct gk20a_cs_snapshot_fifo_entry); | 56 | sizeof(struct gk20a_cs_snapshot_fifo_entry); |
@@ -74,7 +73,7 @@ static void gv11b_css_hw_reset_streaming(struct gk20a *g) | |||
74 | perf_pmasys_control_membuf_clear_status_doit_f()); | 73 | perf_pmasys_control_membuf_clear_status_doit_f()); |
75 | 74 | ||
76 | /* pointing all pending snapshots as handled */ | 75 | /* pointing all pending snapshots as handled */ |
77 | gv11b_css_hw_set_handled_snapshots(g, css_hw_get_pending_snapshots(g)); | 76 | gv11b_css_hw_set_handled_snapshots(g, gv11b_css_hw_get_pending_snapshots(g)); |
78 | } | 77 | } |
79 | 78 | ||
80 | /* informs hw how many snapshots have been processed (frees up fifo space) */ | 79 | /* informs hw how many snapshots have been processed (frees up fifo space) */ |
@@ -199,10 +198,10 @@ int gv11b_css_hw_check_data_available(struct channel_gk20a *ch, u32 *pending, | |||
199 | if (!css->hw_snapshot) | 198 | if (!css->hw_snapshot) |
200 | return -EINVAL; | 199 | return -EINVAL; |
201 | 200 | ||
202 | *pending = css_hw_get_pending_snapshots(g); | 201 | *pending = gv11b_css_hw_get_pending_snapshots(g); |
203 | if (!*pending) | 202 | if (!*pending) |
204 | return 0; | 203 | return 0; |
205 | 204 | ||
206 | *hw_overflow = css_hw_get_overflow_status(g); | 205 | *hw_overflow = gv11b_css_hw_get_overflow_status(g); |
207 | return 0; | 206 | return 0; |
208 | } | 207 | } |
diff --git a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.h index 186f5fcc..26db4ee8 100644 --- a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.h | |||
@@ -31,5 +31,8 @@ void gv11b_css_hw_disable_snapshot(struct gr_gk20a *gr); | |||
31 | int gv11b_css_hw_check_data_available(struct channel_gk20a *ch, u32 *pending, | 31 | int gv11b_css_hw_check_data_available(struct channel_gk20a *ch, u32 *pending, |
32 | bool *hw_overflow); | 32 | bool *hw_overflow); |
33 | void gv11b_css_hw_set_handled_snapshots(struct gk20a *g, u32 done); | 33 | void gv11b_css_hw_set_handled_snapshots(struct gk20a *g, u32 done); |
34 | bool gv11b_css_hw_get_overflow_status(struct gk20a *g); | ||
35 | u32 gv11b_css_hw_get_pending_snapshots(struct gk20a *g); | ||
36 | |||
34 | 37 | ||
35 | #endif /* CSS_GR_GV11B_H */ | 38 | #endif /* CSS_GR_GV11B_H */ |
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index ab9ff707..84d8a811 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -761,6 +761,8 @@ static const struct gpu_ops gv11b_ops = { | |||
761 | .set_handled_snapshots = gv11b_css_hw_set_handled_snapshots, | 761 | .set_handled_snapshots = gv11b_css_hw_set_handled_snapshots, |
762 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, | 762 | .allocate_perfmon_ids = css_gr_allocate_perfmon_ids, |
763 | .release_perfmon_ids = css_gr_release_perfmon_ids, | 763 | .release_perfmon_ids = css_gr_release_perfmon_ids, |
764 | .get_overflow_status = gv11b_css_hw_get_overflow_status, | ||
765 | .get_pending_snapshots = gv11b_css_hw_get_pending_snapshots, | ||
764 | }, | 766 | }, |
765 | #endif | 767 | #endif |
766 | .falcon = { | 768 | .falcon = { |