diff options
author | Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com> | 2023-10-28 15:34:15 +0200 |
---|---|---|
committer | Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> | 2023-10-30 11:06:13 +0100 |
commit | 3198a62eb8f8411b605501cb78c2298c67ecee91 (patch) | |
tree | dee56a851acfd7688dec75dcd7b4e8a6d416e987 /drivers/accel/ivpu/ivpu_hw.h | |
parent | accel/ivpu/37xx: Print warning when VPUIP is not idle during power down (diff) | |
download | linux-3198a62eb8f8411b605501cb78c2298c67ecee91.tar.gz linux-3198a62eb8f8411b605501cb78c2298c67ecee91.tar.bz2 linux-3198a62eb8f8411b605501cb78c2298c67ecee91.zip |
accel/ivpu: Add support for delayed D0i3 entry message
Currently the VPU firmware prepares for D0i3 every time the VPU
is entering D0i2 Idle state. This is not optimal as we might not
enter D0i3 every time we enter D0i2 Idle and this preparation
is quite costly.
This optimization moves D0i3 preparation to a dedicated
message sent from the host driver only when the driver is about
to enter D0i3 - this reduces power consumption and latency for
certain workloads, for example audio workloads that submit
inference every 10 ms.
The VPU needs non zero time to enter IDLE state after responding to
D0i3 entry message. If the driver does not wait for the VPU to enter
IDLE state it could cause warm boot failures.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231028133415.1169975-12-stanislaw.gruszka@linux.intel.com
Diffstat (limited to 'drivers/accel/ivpu/ivpu_hw.h')
-rw-r--r-- | drivers/accel/ivpu/ivpu_hw.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/accel/ivpu/ivpu_hw.h b/drivers/accel/ivpu/ivpu_hw.h index fd4809b56168..b7694b1cbc02 100644 --- a/drivers/accel/ivpu/ivpu_hw.h +++ b/drivers/accel/ivpu/ivpu_hw.h @@ -14,6 +14,7 @@ struct ivpu_hw_ops { int (*boot_fw)(struct ivpu_device *vdev); int (*power_down)(struct ivpu_device *vdev); bool (*is_idle)(struct ivpu_device *vdev); + int (*wait_for_idle)(struct ivpu_device *vdev); void (*wdt_disable)(struct ivpu_device *vdev); void (*diagnose_failure)(struct ivpu_device *vdev); u32 (*reg_pll_freq_get)(struct ivpu_device *vdev); @@ -86,6 +87,11 @@ static inline bool ivpu_hw_is_idle(struct ivpu_device *vdev) return vdev->hw->ops->is_idle(vdev); }; +static inline int ivpu_hw_wait_for_idle(struct ivpu_device *vdev) +{ + return vdev->hw->ops->wait_for_idle(vdev); +}; + static inline int ivpu_hw_power_down(struct ivpu_device *vdev) { ivpu_dbg(vdev, PM, "HW power down\n"); |