From 0d97b549892be7b91d4497f055c62e681e12a075 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 20 Mar 2018 15:30:07 -0700 Subject: gpu: nvgpu: vgpu: add TEGRA_VGPU_EVENT_SET_ERROR_NOTIFIER RM server will notify clients with TEGRA_VGPU_EVENT_SET_ERROR_NOTIFIER whenever .set_error_notifier is called. Clients will set error notifier accordingly. Jira VQRM-3058 Change-Id: I2f435335867cce5dfd7fddb718ac6a1ff7cd66ae Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1679711 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/vgpu.c | 18 ++++++++++++++++++ 1 file changed, 18 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 08556ee5..1e77cda9 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -122,6 +122,20 @@ static void vgpu_channel_abort_cleanup(struct gk20a *g, u32 chid) g->ops.fifo.ch_abort_clean_up(ch); } +static void vgpu_set_error_notifier(struct gk20a *g, + struct tegra_vgpu_channel_set_error_notifier *p) +{ + struct channel_gk20a *ch; + + if (p->chid >= g->fifo.num_channels) { + nvgpu_err(g, "invalid chid %d", p->chid); + return; + } + + ch = &g->fifo.channel[p->chid]; + g->ops.fifo.set_error_notifier(ch, p->error); +} + int vgpu_intr_thread(void *dev_id) { struct gk20a *g = dev_id; @@ -181,6 +195,10 @@ int vgpu_intr_thread(void *dev_id) vgpu_channel_abort_cleanup(g, msg->info.ch_cleanup.chid); break; + case TEGRA_VGPU_EVENT_SET_ERROR_NOTIFIER: + vgpu_set_error_notifier(g, + &msg->info.set_error_notifier); + break; default: nvgpu_err(g, "unknown event %u", msg->event); break; -- cgit v1.2.2