diff options
author | Jörg Wagner <jorwag@google.com> | 2023-08-01 13:38:22 +0000 |
---|---|---|
committer | Jörg Wagner <jorwag@google.com> | 2023-08-03 09:29:34 +0000 |
commit | dacf004cc8a4b35f5a0fb5fb67246f9cc8fdaafb (patch) | |
tree | 07484dccba43bb2c2a07626c00154751f318bd47 /mali_kbase/context/backend | |
parent | bce5281a0408a175137c08dc93028e2a2c0fb69b (diff) | |
download | gpu-dacf004cc8a4b35f5a0fb5fb67246f9cc8fdaafb.tar.gz |
Update KMD to 'mini release: update r44p1-01bet1 to r44p1-00dev2'
Provenance: ipdelivery@d10c137c7691a470b8b33786aec4965315db4561
Change-Id: I4fbcc669d3b8e36c8288c91fdddd8b79258b6635
Diffstat (limited to 'mali_kbase/context/backend')
-rw-r--r-- | mali_kbase/context/backend/mali_kbase_context_csf.c | 18 | ||||
-rw-r--r-- | mali_kbase/context/backend/mali_kbase_context_jm.c | 21 |
2 files changed, 31 insertions, 8 deletions
diff --git a/mali_kbase/context/backend/mali_kbase_context_csf.c b/mali_kbase/context/backend/mali_kbase_context_csf.c index 07d277b..8b74de0 100644 --- a/mali_kbase/context/backend/mali_kbase_context_csf.c +++ b/mali_kbase/context/backend/mali_kbase_context_csf.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note /* * - * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2019-2023 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -121,7 +121,7 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, bool is_compat, base_context_create_flags const flags, unsigned long const api_version, - struct file *const filp) + struct kbase_file *const kfile) { struct kbase_context *kctx; unsigned int i = 0; @@ -140,9 +140,11 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, kctx->kbdev = kbdev; kctx->api_version = api_version; - kctx->filp = filp; + kctx->kfile = kfile; kctx->create_flags = flags; + memcpy(kctx->comm, current->comm, sizeof(current->comm)); + if (is_compat) kbase_ctx_flag_set(kctx, KCTX_COMPAT); #if defined(CONFIG_64BIT) @@ -198,6 +200,16 @@ void kbase_destroy_context(struct kbase_context *kctx) !kbase_pm_is_suspending(kbdev)); } + /* Have synchronized against the System suspend and incremented the + * pm.active_count. So any subsequent invocation of System suspend + * callback would get blocked. + * If System suspend callback was already in progress then the above loop + * would have waited till the System resume callback has begun. + * So wait for the System resume callback to also complete as we want to + * avoid context termination during System resume also. + */ + wait_event(kbdev->pm.resume_wait, !kbase_pm_is_resuming(kbdev)); + kbase_mem_pool_group_mark_dying(&kctx->mem_pools); kbase_context_term_partial(kctx, ARRAY_SIZE(context_init)); diff --git a/mali_kbase/context/backend/mali_kbase_context_jm.c b/mali_kbase/context/backend/mali_kbase_context_jm.c index 995a08e..2a983fb 100644 --- a/mali_kbase/context/backend/mali_kbase_context_jm.c +++ b/mali_kbase/context/backend/mali_kbase_context_jm.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note /* * - * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2019-2023 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -158,11 +158,11 @@ static const struct kbase_context_init context_init[] = { kbase_debug_job_fault_context_term, "Job fault context initialization failed" }, #endif + { kbasep_platform_context_init, kbasep_platform_context_term, + "Platform callback for kctx initialization failed" }, { NULL, kbase_context_flush_jobs, NULL }, { kbase_context_add_to_dev_list, kbase_context_remove_from_dev_list, "Adding kctx to device failed" }, - { kbasep_platform_context_init, kbasep_platform_context_term, - "Platform callback for kctx initialization failed" }, }; static void kbase_context_term_partial( @@ -179,7 +179,7 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, bool is_compat, base_context_create_flags const flags, unsigned long const api_version, - struct file *const filp) + struct kbase_file *const kfile) { struct kbase_context *kctx; unsigned int i = 0; @@ -198,7 +198,7 @@ struct kbase_context *kbase_create_context(struct kbase_device *kbdev, kctx->kbdev = kbdev; kctx->api_version = api_version; - kctx->filp = filp; + kctx->kfile = kfile; kctx->create_flags = flags; if (is_compat) @@ -258,6 +258,17 @@ void kbase_destroy_context(struct kbase_context *kctx) wait_event(kbdev->pm.resume_wait, !kbase_pm_is_suspending(kbdev)); } + + /* Have synchronized against the System suspend and incremented the + * pm.active_count. So any subsequent invocation of System suspend + * callback would get blocked. + * If System suspend callback was already in progress then the above loop + * would have waited till the System resume callback has begun. + * So wait for the System resume callback to also complete as we want to + * avoid context termination during System resume also. + */ + wait_event(kbdev->pm.resume_wait, !kbase_pm_is_resuming(kbdev)); + #ifdef CONFIG_MALI_ARBITER_SUPPORT atomic_dec(&kbdev->pm.gpu_users_waiting); #endif /* CONFIG_MALI_ARBITER_SUPPORT */ |