From 7d6d0405311337456f50d6fa032963c18d2c9f9f Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 13 Sep 2017 05:02:21 -0700 Subject: gpu: nvgpu: support platform specific TSG enable/disable Add platform specific operations to enable/disable a TSG and use them instead of directly calling enable/disable APIs For gm20b/gp106/gp10b we continue to use gk20a_enable_tsg() and gk20a_disable_tsg() as platform specific operations Bug 1739362 Change-Id: I2dd0f38c8303757e8c7a47d8da0e30a790e514f0 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1560635 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Seshendra Gadagottu Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 4 ++-- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 89862e63..d0d5c41f 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -200,7 +200,7 @@ int gk20a_enable_channel_tsg(struct gk20a *g, struct channel_gk20a *ch) if (gk20a_is_channel_marked_as_tsg(ch)) { tsg = &g->fifo.tsg[ch->tsgid]; - gk20a_enable_tsg(tsg); + g->ops.fifo.enable_tsg(tsg); } else { g->ops.fifo.enable_channel(ch); } @@ -214,7 +214,7 @@ int gk20a_disable_channel_tsg(struct gk20a *g, struct channel_gk20a *ch) if (gk20a_is_channel_marked_as_tsg(ch)) { tsg = &g->fifo.tsg[ch->tsgid]; - gk20a_disable_tsg(tsg); + g->ops.fifo.disable_tsg(tsg); } else { g->ops.fifo.disable_channel(ch); } diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 7062a8a0..88ce6a83 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1383,7 +1383,7 @@ void gk20a_fifo_abort_tsg(struct gk20a *g, u32 tsgid, bool preempt) gk20a_dbg_fn(""); - gk20a_disable_tsg(tsg); + g->ops.fifo.disable_tsg(tsg); if (preempt) g->ops.fifo.preempt_tsg(g, tsgid); diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index d2a752d7..4564b6e9 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -475,6 +475,8 @@ struct gpu_ops { int (*resetup_ramfc)(struct channel_gk20a *c); int (*preempt_channel)(struct gk20a *g, u32 chid); int (*preempt_tsg)(struct gk20a *g, u32 tsgid); + int (*enable_tsg)(struct tsg_gk20a *tsg); + int (*disable_tsg)(struct tsg_gk20a *tsg); int (*reschedule_runlist)(struct gk20a *g, u32 runlist_id); int (*update_runlist)(struct gk20a *g, u32 runlist_id, u32 chid, bool add, -- cgit v1.2.2