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/vgpu/vgpu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c') 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