From c5f03db98a20eb4e8b83fd350d293aab6986beff Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Fri, 16 Mar 2018 11:11:27 -0700 Subject: gpu: nvgpu: add gops.fifo.ch_abort_clean_up Channel abort clean up is only needed by native and vgpu driver but not RM server. RM server expects guest will clean up itself. RM server should not set the callback. Jira VQRM-3058 Change-Id: I11b49b6f2d51c871e31de16955d487dca82609cb Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1679705 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 3 ++- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 6 ++++-- drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + 3 files changed, 7 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 bd4e2ff8..e3d9b53a 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -220,7 +220,8 @@ void gk20a_channel_abort(struct channel_gk20a *ch, bool channel_preempt) if (channel_preempt && gk20a_is_channel_marked_as_tsg(ch)) ch->g->ops.fifo.preempt_channel(ch->g, ch->chid); - gk20a_channel_abort_clean_up(ch); + if (ch->g->ops.fifo.ch_abort_clean_up) + ch->g->ops.fifo.ch_abort_clean_up(ch); } int gk20a_wait_channel_idle(struct channel_gk20a *ch) diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 6a7afad7..f069b193 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1432,7 +1432,8 @@ void gk20a_fifo_abort_tsg(struct gk20a *g, u32 tsgid, bool preempt) nvgpu_list_for_each_entry(ch, &tsg->ch_list, channel_gk20a, ch_entry) { if (gk20a_channel_get(ch)) { ch->has_timedout = true; - gk20a_channel_abort_clean_up(ch); + if (ch->g->ops.fifo.ch_abort_clean_up) + ch->g->ops.fifo.ch_abort_clean_up(ch); gk20a_channel_put(ch); } } @@ -2016,7 +2017,8 @@ int gk20a_fifo_tsg_unbind_channel(struct channel_gk20a *ch) if (!tsg_timedout) g->ops.fifo.enable_tsg(tsg); - gk20a_channel_abort_clean_up(ch); + if (ch->g->ops.fifo.ch_abort_clean_up) + ch->g->ops.fifo.ch_abort_clean_up(ch); return 0; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 7162dc73..43284ba5 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -628,6 +628,7 @@ struct gpu_ops { struct tsg_gk20a *tsg); u32 (*get_preempt_timeout)(struct gk20a *g); void (*post_event_id)(struct tsg_gk20a *tsg, int event_id); + void (*ch_abort_clean_up)(struct channel_gk20a *ch); #ifdef CONFIG_TEGRA_GK20A_NVHOST int (*alloc_syncpt_buf)(struct channel_gk20a *c, u32 syncpt_id, struct nvgpu_mem *syncpt_buf); -- cgit v1.2.2