accel/ivpu: Add PM support
[linux-2.6-block.git] / drivers / accel / ivpu / ivpu_drv.h
index 972f71cfaa12908244e7d2ad1069eba3ba800d99..f47b4965db2e33ced85211672116e7c7a0cc3aad 100644 (file)
@@ -74,6 +74,9 @@ struct ivpu_wa_table {
 
 struct ivpu_hw_info;
 struct ivpu_mmu_info;
+struct ivpu_fw_info;
+struct ivpu_ipc_info;
+struct ivpu_pm_info;
 
 struct ivpu_device {
        struct drm_device drm;
@@ -85,11 +88,19 @@ struct ivpu_device {
        struct ivpu_wa_table wa;
        struct ivpu_hw_info *hw;
        struct ivpu_mmu_info *mmu;
+       struct ivpu_fw_info *fw;
+       struct ivpu_ipc_info *ipc;
+       struct ivpu_pm_info *pm;
 
        struct ivpu_mmu_context gctx;
        struct xarray context_xa;
        struct xa_limit context_xa_limit;
 
+       struct xarray submitted_jobs_xa;
+       struct task_struct *job_done_thread;
+
+       atomic64_t unique_id_counter;
+
        struct {
                int boot;
                int jsm;
@@ -105,6 +116,8 @@ struct ivpu_device {
 struct ivpu_file_priv {
        struct kref ref;
        struct ivpu_device *vdev;
+       struct mutex lock; /* Protects cmdq */
+       struct ivpu_cmdq *cmdq[IVPU_NUM_ENGINES];
        struct ivpu_mmu_context ctx;
        u32 priority;
        bool has_mmu_faults;
@@ -114,9 +127,16 @@ extern int ivpu_dbg_mask;
 extern u8 ivpu_pll_min_ratio;
 extern u8 ivpu_pll_max_ratio;
 
+#define IVPU_TEST_MODE_DISABLED  0
+#define IVPU_TEST_MODE_FW_TEST   1
+#define IVPU_TEST_MODE_NULL_HW   2
+extern int ivpu_test_mode;
+
 struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv);
 struct ivpu_file_priv *ivpu_file_priv_get_by_ctx_id(struct ivpu_device *vdev, unsigned long id);
 void ivpu_file_priv_put(struct ivpu_file_priv **link);
+
+int ivpu_boot(struct ivpu_device *vdev);
 int ivpu_shutdown(struct ivpu_device *vdev);
 
 static inline bool ivpu_is_mtl(struct ivpu_device *vdev)