diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-03-23 06:02:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-31 14:34:25 -0400 |
commit | 56df8c58088b5c8b4a09ce6f5e195614251bf8d0 (patch) | |
tree | b353d912fb446a60d09c94bea610b9297209a959 /drivers/gpu/nvgpu/gk20a/channel_gk20a.h | |
parent | c8c1d02261521b5361a9a0daf28238740edc316d (diff) |
gpu: nvgpu: use new List APIs to free channels
Use new APIs from <nvgpu/list.h> to access free
channel list
Define channel_gk20a_from_free_chs() to convert
a list node to struct channel_gk20a
Jira NVGPU-13
Change-Id: Idaf58f04be1c7fc553bea7c8de45951bf82bb340
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1303025
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index d530f47d..fd36ff1f 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/stacktrace.h> | 25 | #include <linux/stacktrace.h> |
26 | #include <linux/wait.h> | 26 | #include <linux/wait.h> |
27 | #include <uapi/linux/nvgpu.h> | 27 | #include <uapi/linux/nvgpu.h> |
28 | #include <nvgpu/list.h> | ||
28 | 29 | ||
29 | #include <nvgpu/lock.h> | 30 | #include <nvgpu/lock.h> |
30 | #include <nvgpu/timers.h> | 31 | #include <nvgpu/timers.h> |
@@ -157,7 +158,7 @@ struct channel_gk20a_ref_action { | |||
157 | struct channel_gk20a { | 158 | struct channel_gk20a { |
158 | struct gk20a *g; /* set only when channel is active */ | 159 | struct gk20a *g; /* set only when channel is active */ |
159 | 160 | ||
160 | struct list_head free_chs; | 161 | struct nvgpu_list_node free_chs; |
161 | 162 | ||
162 | struct nvgpu_spinlock ref_obtain_lock; | 163 | struct nvgpu_spinlock ref_obtain_lock; |
163 | bool referenceable; | 164 | bool referenceable; |
@@ -270,6 +271,13 @@ struct channel_gk20a { | |||
270 | bool is_privileged_channel; | 271 | bool is_privileged_channel; |
271 | }; | 272 | }; |
272 | 273 | ||
274 | static inline struct channel_gk20a * | ||
275 | channel_gk20a_from_free_chs(struct nvgpu_list_node *node) | ||
276 | { | ||
277 | return (struct channel_gk20a *) | ||
278 | ((uintptr_t)node - offsetof(struct channel_gk20a, free_chs)); | ||
279 | }; | ||
280 | |||
273 | static inline bool gk20a_channel_as_bound(struct channel_gk20a *ch) | 281 | static inline bool gk20a_channel_as_bound(struct channel_gk20a *ch) |
274 | { | 282 | { |
275 | return !!ch->vm; | 283 | return !!ch->vm; |