From 8673813634ed3095cba228dd0ee5f1e49ac325ee Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 20 Mar 2018 15:33:56 -0700 Subject: gpu: nvgpu: vgpu: add TEGRA_VGPU_EVENT_CHANNEL_CLEANUP RM server uses the command to notify clients to abort and clean up a channel. Clients will set has_timedout at the same time. Jira VQRM-3058 Change-Id: Iebd28ccdae52dd789ee93d65c4e816b83df8d891 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1679710 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h | 6 ++++++ drivers/gpu/nvgpu/vgpu/vgpu.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h index 3bcabadf..43a6d079 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/tegra_vgpu.h @@ -710,6 +710,10 @@ struct tegra_vgpu_semaphore_wakeup { u32 post_events; }; +struct tegra_vgpu_channel_cleanup { + u32 chid; +}; + enum { TEGRA_VGPU_INTR_GR = 0, @@ -727,6 +731,7 @@ enum { TEGRA_VGPU_EVENT_CHANNEL = 3, TEGRA_VGPU_EVENT_SM_ESR = 4, TEGRA_VGPU_EVENT_SEMAPHORE_WAKEUP = 5, + TEGRA_VGPU_EVENT_CHANNEL_CLEANUP = 6, }; struct tegra_vgpu_intr_msg { @@ -742,6 +747,7 @@ struct tegra_vgpu_intr_msg { struct tegra_vgpu_channel_event_info channel_event; struct tegra_vgpu_sm_esr_info sm_esr; struct tegra_vgpu_semaphore_wakeup sem_wakeup; + struct tegra_vgpu_channel_cleanup ch_cleanup; char padding[32]; } info; }; diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index 3b53474d..08556ee5 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -114,6 +114,14 @@ static void vgpu_handle_channel_event(struct gk20a *g, gk20a_tsg_event_id_post_event(tsg, info->event_id); } +static void vgpu_channel_abort_cleanup(struct gk20a *g, u32 chid) +{ + struct channel_gk20a *ch = &g->fifo.channel[chid]; + + ch->has_timedout = true; + g->ops.fifo.ch_abort_clean_up(ch); +} + int vgpu_intr_thread(void *dev_id) { struct gk20a *g = dev_id; @@ -169,6 +177,10 @@ int vgpu_intr_thread(void *dev_id) g->ops.semaphore_wakeup(g, !!msg->info.sem_wakeup.post_events); break; + case TEGRA_VGPU_EVENT_CHANNEL_CLEANUP: + vgpu_channel_abort_cleanup(g, + msg->info.ch_cleanup.chid); + break; default: nvgpu_err(g, "unknown event %u", msg->event); break; -- cgit v1.2.2