summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2015-12-24 04:29:04 -0500
committerSachin Nikam <snikam@nvidia.com>2016-01-13 02:00:46 -0500
commit43de9024fe1ceb204ec0802ffd442b2d30c90324 (patch)
tree7a6aa134fb174e2afb13aa4582e2ff0b0a979ca1 /drivers
parent544873525d58a4dc4375e56798ae598c832302a7 (diff)
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 <dnibade@nvidia.com> Reviewed-on: http://git-master/r/927132 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c9
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c5
4 files changed, 11 insertions, 7 deletions
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)
2501 mutex_unlock(&ch->poll_events.lock); 2501 mutex_unlock(&ch->poll_events.lock);
2502} 2502}
2503 2503
2504void gk20a_channel_post_event(struct channel_gk20a *ch)
2505{
2506 gk20a_channel_event(ch);
2507 wake_up_interruptible_all(&ch->semaphore_wq);
2508}
2509
2504unsigned int gk20a_channel_poll(struct file *filep, poll_table *wait) 2510unsigned int gk20a_channel_poll(struct file *filep, poll_table *wait)
2505{ 2511{
2506 unsigned int mask = 0; 2512 unsigned int mask = 0;
@@ -2656,8 +2662,7 @@ void gk20a_channel_semaphore_wakeup(struct gk20a *g)
2656 for (chid = 0; chid < f->num_channels; chid++) { 2662 for (chid = 0; chid < f->num_channels; chid++) {
2657 struct channel_gk20a *c = g->fifo.channel+chid; 2663 struct channel_gk20a *c = g->fifo.channel+chid;
2658 if (gk20a_channel_get(c)) { 2664 if (gk20a_channel_get(c)) {
2659 gk20a_channel_event(c); 2665 gk20a_channel_post_event(c);
2660 wake_up_interruptible_all(&c->semaphore_wq);
2661 gk20a_channel_update(c, 0); 2666 gk20a_channel_update(c, 0);
2662 gk20a_channel_put(c); 2667 gk20a_channel_put(c);
2663 } 2668 }
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);
223void gk20a_channel_update(struct channel_gk20a *c, int nr_completed); 223void gk20a_channel_update(struct channel_gk20a *c, int nr_completed);
224unsigned int gk20a_channel_poll(struct file *filep, poll_table *wait); 224unsigned int gk20a_channel_poll(struct file *filep, poll_table *wait);
225void gk20a_channel_event(struct channel_gk20a *ch); 225void gk20a_channel_event(struct channel_gk20a *ch);
226void gk20a_channel_post_event(struct channel_gk20a *ch);
226 227
227void gk20a_init_channel(struct gpu_ops *gops); 228void gk20a_init_channel(struct gpu_ops *gops);
228 229
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,
4890 struct fifo_gk20a *f = &g->fifo; 4890 struct fifo_gk20a *f = &g->fifo;
4891 struct channel_gk20a *ch = &f->channel[isr_data->chid]; 4891 struct channel_gk20a *ch = &f->channel[isr_data->chid];
4892 4892
4893 gk20a_channel_event(ch); 4893 gk20a_channel_post_event(ch);
4894 wake_up(&ch->semaphore_wq);
4895 4894
4896 return 0; 4895 return 0;
4897} 4896}
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 @@
1/* 1/*
2 * Virtualized GPU Graphics 2 * Virtualized GPU Graphics
3 * 3 *
4 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * 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)
871 wake_up(&ch->notifier_wq); 871 wake_up(&ch->notifier_wq);
872 break; 872 break;
873 case TEGRA_VGPU_GR_INTR_SEMAPHORE: 873 case TEGRA_VGPU_GR_INTR_SEMAPHORE:
874 gk20a_channel_event(ch); 874 gk20a_channel_post_event(ch);
875 wake_up(&ch->semaphore_wq);
876 break; 875 break;
877 case TEGRA_VGPU_GR_INTR_SEMAPHORE_TIMEOUT: 876 case TEGRA_VGPU_GR_INTR_SEMAPHORE_TIMEOUT:
878 gk20a_set_error_notifier(ch, 877 gk20a_set_error_notifier(ch,