diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-11-22 08:57:11 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-22 20:18:56 -0500 |
commit | ba2e59dc41f593bb011e0ec58c969337a35f4cf1 (patch) | |
tree | 12a4fcec144516a0e903e5495898e9072d7db27c /drivers/gpu/nvgpu/common/linux/channel.h | |
parent | b498f4c5c0a0a5f1a59a9210a1ee4d1d8ae98be7 (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.h | 32 |
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 | ||
21 | struct channel_gk20a; | 23 | struct channel_gk20a; |
@@ -24,6 +26,36 @@ struct nvgpu_submit_gpfifo_args; | |||
24 | struct nvgpu_fence; | 26 | struct nvgpu_fence; |
25 | struct gk20a_fence; | 27 | struct gk20a_fence; |
26 | struct fifo_profile_gk20a; | 28 | struct fifo_profile_gk20a; |
29 | struct nvgpu_os_linux; | ||
30 | |||
31 | struct 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 | |||
45 | struct nvgpu_channel_linux { | ||
46 | struct channel_gk20a *ch; | ||
47 | |||
48 | struct nvgpu_channel_completion_cb completion_cb; | ||
49 | }; | ||
50 | |||
51 | int nvgpu_init_channel_support_linux(struct nvgpu_os_linux *l); | ||
52 | void nvgpu_remove_channel_support_linux(struct nvgpu_os_linux *l); | ||
53 | |||
54 | struct 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 | ||
28 | int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | 60 | int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, |
29 | struct nvgpu_gpfifo *gpfifo, | 61 | struct nvgpu_gpfifo *gpfifo, |