diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/vgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c index 3ff68ec2..7900f53f 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c | |||
@@ -125,27 +125,22 @@ int vgpu_get_attribute(u64 handle, u32 attrib, u32 *value) | |||
125 | static void vgpu_handle_channel_event(struct gk20a *g, | 125 | static void vgpu_handle_channel_event(struct gk20a *g, |
126 | struct tegra_vgpu_channel_event_info *info) | 126 | struct tegra_vgpu_channel_event_info *info) |
127 | { | 127 | { |
128 | struct tsg_gk20a *tsg; | ||
129 | |||
130 | if (!info->is_tsg) { | ||
131 | nvgpu_err(g, "channel event posted"); | ||
132 | return; | ||
133 | } | ||
134 | |||
128 | if (info->id >= g->fifo.num_channels || | 135 | if (info->id >= g->fifo.num_channels || |
129 | info->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) { | 136 | info->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) { |
130 | nvgpu_err(g, "invalid channel event"); | 137 | nvgpu_err(g, "invalid channel event"); |
131 | return; | 138 | return; |
132 | } | 139 | } |
133 | 140 | ||
134 | if (info->is_tsg) { | 141 | tsg = &g->fifo.tsg[info->id]; |
135 | struct tsg_gk20a *tsg = &g->fifo.tsg[info->id]; | ||
136 | 142 | ||
137 | gk20a_tsg_event_id_post_event(tsg, info->event_id); | 143 | gk20a_tsg_event_id_post_event(tsg, info->event_id); |
138 | } else { | ||
139 | struct channel_gk20a *ch = &g->fifo.channel[info->id]; | ||
140 | |||
141 | if (!gk20a_channel_get(ch)) { | ||
142 | nvgpu_err(g, "invalid channel %d for event %d", | ||
143 | (int)info->id, (int)info->event_id); | ||
144 | return; | ||
145 | } | ||
146 | gk20a_channel_event_id_post_event(ch, info->event_id); | ||
147 | gk20a_channel_put(ch); | ||
148 | } | ||
149 | } | 144 | } |
150 | 145 | ||
151 | 146 | ||