2 * SPDX-License-Identifier: MIT
4 * Copyright © 2019 Intel Corporation
10 #include "intel_rps_types.h"
14 void intel_rps_init_early(struct intel_rps
*rps
);
15 void intel_rps_init(struct intel_rps
*rps
);
16 void intel_rps_sanitize(struct intel_rps
*rps
);
18 void intel_rps_driver_register(struct intel_rps
*rps
);
19 void intel_rps_driver_unregister(struct intel_rps
*rps
);
21 void intel_rps_enable(struct intel_rps
*rps
);
22 void intel_rps_disable(struct intel_rps
*rps
);
24 void intel_rps_park(struct intel_rps
*rps
);
25 void intel_rps_unpark(struct intel_rps
*rps
);
26 void intel_rps_boost(struct i915_request
*rq
);
28 int intel_rps_set(struct intel_rps
*rps
, u8 val
);
29 void intel_rps_mark_interactive(struct intel_rps
*rps
, bool interactive
);
31 int intel_gpu_freq(struct intel_rps
*rps
, int val
);
32 int intel_freq_opcode(struct intel_rps
*rps
, int val
);
33 u32
intel_rps_get_cagf(struct intel_rps
*rps
, u32 rpstat1
);
34 u32
intel_rps_read_actual_frequency(struct intel_rps
*rps
);
36 void gen5_rps_irq_handler(struct intel_rps
*rps
);
37 void gen6_rps_irq_handler(struct intel_rps
*rps
, u32 pm_iir
);
38 void gen11_rps_irq_handler(struct intel_rps
*rps
, u32 pm_iir
);
40 static inline bool intel_rps_is_enabled(const struct intel_rps
*rps
)
42 return test_bit(INTEL_RPS_ENABLED
, &rps
->flags
);
45 static inline void intel_rps_set_enabled(struct intel_rps
*rps
)
47 set_bit(INTEL_RPS_ENABLED
, &rps
->flags
);
50 static inline void intel_rps_clear_enabled(struct intel_rps
*rps
)
52 clear_bit(INTEL_RPS_ENABLED
, &rps
->flags
);
55 static inline bool intel_rps_is_active(const struct intel_rps
*rps
)
57 return test_bit(INTEL_RPS_ACTIVE
, &rps
->flags
);
60 static inline void intel_rps_set_active(struct intel_rps
*rps
)
62 set_bit(INTEL_RPS_ACTIVE
, &rps
->flags
);
65 static inline bool intel_rps_clear_active(struct intel_rps
*rps
)
67 return test_and_clear_bit(INTEL_RPS_ACTIVE
, &rps
->flags
);
70 static inline bool intel_rps_has_interrupts(const struct intel_rps
*rps
)
72 return test_bit(INTEL_RPS_INTERRUPTS
, &rps
->flags
);
75 static inline void intel_rps_set_interrupts(struct intel_rps
*rps
)
77 set_bit(INTEL_RPS_INTERRUPTS
, &rps
->flags
);
80 static inline void intel_rps_clear_interrupts(struct intel_rps
*rps
)
82 clear_bit(INTEL_RPS_INTERRUPTS
, &rps
->flags
);
85 static inline bool intel_rps_uses_timer(const struct intel_rps
*rps
)
87 return test_bit(INTEL_RPS_TIMER
, &rps
->flags
);
90 static inline void intel_rps_set_timer(struct intel_rps
*rps
)
92 set_bit(INTEL_RPS_TIMER
, &rps
->flags
);
95 static inline void intel_rps_clear_timer(struct intel_rps
*rps
)
97 clear_bit(INTEL_RPS_TIMER
, &rps
->flags
);
100 #endif /* INTEL_RPS_H */