summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-03-31 07:07:30 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-04-03 11:55:20 -0400
commitf0147665b2d9c3faa673e6b0001be596018c4e9c (patch)
tree0e15e3daafdc0ed2a8444ca36f448dce9c057186 /drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
parent42852f182a783e7bcd157fa0a9390c77e9376a60 (diff)
gpu: nvgpu: use nvgpu list for CE2 ctx list
Use nvgpu list APIs instead of linux list APIs to store CE2 contexts Jira NVGPU-13 Change-Id: I0c9b8b69e7e19a63265802abb4455a5cb2308b6f Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1454011 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/ce2_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ce2_gk20a.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
index 3ca38715..48f0cf8d 100644
--- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
@@ -110,8 +110,8 @@ static void gk20a_ce_notify_all_user(struct gk20a *g, u32 event)
110 110
111 nvgpu_mutex_acquire(&ce_app->app_mutex); 111 nvgpu_mutex_acquire(&ce_app->app_mutex);
112 112
113 list_for_each_entry_safe(ce_ctx, ce_ctx_save, 113 nvgpu_list_for_each_entry_safe(ce_ctx, ce_ctx_save,
114 &ce_app->allocated_contexts, list) { 114 &ce_app->allocated_contexts, gk20a_gpu_ctx, list) {
115 if (ce_ctx->user_event_callback) { 115 if (ce_ctx->user_event_callback) {
116 ce_ctx->user_event_callback(ce_ctx->ctx_id, 116 ce_ctx->user_event_callback(ce_ctx->ctx_id,
117 event); 117 event);
@@ -187,7 +187,7 @@ static void gk20a_ce_free_command_buffer_stored_fence(struct gk20a_gpu_ctx *ce_c
187/* assume this api should need to call under nvgpu_mutex_acquire(&ce_app->app_mutex) */ 187/* assume this api should need to call under nvgpu_mutex_acquire(&ce_app->app_mutex) */
188static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx) 188static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx)
189{ 189{
190 struct list_head *list = &ce_ctx->list; 190 struct nvgpu_list_node *list = &ce_ctx->list;
191 191
192 ce_ctx->gpu_ctx_state = NVGPU_CE_GPU_CTX_DELETED; 192 ce_ctx->gpu_ctx_state = NVGPU_CE_GPU_CTX_DELETED;
193 193
@@ -204,7 +204,7 @@ static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx)
204 204
205 /* housekeeping on app */ 205 /* housekeeping on app */
206 if (list->prev && list->next) 206 if (list->prev && list->next)
207 list_del(list); 207 nvgpu_list_del(list);
208 208
209 nvgpu_mutex_release(&ce_ctx->gpu_ctx_mutex); 209 nvgpu_mutex_release(&ce_ctx->gpu_ctx_mutex);
210 nvgpu_mutex_destroy(&ce_ctx->gpu_ctx_mutex); 210 nvgpu_mutex_destroy(&ce_ctx->gpu_ctx_mutex);
@@ -361,7 +361,7 @@ int gk20a_init_ce_support(struct gk20a *g)
361 361
362 nvgpu_mutex_acquire(&ce_app->app_mutex); 362 nvgpu_mutex_acquire(&ce_app->app_mutex);
363 363
364 INIT_LIST_HEAD(&ce_app->allocated_contexts); 364 nvgpu_init_list_node(&ce_app->allocated_contexts);
365 ce_app->ctx_count = 0; 365 ce_app->ctx_count = 0;
366 ce_app->next_ctx_id = 0; 366 ce_app->next_ctx_id = 0;
367 ce_app->initialised = true; 367 ce_app->initialised = true;
@@ -386,12 +386,12 @@ void gk20a_ce_destroy(struct gk20a *g)
386 386
387 nvgpu_mutex_acquire(&ce_app->app_mutex); 387 nvgpu_mutex_acquire(&ce_app->app_mutex);
388 388
389 list_for_each_entry_safe(ce_ctx, ce_ctx_save, 389 nvgpu_list_for_each_entry_safe(ce_ctx, ce_ctx_save,
390 &ce_app->allocated_contexts, list) { 390 &ce_app->allocated_contexts, gk20a_gpu_ctx, list) {
391 gk20a_ce_delete_gpu_context(ce_ctx); 391 gk20a_ce_delete_gpu_context(ce_ctx);
392 } 392 }
393 393
394 INIT_LIST_HEAD(&ce_app->allocated_contexts); 394 nvgpu_init_list_node(&ce_app->allocated_contexts);
395 ce_app->ctx_count = 0; 395 ce_app->ctx_count = 0;
396 ce_app->next_ctx_id = 0; 396 ce_app->next_ctx_id = 0;
397 397
@@ -520,7 +520,7 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev,
520 520
521 nvgpu_mutex_acquire(&ce_app->app_mutex); 521 nvgpu_mutex_acquire(&ce_app->app_mutex);
522 ctx_id = ce_ctx->ctx_id = ce_app->next_ctx_id; 522 ctx_id = ce_ctx->ctx_id = ce_app->next_ctx_id;
523 list_add(&ce_ctx->list, &ce_app->allocated_contexts); 523 nvgpu_list_add(&ce_ctx->list, &ce_app->allocated_contexts);
524 ++ce_app->next_ctx_id; 524 ++ce_app->next_ctx_id;
525 ++ce_app->ctx_count; 525 ++ce_app->ctx_count;
526 nvgpu_mutex_release(&ce_app->app_mutex); 526 nvgpu_mutex_release(&ce_app->app_mutex);
@@ -570,8 +570,8 @@ int gk20a_ce_execute_ops(struct device *dev,
570 570
571 nvgpu_mutex_acquire(&ce_app->app_mutex); 571 nvgpu_mutex_acquire(&ce_app->app_mutex);
572 572
573 list_for_each_entry_safe(ce_ctx, ce_ctx_save, 573 nvgpu_list_for_each_entry_safe(ce_ctx, ce_ctx_save,
574 &ce_app->allocated_contexts, list) { 574 &ce_app->allocated_contexts, gk20a_gpu_ctx, list) {
575 if (ce_ctx->ctx_id == ce_ctx_id) { 575 if (ce_ctx->ctx_id == ce_ctx_id) {
576 found = true; 576 found = true;
577 break; 577 break;
@@ -706,8 +706,8 @@ void gk20a_ce_delete_context_priv(struct gk20a *g,
706 706
707 nvgpu_mutex_acquire(&ce_app->app_mutex); 707 nvgpu_mutex_acquire(&ce_app->app_mutex);
708 708
709 list_for_each_entry_safe(ce_ctx, ce_ctx_save, 709 nvgpu_list_for_each_entry_safe(ce_ctx, ce_ctx_save,
710 &ce_app->allocated_contexts, list) { 710 &ce_app->allocated_contexts, gk20a_gpu_ctx, list) {
711 if (ce_ctx->ctx_id == ce_ctx_id) { 711 if (ce_ctx->ctx_id == ce_ctx_id) {
712 gk20a_ce_delete_gpu_context(ce_ctx); 712 gk20a_ce_delete_gpu_context(ce_ctx);
713 --ce_app->ctx_count; 713 --ce_app->ctx_count;