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 <dnibade@nvidia.com>
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 <bnihalani@nvidia.com>
This commit is contained in:
Deepak Nibade
2016-03-31 12:34:05 +05:30
committed by Terje Bergstrom
parent 5f10073540
commit ce04ae15bb
4 changed files with 49 additions and 0 deletions

View File

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

View File

@@ -281,5 +281,7 @@ int gk20a_channel_get_timescale_from_timeslice(struct gk20a *g,
int *__timeslice_timeout, int *__timeslice_scale);
int gk20a_channel_set_priority(struct channel_gk20a *ch, u32 priority);
int gk20a_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice);
void gk20a_channel_event_id_post_event(struct channel_gk20a *ch,
int event_id);
#endif /* CHANNEL_GK20A_H */

View File

@@ -212,6 +212,28 @@ static int gk20a_tsg_get_event_data_from_id(struct tsg_gk20a *tsg,
}
}
void gk20a_tsg_event_id_post_event(struct tsg_gk20a *tsg,
int event_id)
{
struct gk20a_event_id_data *event_id_data;
int err = 0;
err = gk20a_tsg_get_event_data_from_id(tsg, event_id,
&event_id_data);
if (err)
return;
mutex_lock(&event_id_data->lock);
gk20a_dbg_info(
"posting event for event_id=%d on tsg=%d\n",
event_id, tsg->tsgid);
wake_up_interruptible_all(&event_id_data->event_id_wq);
mutex_unlock(&event_id_data->lock);
}
static int gk20a_tsg_event_id_enable(struct tsg_gk20a *tsg,
int event_id,
int *fd)

View File

@@ -59,4 +59,7 @@ struct tsg_gk20a {
int gk20a_enable_tsg(struct tsg_gk20a *tsg);
int gk20a_disable_tsg(struct tsg_gk20a *tsg);
void gk20a_tsg_event_id_post_event(struct tsg_gk20a *tsg,
int event_id);
#endif /* __TSG_GK20A_H_ */