1
2
3
4
5
6
7#ifndef INTEL_RPS_H
8#define INTEL_RPS_H
9
10#include "intel_rps_types.h"
11
12struct i915_request;
13
14void intel_rps_init_early(struct intel_rps *rps);
15void intel_rps_init(struct intel_rps *rps);
16void intel_rps_sanitize(struct intel_rps *rps);
17
18void intel_rps_driver_register(struct intel_rps *rps);
19void intel_rps_driver_unregister(struct intel_rps *rps);
20
21void intel_rps_enable(struct intel_rps *rps);
22void intel_rps_disable(struct intel_rps *rps);
23
24void intel_rps_park(struct intel_rps *rps);
25void intel_rps_unpark(struct intel_rps *rps);
26void intel_rps_boost(struct i915_request *rq);
27
28int intel_rps_set(struct intel_rps *rps, u8 val);
29void intel_rps_mark_interactive(struct intel_rps *rps, bool interactive);
30
31int intel_gpu_freq(struct intel_rps *rps, int val);
32int intel_freq_opcode(struct intel_rps *rps, int val);
33u32 intel_rps_get_cagf(struct intel_rps *rps, u32 rpstat1);
34u32 intel_rps_read_actual_frequency(struct intel_rps *rps);
35
36void gen5_rps_irq_handler(struct intel_rps *rps);
37void gen6_rps_irq_handler(struct intel_rps *rps, u32 pm_iir);
38void gen11_rps_irq_handler(struct intel_rps *rps, u32 pm_iir);
39
40static inline bool intel_rps_is_enabled(const struct intel_rps *rps)
41{
42 return test_bit(INTEL_RPS_ENABLED, &rps->flags);
43}
44
45static inline void intel_rps_set_enabled(struct intel_rps *rps)
46{
47 set_bit(INTEL_RPS_ENABLED, &rps->flags);
48}
49
50static inline void intel_rps_clear_enabled(struct intel_rps *rps)
51{
52 clear_bit(INTEL_RPS_ENABLED, &rps->flags);
53}
54
55static inline bool intel_rps_is_active(const struct intel_rps *rps)
56{
57 return test_bit(INTEL_RPS_ACTIVE, &rps->flags);
58}
59
60static inline void intel_rps_set_active(struct intel_rps *rps)
61{
62 set_bit(INTEL_RPS_ACTIVE, &rps->flags);
63}
64
65static inline bool intel_rps_clear_active(struct intel_rps *rps)
66{
67 return test_and_clear_bit(INTEL_RPS_ACTIVE, &rps->flags);
68}
69
70static inline bool intel_rps_has_interrupts(const struct intel_rps *rps)
71{
72 return test_bit(INTEL_RPS_INTERRUPTS, &rps->flags);
73}
74
75static inline void intel_rps_set_interrupts(struct intel_rps *rps)
76{
77 set_bit(INTEL_RPS_INTERRUPTS, &rps->flags);
78}
79
80static inline void intel_rps_clear_interrupts(struct intel_rps *rps)
81{
82 clear_bit(INTEL_RPS_INTERRUPTS, &rps->flags);
83}
84
85static inline bool intel_rps_uses_timer(const struct intel_rps *rps)
86{
87 return test_bit(INTEL_RPS_TIMER, &rps->flags);
88}
89
90static inline void intel_rps_set_timer(struct intel_rps *rps)
91{
92 set_bit(INTEL_RPS_TIMER, &rps->flags);
93}
94
95static inline void intel_rps_clear_timer(struct intel_rps *rps)
96{
97 clear_bit(INTEL_RPS_TIMER, &rps->flags);
98}
99
100#endif
101