1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2019 Intel Corporation
6 #ifndef INTEL_RPS_TYPES_H
7 #define INTEL_RPS_TYPES_H
9 #include <linux/atomic.h>
10 #include <linux/ktime.h>
11 #include <linux/mutex.h>
12 #include <linux/types.h>
13 #include <linux/workqueue.h>
17 unsigned long last_time1;
18 unsigned long chipset_power;
21 unsigned long gfx_power;
34 INTEL_RPS_ENABLED = 0,
41 struct mutex lock; /* protects enabling and the worker */
44 * work, interrupts_enabled and pm_iir are protected by
47 struct timer_list timer;
48 struct work_struct work;
55 /* PM interrupt bits that should never be masked */
59 /* Frequencies are stored in potentially platform dependent multiples.
60 * In other words, *_freq needs to be multiplied by X to be interesting.
61 * Soft limits are those which are used for the dynamic reclocking done
62 * by the driver (raise frequencies under heavy loads, and lower for
63 * lighter loads). Hard limits are those imposed by the hardware.
65 * A distinction is made for overclocking, which is never enabled by
66 * default, and is considered to be above the hard limit if it's
69 u8 cur_freq; /* Current frequency (cached, may not == HW) */
70 u8 last_freq; /* Last SWREQ frequency */
71 u8 min_freq_softlimit; /* Minimum frequency permitted by the driver */
72 u8 max_freq_softlimit; /* Max frequency permitted by the driver */
73 u8 max_freq; /* Maximum frequency, RP0 if not overclocking */
74 u8 min_freq; /* AKA RPn. Minimum frequency */
75 u8 boost_freq; /* Frequency to request when wait boosting */
76 u8 idle_freq; /* Frequency to request when we are idle */
77 u8 efficient_freq; /* AKA RPe. Pre-determined balanced frequency */
78 u8 rp1_freq; /* "less than" RP0 power/freqency */
79 u8 rp0_freq; /* Non-overclocked max frequency. */
80 u16 gpll_ref_freq; /* vlv/chv GPLL reference frequency */
87 enum { LOW_POWER, BETWEEN, HIGH_POWER } mode;
88 unsigned int interactive;
90 u8 up_threshold; /* Current %busy required to uplock */
91 u8 down_threshold; /* Current %busy required to downclock */
97 /* manual wa residency calculations */
98 struct intel_rps_ei ei;
102 #endif /* INTEL_RPS_TYPES_H */