summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-06-19 14:05:24 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-20 14:35:18 -0400
commitc50b02eb66a7d45612f34236e14b7b7117ae398d (patch)
tree72c2cbfd9bb8df4ec26cc396b80e91877e11298c /drivers/gpu/nvgpu
parent84703739a52f1c4e878e871429edb22dfcb4005e (diff)
gpu: nvgpu: Move tsg_gk20a_from_ch to tsg_gk20a.c
The function tsg_gk20a_from_ch() is an operation on tsg_gk20a structure, so move it to be part of tsg_gk20a.c and export via tsg_gk20a.h. JIRA NVGPU-38 Change-Id: I2afba3533ac829088a5edf8b16cf4e071b69b77a Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1505172 Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h14
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c13
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.h1
3 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 11490c27..5039f8e3 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1541,20 +1541,6 @@ extern struct class nvgpu_class;
1541int gk20a_prepare_poweroff(struct gk20a *g); 1541int gk20a_prepare_poweroff(struct gk20a *g);
1542int gk20a_finalize_poweron(struct gk20a *g); 1542int gk20a_finalize_poweron(struct gk20a *g);
1543 1543
1544static inline struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch)
1545{
1546 struct tsg_gk20a *tsg = NULL;
1547
1548 if (gk20a_is_channel_marked_as_tsg(ch))
1549 {
1550 struct gk20a *g = ch->g;
1551 struct fifo_gk20a *f = &g->fifo;
1552 tsg = &f->tsg[ch->tsgid];
1553 }
1554
1555 return tsg;
1556}
1557
1558static inline void gk20a_channel_trace_sched_param( 1544static inline void gk20a_channel_trace_sched_param(
1559 void (*trace)(int chid, int tsgid, pid_t pid, u32 timeslice, 1545 void (*trace)(int chid, int tsgid, pid_t pid, u32 timeslice,
1560 u32 timeout, const char *interleave, 1546 u32 timeout, const char *interleave,
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index 1488fbf9..46db3dd3 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -323,6 +323,19 @@ void gk20a_tsg_release(struct kref *ref)
323 gk20a_put(g); 323 gk20a_put(g);
324} 324}
325 325
326struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch)
327{
328 struct tsg_gk20a *tsg = NULL;
329
330 if (gk20a_is_channel_marked_as_tsg(ch)) {
331 struct gk20a *g = ch->g;
332 struct fifo_gk20a *f = &g->fifo;
333 tsg = &f->tsg[ch->tsgid];
334 }
335
336 return tsg;
337}
338
326void gk20a_init_tsg_ops(struct gpu_ops *gops) 339void gk20a_init_tsg_ops(struct gpu_ops *gops)
327{ 340{
328 gops->fifo.tsg_bind_channel = gk20a_tsg_bind_channel; 341 gops->fifo.tsg_bind_channel = gk20a_tsg_bind_channel;
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
index 5a13c912..72cff4f9 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
@@ -30,6 +30,7 @@ void gk20a_tsg_release(struct kref *ref);
30 30
31int gk20a_init_tsg_support(struct gk20a *g, u32 tsgid); 31int gk20a_init_tsg_support(struct gk20a *g, u32 tsgid);
32void gk20a_init_tsg_ops(struct gpu_ops *gops); 32void gk20a_init_tsg_ops(struct gpu_ops *gops);
33struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch);
33 34
34struct tsg_gk20a { 35struct tsg_gk20a {
35 struct gk20a *g; 36 struct gk20a *g;