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
This commit is contained in:
Terje Bergstrom
2017-06-19 11:05:24 -07:00
committed by mobile promotions
parent 84703739a5
commit c50b02eb66
3 changed files with 14 additions and 14 deletions

View File

@@ -1541,20 +1541,6 @@ extern struct class nvgpu_class;
int gk20a_prepare_poweroff(struct gk20a *g);
int gk20a_finalize_poweron(struct gk20a *g);
static inline struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch)
{
struct tsg_gk20a *tsg = NULL;
if (gk20a_is_channel_marked_as_tsg(ch))
{
struct gk20a *g = ch->g;
struct fifo_gk20a *f = &g->fifo;
tsg = &f->tsg[ch->tsgid];
}
return tsg;
}
static inline void gk20a_channel_trace_sched_param(
void (*trace)(int chid, int tsgid, pid_t pid, u32 timeslice,
u32 timeout, const char *interleave,

View File

@@ -323,6 +323,19 @@ void gk20a_tsg_release(struct kref *ref)
gk20a_put(g);
}
struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch)
{
struct tsg_gk20a *tsg = NULL;
if (gk20a_is_channel_marked_as_tsg(ch)) {
struct gk20a *g = ch->g;
struct fifo_gk20a *f = &g->fifo;
tsg = &f->tsg[ch->tsgid];
}
return tsg;
}
void gk20a_init_tsg_ops(struct gpu_ops *gops)
{
gops->fifo.tsg_bind_channel = gk20a_tsg_bind_channel;

View File

@@ -30,6 +30,7 @@ void gk20a_tsg_release(struct kref *ref);
int gk20a_init_tsg_support(struct gk20a *g, u32 tsgid);
void gk20a_init_tsg_ops(struct gpu_ops *gops);
struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch);
struct tsg_gk20a {
struct gk20a *g;