summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/cde_gk20a.h
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-03-31 06:26:25 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-04-03 11:55:19 -0400
commit468d6888fc6db207cb239e270752f3f8f2f0ed87 (patch)
tree7303f245eab5964e30ec018ae8c561f1ab5c165a /drivers/gpu/nvgpu/gk20a/cde_gk20a.h
parent684f7d16eff938cf97e465e7bf470c583d4a370b (diff)
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 <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1454009 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/cde_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.h13
1 files changed, 10 insertions, 3 deletions
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 {
254 254
255 bool init_cmd_executed; 255 bool init_cmd_executed;
256 256
257 struct list_head list; 257 struct nvgpu_list_node list;
258 bool is_temporary; 258 bool is_temporary;
259 bool in_use; 259 bool in_use;
260 struct delayed_work ctx_deleter_work; 260 struct delayed_work ctx_deleter_work;
261}; 261};
262 262
263static inline struct gk20a_cde_ctx *
264gk20a_cde_ctx_from_list(struct nvgpu_list_node *node)
265{
266 return (struct gk20a_cde_ctx *)
267 ((uintptr_t)node - offsetof(struct gk20a_cde_ctx, list));
268};
269
263struct gk20a_cde_app { 270struct gk20a_cde_app {
264 bool initialised; 271 bool initialised;
265 struct nvgpu_mutex mutex; 272 struct nvgpu_mutex mutex;
266 273
267 struct list_head free_contexts; 274 struct nvgpu_list_node free_contexts;
268 struct list_head used_contexts; 275 struct nvgpu_list_node used_contexts;
269 unsigned int ctx_count; 276 unsigned int ctx_count;
270 unsigned int ctx_usecount; 277 unsigned int ctx_usecount;
271 unsigned int ctx_count_top; 278 unsigned int ctx_count_top;