1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright © 2019 Intel Corporation
5  */
6 
7 #ifndef INTEL_ENGINE_PM_H
8 #define INTEL_ENGINE_PM_H
9 
10 #include "intel_engine_types.h"
11 #include "intel_wakeref.h"
12 
13 struct drm_i915_private;
14 
15 void intel_engine_pm_get(struct intel_engine_cs *engine);
16 void intel_engine_pm_put(struct intel_engine_cs *engine);
17 
18 static inline bool
19 intel_engine_pm_is_awake(const struct intel_engine_cs *engine)
20 {
21 	return intel_wakeref_is_active(&engine->wakeref);
22 }
23 
24 static inline bool
25 intel_engine_pm_get_if_awake(struct intel_engine_cs *engine)
26 {
27 	return intel_wakeref_get_if_active(&engine->wakeref);
28 }
29 
30 void intel_engine_park(struct intel_engine_cs *engine);
31 
32 void intel_engine_init__pm(struct intel_engine_cs *engine);
33 
34 #endif /* INTEL_ENGINE_PM_H */
35