From 43de9024fe1ceb204ec0802ffd442b2d30c90324 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Thu, 24 Dec 2015 14:59:04 +0530 Subject: gpu: nvgpu: API to post channel events Add new API gk20a_channel_post_event() which adds channel event and also calls wake_up() for channel's semaphore wq Bug 200156699 Change-Id: If56f1bf8edcce79c9248809f8476ed853b7d2d9d Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/927132 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 9 +++++++-- drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 3 +-- drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 5 ++--- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 53b85ad8..444fec13 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -2501,6 +2501,12 @@ void gk20a_channel_event(struct channel_gk20a *ch) mutex_unlock(&ch->poll_events.lock); } +void gk20a_channel_post_event(struct channel_gk20a *ch) +{ + gk20a_channel_event(ch); + wake_up_interruptible_all(&ch->semaphore_wq); +} + unsigned int gk20a_channel_poll(struct file *filep, poll_table *wait) { unsigned int mask = 0; @@ -2656,8 +2662,7 @@ void gk20a_channel_semaphore_wakeup(struct gk20a *g) for (chid = 0; chid < f->num_channels; chid++) { struct channel_gk20a *c = g->fifo.channel+chid; if (gk20a_channel_get(c)) { - gk20a_channel_event(c); - wake_up_interruptible_all(&c->semaphore_wq); + gk20a_channel_post_event(c); gk20a_channel_update(c, 0); gk20a_channel_put(c); } diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 4f0632dd..24a2fe11 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -223,6 +223,7 @@ struct channel_gk20a *gk20a_get_channel_from_file(int fd); void gk20a_channel_update(struct channel_gk20a *c, int nr_completed); unsigned int gk20a_channel_poll(struct file *filep, poll_table *wait); void gk20a_channel_event(struct channel_gk20a *ch); +void gk20a_channel_post_event(struct channel_gk20a *ch); void gk20a_init_channel(struct gpu_ops *gops); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index bfb11566..6e3ea00a 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -4890,8 +4890,7 @@ static int gk20a_gr_handle_semaphore_pending(struct gk20a *g, struct fifo_gk20a *f = &g->fifo; struct channel_gk20a *ch = &f->channel[isr_data->chid]; - gk20a_channel_event(ch); - wake_up(&ch->semaphore_wq); + gk20a_channel_post_event(ch); return 0; } diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index 373dfd56..4a22441c 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -1,7 +1,7 @@ /* * Virtualized GPU Graphics * - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -871,8 +871,7 @@ int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info) wake_up(&ch->notifier_wq); break; case TEGRA_VGPU_GR_INTR_SEMAPHORE: - gk20a_channel_event(ch); - wake_up(&ch->semaphore_wq); + gk20a_channel_post_event(ch); break; case TEGRA_VGPU_GR_INTR_SEMAPHORE_TIMEOUT: gk20a_set_error_notifier(ch, -- cgit v1.2.2