summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/channel.h
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2017-11-22 08:57:11 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-22 20:18:56 -0500
commitba2e59dc41f593bb011e0ec58c969337a35f4cf1 (patch)
tree12a4fcec144516a0e903e5495898e9072d7db27c /drivers/gpu/nvgpu/common/linux/channel.h
parentb498f4c5c0a0a5f1a59a9210a1ee4d1d8ae98be7 (diff)
gpu: nvgpu: use submit callback only in linux code
Move the implementation for channel job update callbacks that is based on Linux specific work_struct usage to Linux-specific code. This requires a bit of extra work for allocating OS-specific priv data for channels which is also done in this patch. The priv data will be used more when more OS-specific features are moved. Jira NVGPU-259 Change-Id: I24bc0148a827f375b56a1c96044685affc2d1e8c Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1589321 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/channel.h')
-rw-r--r--drivers/gpu/nvgpu/common/linux/channel.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/channel.h b/drivers/gpu/nvgpu/common/linux/channel.h
index 785c03d6..ba1935f3 100644
--- a/drivers/gpu/nvgpu/common/linux/channel.h
+++ b/drivers/gpu/nvgpu/common/linux/channel.h
@@ -16,6 +16,8 @@
16#ifndef __NVGPU_CHANNEL_H__ 16#ifndef __NVGPU_CHANNEL_H__
17#define __NVGPU_CHANNEL_H__ 17#define __NVGPU_CHANNEL_H__
18 18
19#include <linux/workqueue.h>
20
19#include <nvgpu/types.h> 21#include <nvgpu/types.h>
20 22
21struct channel_gk20a; 23struct channel_gk20a;
@@ -24,6 +26,36 @@ struct nvgpu_submit_gpfifo_args;
24struct nvgpu_fence; 26struct nvgpu_fence;
25struct gk20a_fence; 27struct gk20a_fence;
26struct fifo_profile_gk20a; 28struct fifo_profile_gk20a;
29struct nvgpu_os_linux;
30
31struct nvgpu_channel_completion_cb {
32 /*
33 * Signal channel owner via a callback, if set, in job cleanup with
34 * schedule_work. Means that something finished on the channel (perhaps
35 * more than one job).
36 */
37 void (*fn)(struct channel_gk20a *, void *);
38 void *user_data;
39 /* Make access to the two above atomic */
40 struct nvgpu_spinlock lock;
41 /* Per-channel async work task, cannot reschedule itself */
42 struct work_struct work;
43};
44
45struct nvgpu_channel_linux {
46 struct channel_gk20a *ch;
47
48 struct nvgpu_channel_completion_cb completion_cb;
49};
50
51int nvgpu_init_channel_support_linux(struct nvgpu_os_linux *l);
52void nvgpu_remove_channel_support_linux(struct nvgpu_os_linux *l);
53
54struct channel_gk20a *gk20a_open_new_channel_with_cb(struct gk20a *g,
55 void (*update_fn)(struct channel_gk20a *, void *),
56 void *update_fn_data,
57 int runlist_id,
58 bool is_privileged_channel);
27 59
28int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, 60int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
29 struct nvgpu_gpfifo *gpfifo, 61 struct nvgpu_gpfifo *gpfifo,