From 468d6888fc6db207cb239e270752f3f8f2f0ed87 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 31 Mar 2017 15:56:25 +0530 Subject: gpu: nvgpu: use nvgpu list for CDE contexts Use nvgpu list APIs instead of linux list APIs to store CDE contexts in free_contexts/used_contexts lists Jira NVGPU-13 Change-Id: If1c5d8d8ca70afc90379b33232ceccf9ac4fb155 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1454009 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/cde_gk20a.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/cde_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h index 1136b0ad..a36f2401 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.h @@ -254,18 +254,25 @@ struct gk20a_cde_ctx { bool init_cmd_executed; - struct list_head list; + struct nvgpu_list_node list; bool is_temporary; bool in_use; struct delayed_work ctx_deleter_work; }; +static inline struct gk20a_cde_ctx * +gk20a_cde_ctx_from_list(struct nvgpu_list_node *node) +{ + return (struct gk20a_cde_ctx *) + ((uintptr_t)node - offsetof(struct gk20a_cde_ctx, list)); +}; + struct gk20a_cde_app { bool initialised; struct nvgpu_mutex mutex; - struct list_head free_contexts; - struct list_head used_contexts; + struct nvgpu_list_node free_contexts; + struct nvgpu_list_node used_contexts; unsigned int ctx_count; unsigned int ctx_usecount; unsigned int ctx_count_top; -- cgit v1.2.2