From ce04ae15bb0952ce994cb6842ac6e6f34e85d064 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Thu, 31 Mar 2016 12:34:05 +0530 Subject: gpu: nvgpu: APIs to post event id events Add below channel and TSG APIs to post events on event_id interface gk20a_channel_event_id_post_event() gk20a_tsg_event_id_post_event() Bug 200089620 Change-Id: I0cfadc9ffdb880b2410f97758fad47905c620db1 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1112267 (cherry picked from commit 9f50d7da4500af4dbf4dabe7916eda6fc220f4fb) Reviewed-on: http://git-master/r/1120320 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 4ad9d85b..468ee7f1 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -2583,6 +2583,28 @@ static int gk20a_channel_get_event_data_from_id(struct channel_gk20a *ch, } } +void gk20a_channel_event_id_post_event(struct channel_gk20a *ch, + int event_id) +{ + struct gk20a_event_id_data *event_id_data; + int err = 0; + + err = gk20a_channel_get_event_data_from_id(ch, event_id, + &event_id_data); + if (err) + return; + + mutex_lock(&event_id_data->lock); + + gk20a_dbg_info( + "posting event for event_id=%d on ch=%d\n", + event_id, ch->hw_chid); + + wake_up_interruptible_all(&event_id_data->event_id_wq); + + mutex_unlock(&event_id_data->lock); +} + static int gk20a_channel_event_id_enable(struct channel_gk20a *ch, int event_id, int *fd) -- cgit v1.2.2