From 6c58737bed4477f3e3199956b29b3948a465c14d Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 31 Mar 2017 18:27:00 +0530 Subject: gpu: nvgpu: use nvgpu list to store ch in TSG Use nvgpu list APIs instead of linux list APIs to store channel entries in TSG Jira NVGPU-13 Change-Id: I2f64fffc5c43487e1c9e6ccef59c60f079c09da4 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1454014 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index fd36ff1f..37b1d945 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -190,7 +190,7 @@ struct channel_gk20a { struct nvgpu_mutex ioctl_lock; int tsgid; - struct list_head ch_entry; /* channel's entry in TSG */ + struct nvgpu_list_node ch_entry; /* channel's entry in TSG */ struct channel_gk20a_joblist joblist; struct nvgpu_allocator fence_allocator; @@ -278,6 +278,13 @@ channel_gk20a_from_free_chs(struct nvgpu_list_node *node) ((uintptr_t)node - offsetof(struct channel_gk20a, free_chs)); }; +static inline struct channel_gk20a * +channel_gk20a_from_ch_entry(struct nvgpu_list_node *node) +{ + return (struct channel_gk20a *) + ((uintptr_t)node - offsetof(struct channel_gk20a, ch_entry)); +}; + static inline bool gk20a_channel_as_bound(struct channel_gk20a *ch) { return !!ch->vm; -- cgit v1.2.2