MALI: rockchip: upgrade midgard DDK to r14p0-01rel0
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard / backend / gpu / mali_kbase_pm_defs.h
index e8f96fe6c5146abd1770f6bf37760354770c5e60..99fb62d006bc0657c1b434cad2f15d83b673d85d 100644 (file)
@@ -207,6 +207,17 @@ union kbase_pm_ca_policy_data {
  *                          power_change_lock should be held when accessing,
  *                          unless there is no way the timer can be running (eg
  *                          hrtimer_cancel() was called immediately before)
+ * @poweroff_wait_in_progress: true if a wait for GPU power off is in progress.
+ *                             hwaccess_lock must be held when accessing
+ * @poweron_required: true if a GPU power on is required. Should only be set
+ *                    when poweroff_wait_in_progress is true, and therefore the
+ *                    GPU can not immediately be powered on. pm.lock must be
+ *                    held when accessing
+ * @poweroff_is_suspend: true if the GPU is being powered off due to a suspend
+ *                       request. pm.lock must be held when accessing
+ * @gpu_poweroff_wait_wq: workqueue for waiting for GPU to power off
+ * @gpu_poweroff_wait_work: work item for use with @gpu_poweroff_wait_wq
+ * @poweroff_wait: waitqueue for waiting for @gpu_poweroff_wait_work to complete
  * @callback_power_on: Callback when the GPU needs to be turned on. See
  *                     &struct kbase_pm_callback_conf
  * @callback_power_off: Callback when the GPU may be turned off. See
@@ -281,6 +292,15 @@ struct kbase_pm_backend_data {
        bool poweroff_timer_needed;
        bool poweroff_timer_running;
 
+       bool poweroff_wait_in_progress;
+       bool poweron_required;
+       bool poweroff_is_suspend;
+
+       struct workqueue_struct *gpu_poweroff_wait_wq;
+       struct work_struct gpu_poweroff_wait_work;
+
+       wait_queue_head_t poweroff_wait;
+
        int (*callback_power_on)(struct kbase_device *kbdev);
        void (*callback_power_off)(struct kbase_device *kbdev);
        void (*callback_power_suspend)(struct kbase_device *kbdev);