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>
This commit is contained in:
Deepak Nibade
2015-12-24 14:59:04 +05:30
committed by Sachin Nikam
parent 544873525d
commit 43de9024fe
4 changed files with 11 additions and 7 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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,