Skip to content

Commit de511df

Browse files
committed
drm/i915: move structs from intel_display_power.h to .c
Anything internal to the implementation should be hidden away. Move the intel_display_power structs to the .c file. Cc: Imre Deak <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6abf2fc commit de511df

File tree

2 files changed

+93
-94
lines changed

2 files changed

+93
-94
lines changed

drivers/gpu/drm/i915/display/intel_display_power.c

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,98 @@
2424
#include "intel_vga.h"
2525
#include "vlv_sideband.h"
2626

27+
struct i915_power_well_ops {
28+
/*
29+
* Synchronize the well's hw state to match the current sw state, for
30+
* example enable/disable it based on the current refcount. Called
31+
* during driver init and resume time, possibly after first calling
32+
* the enable/disable handlers.
33+
*/
34+
void (*sync_hw)(struct drm_i915_private *dev_priv,
35+
struct i915_power_well *power_well);
36+
/*
37+
* Enable the well and resources that depend on it (for example
38+
* interrupts located on the well). Called after the 0->1 refcount
39+
* transition.
40+
*/
41+
void (*enable)(struct drm_i915_private *dev_priv,
42+
struct i915_power_well *power_well);
43+
/*
44+
* Disable the well and resources that depend on it. Called after
45+
* the 1->0 refcount transition.
46+
*/
47+
void (*disable)(struct drm_i915_private *dev_priv,
48+
struct i915_power_well *power_well);
49+
/* Returns the hw enabled state. */
50+
bool (*is_enabled)(struct drm_i915_private *dev_priv,
51+
struct i915_power_well *power_well);
52+
};
53+
54+
struct i915_power_well_regs {
55+
i915_reg_t bios;
56+
i915_reg_t driver;
57+
i915_reg_t kvmr;
58+
i915_reg_t debug;
59+
};
60+
61+
/* Power well structure for haswell */
62+
struct i915_power_well_desc {
63+
const char *name;
64+
bool always_on;
65+
u64 domains;
66+
/* unique identifier for this power well */
67+
enum i915_power_well_id id;
68+
/*
69+
* Arbitraty data associated with this power well. Platform and power
70+
* well specific.
71+
*/
72+
union {
73+
struct {
74+
/*
75+
* request/status flag index in the PUNIT power well
76+
* control/status registers.
77+
*/
78+
u8 idx;
79+
} vlv;
80+
struct {
81+
enum dpio_phy phy;
82+
} bxt;
83+
struct {
84+
const struct i915_power_well_regs *regs;
85+
/*
86+
* request/status flag index in the power well
87+
* constrol/status registers.
88+
*/
89+
u8 idx;
90+
/* Mask of pipes whose IRQ logic is backed by the pw */
91+
u8 irq_pipe_mask;
92+
/*
93+
* Instead of waiting for the status bit to ack enables,
94+
* just wait a specific amount of time and then consider
95+
* the well enabled.
96+
*/
97+
u16 fixed_enable_delay;
98+
/* The pw is backing the VGA functionality */
99+
bool has_vga:1;
100+
bool has_fuses:1;
101+
/*
102+
* The pw is for an ICL+ TypeC PHY port in
103+
* Thunderbolt mode.
104+
*/
105+
bool is_tc_tbt:1;
106+
} hsw;
107+
};
108+
const struct i915_power_well_ops *ops;
109+
};
110+
111+
struct i915_power_well {
112+
const struct i915_power_well_desc *desc;
113+
/* power well enable/disable usage count */
114+
int count;
115+
/* cached hw enabled state */
116+
bool hw_enabled;
117+
};
118+
27119
bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
28120
enum i915_power_well_id power_well_id);
29121

drivers/gpu/drm/i915/display/intel_display_power.h

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "i915_reg.h"
1212

1313
struct drm_i915_private;
14+
struct i915_power_well;
1415
struct intel_encoder;
1516

1617
enum intel_display_power_domain {
@@ -155,100 +156,6 @@ enum i915_power_well_id {
155156
((tran) == TRANSCODER_EDP ? POWER_DOMAIN_TRANSCODER_EDP : \
156157
(tran) + POWER_DOMAIN_TRANSCODER_A)
157158

158-
struct i915_power_well;
159-
160-
struct i915_power_well_ops {
161-
/*
162-
* Synchronize the well's hw state to match the current sw state, for
163-
* example enable/disable it based on the current refcount. Called
164-
* during driver init and resume time, possibly after first calling
165-
* the enable/disable handlers.
166-
*/
167-
void (*sync_hw)(struct drm_i915_private *dev_priv,
168-
struct i915_power_well *power_well);
169-
/*
170-
* Enable the well and resources that depend on it (for example
171-
* interrupts located on the well). Called after the 0->1 refcount
172-
* transition.
173-
*/
174-
void (*enable)(struct drm_i915_private *dev_priv,
175-
struct i915_power_well *power_well);
176-
/*
177-
* Disable the well and resources that depend on it. Called after
178-
* the 1->0 refcount transition.
179-
*/
180-
void (*disable)(struct drm_i915_private *dev_priv,
181-
struct i915_power_well *power_well);
182-
/* Returns the hw enabled state. */
183-
bool (*is_enabled)(struct drm_i915_private *dev_priv,
184-
struct i915_power_well *power_well);
185-
};
186-
187-
struct i915_power_well_regs {
188-
i915_reg_t bios;
189-
i915_reg_t driver;
190-
i915_reg_t kvmr;
191-
i915_reg_t debug;
192-
};
193-
194-
/* Power well structure for haswell */
195-
struct i915_power_well_desc {
196-
const char *name;
197-
bool always_on;
198-
u64 domains;
199-
/* unique identifier for this power well */
200-
enum i915_power_well_id id;
201-
/*
202-
* Arbitraty data associated with this power well. Platform and power
203-
* well specific.
204-
*/
205-
union {
206-
struct {
207-
/*
208-
* request/status flag index in the PUNIT power well
209-
* control/status registers.
210-
*/
211-
u8 idx;
212-
} vlv;
213-
struct {
214-
enum dpio_phy phy;
215-
} bxt;
216-
struct {
217-
const struct i915_power_well_regs *regs;
218-
/*
219-
* request/status flag index in the power well
220-
* constrol/status registers.
221-
*/
222-
u8 idx;
223-
/* Mask of pipes whose IRQ logic is backed by the pw */
224-
u8 irq_pipe_mask;
225-
/*
226-
* Instead of waiting for the status bit to ack enables,
227-
* just wait a specific amount of time and then consider
228-
* the well enabled.
229-
*/
230-
u16 fixed_enable_delay;
231-
/* The pw is backing the VGA functionality */
232-
bool has_vga:1;
233-
bool has_fuses:1;
234-
/*
235-
* The pw is for an ICL+ TypeC PHY port in
236-
* Thunderbolt mode.
237-
*/
238-
bool is_tc_tbt:1;
239-
} hsw;
240-
};
241-
const struct i915_power_well_ops *ops;
242-
};
243-
244-
struct i915_power_well {
245-
const struct i915_power_well_desc *desc;
246-
/* power well enable/disable usage count */
247-
int count;
248-
/* cached hw enabled state */
249-
bool hw_enabled;
250-
};
251-
252159
struct i915_power_domains {
253160
/*
254161
* Power wells needed for initialization at driver init and suspend

0 commit comments

Comments
 (0)