diff options
author | Siddharth Kapoor <ksiddharth@google.com> | 2021-11-26 19:02:16 +0800 |
---|---|---|
committer | Siddharth Kapoor <ksiddharth@google.com> | 2021-12-06 11:32:22 +0800 |
commit | 93dab6a30cedaf7e6307492cbaa5f651514a7764 (patch) | |
tree | 8290861c9f9c7144bc8ee907089a063f6a6041d0 /mali_kbase/mali_kbase.h | |
parent | e2249eb4503b74f19f9081b3e68fcbc824afdc10 (diff) | |
parent | 0c596dc70431fa2c70021fa1685e3efc969a852d (diff) | |
download | gpu-93dab6a30cedaf7e6307492cbaa5f651514a7764.tar.gz |
Merge r34p0-00dev1 from upstream into android-gs-pixel-5.10-gs101
Change-Id: I051ad3af9ac645fb8585219c48210df424a27807
Signed-off-by: Siddharth Kapoor <ksiddharth@google.com>
Diffstat (limited to 'mali_kbase/mali_kbase.h')
-rw-r--r-- | mali_kbase/mali_kbase.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/mali_kbase/mali_kbase.h b/mali_kbase/mali_kbase.h index 70847b4..c8556d8 100644 --- a/mali_kbase/mali_kbase.h +++ b/mali_kbase/mali_kbase.h @@ -499,6 +499,46 @@ void kbase_pm_metrics_start(struct kbase_device *kbdev); */ void kbase_pm_metrics_stop(struct kbase_device *kbdev); +#if MALI_USE_CSF && defined(KBASE_PM_RUNTIME) +/** + * kbase_pm_handle_runtime_suspend - Handle the runtime suspend of GPU + * + * @kbdev: The kbase device structure for the device (must be a valid pointer) + * + * This function is called from the runtime suspend callback function for + * saving the HW state and powering down GPU, if GPU was in sleep state mode. + * It does the following steps + * - Powers up the L2 cache and re-activates the MCU. + * - Suspend the CSGs + * - Halts the MCU + * - Powers down the L2 cache. + * - Invokes the power_off callback to power down the GPU. + * + * Return: 0 if the GPU was already powered down or no error was encountered + * in the power down, otherwise an error code. + */ +int kbase_pm_handle_runtime_suspend(struct kbase_device *kbdev); + +/** + * kbase_pm_force_mcu_wakeup_after_sleep - Force the wake up of MCU from sleep + * + * @kbdev: The kbase device structure for the device (must be a valid pointer) + * + * This function forces the wake up of MCU from sleep state and wait for + * MCU to become active. + * It usually gets called from the runtime suspend callback function. + * It also gets called from the GPU reset handler or at the time of system + * suspend or when User tries to terminate/suspend the on-slot group. + * + * Note: @gpu_wakeup_override flag that forces the reactivation of MCU is + * set by this function and it is the caller's responsibility to + * clear the flag. + * + * Return: 0 if the wake up was successful. + */ +int kbase_pm_force_mcu_wakeup_after_sleep(struct kbase_device *kbdev); +#endif + #if !MALI_USE_CSF /** * Return the atom's ID, as was originally supplied by userspace in @@ -506,7 +546,8 @@ void kbase_pm_metrics_stop(struct kbase_device *kbdev); * @kctx: KBase context pointer * @katom: Atome for which to return ID */ -static inline int kbase_jd_atom_id(struct kbase_context *kctx, struct kbase_jd_atom *katom) +static inline int kbase_jd_atom_id(struct kbase_context *kctx, + const struct kbase_jd_atom *katom) { int result; |