summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-11-03 08:36:10 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-06 14:20:01 -0500
commit1480afeb013decec1d5451fd0d3eeaffa8e17bb6 (patch)
tree41325c4bb8b45ae9f98febc85dd6634c5113d5b9 /drivers/gpu/nvgpu/gk20a
parent69c301a99201d6945fb3bd4df821aedf6d590d46 (diff)
gpu: nvgpu: define EVENT_IDs in common code
All the event ids NVGPU_IOCTL_CHANNEL_EVENT_ID_* are defined in linux specific user header uapi/linux/nvgpu.h and can't be used in common code Hence add new definitions of type NVGPU_EVENT_ID_* for all the events in common code and use them wherever required in common code For future additions to event ids, we need to update both NVGPU_IOCTL_CHANNEL_EVENT_ID_* and NVGPU_EVENT_ID_* fields Also add new API nvgpu_event_id_to_ioctl_channel_event_id() to convert common event_id of the form NVGPU_EVENT_ID_* to Linux specific event_id of the form NVGPU_IOCTL_CHANNEL_EVENT_ID_* Use this API in gk20a_channel/tsg_event_id_post_event() to get correct event_id Jira NVGPU-259 Change-Id: I15a7f41181fdbb8f1876f88bbcd044447d88325f Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1591434 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c12
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h10
3 files changed, 18 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index c938ba6b..805902eb 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -2395,10 +2395,10 @@ void gk20a_channel_semaphore_wakeup(struct gk20a *g, bool post_events)
2395 &g->fifo.tsg[c->tsgid]; 2395 &g->fifo.tsg[c->tsgid];
2396 2396
2397 gk20a_tsg_event_id_post_event(tsg, 2397 gk20a_tsg_event_id_post_event(tsg,
2398 NVGPU_IOCTL_CHANNEL_EVENT_ID_BLOCKING_SYNC); 2398 NVGPU_EVENT_ID_BLOCKING_SYNC);
2399 } else { 2399 } else {
2400 gk20a_channel_event_id_post_event(c, 2400 gk20a_channel_event_id_post_event(c,
2401 NVGPU_IOCTL_CHANNEL_EVENT_ID_BLOCKING_SYNC); 2401 NVGPU_EVENT_ID_BLOCKING_SYNC);
2402 } 2402 }
2403 } 2403 }
2404 /* 2404 /*
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 2a20c2d9..f7db1ffa 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -5275,10 +5275,10 @@ static int gk20a_gr_handle_semaphore_pending(struct gk20a *g,
5275 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; 5275 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid];
5276 5276
5277 gk20a_tsg_event_id_post_event(tsg, 5277 gk20a_tsg_event_id_post_event(tsg,
5278 NVGPU_IOCTL_CHANNEL_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN); 5278 NVGPU_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN);
5279 } else { 5279 } else {
5280 gk20a_channel_event_id_post_event(ch, 5280 gk20a_channel_event_id_post_event(ch,
5281 NVGPU_IOCTL_CHANNEL_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN); 5281 NVGPU_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN);
5282 } 5282 }
5283 5283
5284 nvgpu_cond_broadcast(&ch->semaphore_wq); 5284 nvgpu_cond_broadcast(&ch->semaphore_wq);
@@ -5824,10 +5824,10 @@ static int gk20a_gr_post_bpt_events(struct gk20a *g, struct channel_gk20a *ch,
5824 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; 5824 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid];
5825 5825
5826 gk20a_tsg_event_id_post_event(tsg, 5826 gk20a_tsg_event_id_post_event(tsg,
5827 NVGPU_IOCTL_CHANNEL_EVENT_ID_BPT_INT); 5827 NVGPU_EVENT_ID_BPT_INT);
5828 } else { 5828 } else {
5829 gk20a_channel_event_id_post_event(ch, 5829 gk20a_channel_event_id_post_event(ch,
5830 NVGPU_IOCTL_CHANNEL_EVENT_ID_BPT_INT); 5830 NVGPU_EVENT_ID_BPT_INT);
5831 } 5831 }
5832 } 5832 }
5833 if (global_esr & gr_gpc0_tpc0_sm_hww_global_esr_bpt_pause_pending_f()) { 5833 if (global_esr & gr_gpc0_tpc0_sm_hww_global_esr_bpt_pause_pending_f()) {
@@ -5835,10 +5835,10 @@ static int gk20a_gr_post_bpt_events(struct gk20a *g, struct channel_gk20a *ch,
5835 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid]; 5835 struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid];
5836 5836
5837 gk20a_tsg_event_id_post_event(tsg, 5837 gk20a_tsg_event_id_post_event(tsg,
5838 NVGPU_IOCTL_CHANNEL_EVENT_ID_BPT_PAUSE); 5838 NVGPU_EVENT_ID_BPT_PAUSE);
5839 } else { 5839 } else {
5840 gk20a_channel_event_id_post_event(ch, 5840 gk20a_channel_event_id_post_event(ch,
5841 NVGPU_IOCTL_CHANNEL_EVENT_ID_BPT_PAUSE); 5841 NVGPU_EVENT_ID_BPT_PAUSE);
5842 } 5842 }
5843 } 5843 }
5844 5844
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index 8a044728..d411a2fa 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -124,6 +124,16 @@ enum {
124 BLCG_AUTO /* clk will run when non-idle, standard blcg mode */ 124 BLCG_AUTO /* clk will run when non-idle, standard blcg mode */
125}; 125};
126 126
127enum {
128 NVGPU_EVENT_ID_BPT_INT = 0,
129 NVGPU_EVENT_ID_BPT_PAUSE,
130 NVGPU_EVENT_ID_BLOCKING_SYNC,
131 NVGPU_EVENT_ID_CILP_PREEMPTION_STARTED,
132 NVGPU_EVENT_ID_CILP_PREEMPTION_COMPLETE,
133 NVGPU_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN,
134 NVGPU_EVENT_ID_MAX,
135};
136
127#ifndef GR_GO_IDLE_BUNDLE 137#ifndef GR_GO_IDLE_BUNDLE
128#define GR_GO_IDLE_BUNDLE 0x0000e100 /* --V-B */ 138#define GR_GO_IDLE_BUNDLE 0x0000e100 /* --V-B */
129#endif 139#endif