aboutsummaryrefslogtreecommitdiff
path: root/drivers/accel/ivpu/ivpu_hw.h
diff options
context:
space:
mode:
authorGravatar Krystian Pradzynski <krystian.pradzynski@linux.intel.com> 2023-10-28 17:59:29 +0200
committerGravatar Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> 2023-10-31 15:49:35 +0100
commitbfc87f90614523612ae7e94d06798e82bc78ade6 (patch)
tree3a4154efa24cfa8e643ef3a156822138e79adf4f /drivers/accel/ivpu/ivpu_hw.h
parentRevert "drm/omapdrm: Annotate dma-fence critical section in commit path" (diff)
downloadlinux-bfc87f90614523612ae7e94d06798e82bc78ade6.tar.gz
linux-bfc87f90614523612ae7e94d06798e82bc78ade6.tar.bz2
linux-bfc87f90614523612ae7e94d06798e82bc78ade6.zip
accel/ivpu/40xx: Allow to change profiling frequency
Profiling freq is a debug firmware feature. It switches default clock to higher resolution for fine-grained and more accurate firmware task profiling. We already configure it during boot up of VPU4. Add debugfs knob and helpers per HW generation that allow to change it. For vpu37xx the implementation is empty as profiling frequency can only be changed on VPU4 or newer. Signed-off-by: Krystian Pradzynski <krystian.pradzynski@linux.intel.com> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231028155936.1183342-2-stanislaw.gruszka@linux.intel.com
Diffstat (limited to 'drivers/accel/ivpu/ivpu_hw.h')
-rw-r--r--drivers/accel/ivpu/ivpu_hw.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/accel/ivpu/ivpu_hw.h b/drivers/accel/ivpu/ivpu_hw.h
index b7694b1cbc02..aa52e5c29a65 100644
--- a/drivers/accel/ivpu/ivpu_hw.h
+++ b/drivers/accel/ivpu/ivpu_hw.h
@@ -17,6 +17,8 @@ struct ivpu_hw_ops {
int (*wait_for_idle)(struct ivpu_device *vdev);
void (*wdt_disable)(struct ivpu_device *vdev);
void (*diagnose_failure)(struct ivpu_device *vdev);
+ u32 (*profiling_freq_get)(struct ivpu_device *vdev);
+ void (*profiling_freq_drive)(struct ivpu_device *vdev, bool enable);
u32 (*reg_pll_freq_get)(struct ivpu_device *vdev);
u32 (*reg_telemetry_offset_get)(struct ivpu_device *vdev);
u32 (*reg_telemetry_size_get)(struct ivpu_device *vdev);
@@ -104,6 +106,16 @@ static inline void ivpu_hw_wdt_disable(struct ivpu_device *vdev)
vdev->hw->ops->wdt_disable(vdev);
};
+static inline u32 ivpu_hw_profiling_freq_get(struct ivpu_device *vdev)
+{
+ return vdev->hw->ops->profiling_freq_get(vdev);
+};
+
+static inline void ivpu_hw_profiling_freq_drive(struct ivpu_device *vdev, bool enable)
+{
+ return vdev->hw->ops->profiling_freq_drive(vdev, enable);
+};
+
/* Register indirect accesses */
static inline u32 ivpu_hw_reg_pll_freq_get(struct ivpu_device *vdev)
{