xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/bifrost/mali_kbase_dummy_job_wa.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  *
4  * (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved.
5  *
6  * This program is free software and is provided to you under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation, and any use by you of this program is subject to the terms
9  * of such GNU license.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you can access it online at
18  * http://www.gnu.org/licenses/gpl-2.0.html.
19  *
20  */
21 
22 #ifndef _KBASE_DUMMY_JOB_WORKAROUND_
23 #define _KBASE_DUMMY_JOB_WORKAROUND_
24 
25 #define KBASE_DUMMY_JOB_WA_FLAG_SERIALIZE (1ull << 0)
26 #define KBASE_DUMMY_JOB_WA_FLAG_WAIT_POWERUP (1ull << 1)
27 #define KBASE_DUMMY_JOB_WA_FLAG_LOGICAL_SHADER_POWER (1ull << 2)
28 
29 #define KBASE_DUMMY_JOB_WA_FLAGS (KBASE_DUMMY_JOB_WA_FLAG_SERIALIZE | \
30 				  KBASE_DUMMY_JOB_WA_FLAG_WAIT_POWERUP | \
31 				  KBASE_DUMMY_JOB_WA_FLAG_LOGICAL_SHADER_POWER)
32 
33 #if MALI_USE_CSF
34 
kbase_dummy_job_wa_load(struct kbase_device * kbdev)35 static inline int kbase_dummy_job_wa_load(struct kbase_device *kbdev)
36 {
37 	CSTD_UNUSED(kbdev);
38 	return 0;
39 }
40 
kbase_dummy_job_wa_cleanup(struct kbase_device * kbdev)41 static inline void kbase_dummy_job_wa_cleanup(struct kbase_device *kbdev)
42 {
43 	CSTD_UNUSED(kbdev);
44 }
45 
kbase_dummy_job_wa_execute(struct kbase_device * kbdev,u64 cores)46 static inline int kbase_dummy_job_wa_execute(struct kbase_device *kbdev,
47 		u64 cores)
48 {
49 	CSTD_UNUSED(kbdev);
50 	CSTD_UNUSED(cores);
51 	return 0;
52 }
53 
kbase_dummy_job_wa_enabled(struct kbase_device * kbdev)54 static inline bool kbase_dummy_job_wa_enabled(struct kbase_device *kbdev)
55 {
56 	CSTD_UNUSED(kbdev);
57 	return false;
58 }
59 
60 #else
61 
62 int kbase_dummy_job_wa_load(struct kbase_device *kbdev);
63 void kbase_dummy_job_wa_cleanup(struct kbase_device *kbdev);
64 int kbase_dummy_job_wa_execute(struct kbase_device *kbdev, u64 cores);
65 
kbase_dummy_job_wa_enabled(struct kbase_device * kbdev)66 static inline bool kbase_dummy_job_wa_enabled(struct kbase_device *kbdev)
67 {
68 	return (kbdev->dummy_job_wa.ctx != NULL);
69 }
70 
71 #endif /* MALI_USE_CSF */
72 
73 #endif /* _KBASE_DUMMY_JOB_WORKAROUND_ */
74