Rev 5270 | Rev 6936 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5270 | Rev 6082 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | #include |
37 | #include |
38 | #include |
38 | #include |
Line 39... | Line 39... | ||
39 | 39 | ||
Line -... | Line 40... | ||
- | 40 | #include |
|
- | 41 | ||
40 | #include |
42 | #include |
41 | 43 | ||
42 | enum mode_set_atomic { |
44 | enum mode_set_atomic { |
43 | LEAVE_ATOMIC_MODE_SET, |
45 | LEAVE_ATOMIC_MODE_SET, |
Line 44... | Line 46... | ||
44 | ENTER_ATOMIC_MODE_SET, |
46 | ENTER_ATOMIC_MODE_SET, |
45 | }; |
47 | }; |
- | 48 | ||
- | 49 | /** |
|
- | 50 | * struct drm_crtc_helper_funcs - helper operations for CRTCs |
|
46 | 51 | * @dpms: set power state |
|
47 | /** |
52 | * @prepare: prepare the CRTC, called before @mode_set |
- | 53 | * @commit: commit changes to CRTC, called after @mode_set |
|
- | 54 | * @mode_fixup: try to fixup proposed mode for this CRTC |
|
- | 55 | * @mode_set: set this mode |
|
- | 56 | * @mode_set_nofb: set mode only (no scanout buffer attached) |
|
- | 57 | * @mode_set_base: update the scanout buffer |
|
- | 58 | * @mode_set_base_atomic: non-blocking mode set (used for kgdb support) |
|
- | 59 | * @load_lut: load color palette |
|
- | 60 | * @disable: disable CRTC when no longer in use |
|
- | 61 | * @enable: enable CRTC |
|
48 | * drm_crtc_helper_funcs - helper operations for CRTCs |
62 | * @atomic_check: check for validity of an atomic state |
49 | * @mode_fixup: try to fixup proposed mode for this connector |
63 | * @atomic_begin: begin atomic update |
- | 64 | * @atomic_flush: flush atomic update |
|
- | 65 | * |
|
- | 66 | * The helper operations are called by the mid-layer CRTC helper. |
|
- | 67 | * |
|
- | 68 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are |
|
- | 69 | * deprecated. Used @enable and @disable instead exclusively. |
|
- | 70 | * |
|
50 | * @mode_set: set this mode |
71 | * With legacy crtc helpers there's a big semantic difference between @disable |
51 | * |
72 | * and the other hooks: @disable also needs to release any resources acquired in |
52 | * The helper operations are called by the mid-layer CRTC helper. |
73 | * @mode_set (like shared PLLs). |
53 | */ |
74 | */ |
54 | struct drm_crtc_helper_funcs { |
75 | struct drm_crtc_helper_funcs { |
Line 66... | Line 87... | ||
66 | struct drm_display_mode *adjusted_mode); |
87 | struct drm_display_mode *adjusted_mode); |
67 | /* Actually set the mode */ |
88 | /* Actually set the mode */ |
68 | int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode, |
89 | int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode, |
69 | struct drm_display_mode *adjusted_mode, int x, int y, |
90 | struct drm_display_mode *adjusted_mode, int x, int y, |
70 | struct drm_framebuffer *old_fb); |
91 | struct drm_framebuffer *old_fb); |
- | 92 | /* Actually set the mode for atomic helpers, optional */ |
|
71 | void (*mode_set_nofb)(struct drm_crtc *crtc); |
93 | void (*mode_set_nofb)(struct drm_crtc *crtc); |
Line 72... | Line 94... | ||
72 | 94 | ||
73 | /* Move the crtc on the current fb to the given position *optional* */ |
95 | /* Move the crtc on the current fb to the given position *optional* */ |
74 | int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, |
96 | int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, |
Line 78... | Line 100... | ||
78 | enum mode_set_atomic); |
100 | enum mode_set_atomic); |
Line 79... | Line 101... | ||
79 | 101 | ||
80 | /* reload the current crtc LUT */ |
102 | /* reload the current crtc LUT */ |
Line 81... | Line -... | ||
81 | void (*load_lut)(struct drm_crtc *crtc); |
- | |
82 | 103 | void (*load_lut)(struct drm_crtc *crtc); |
|
- | 104 | ||
Line 83... | Line 105... | ||
83 | /* disable crtc when not in use - more explicit than dpms off */ |
105 | void (*disable)(struct drm_crtc *crtc); |
84 | void (*disable)(struct drm_crtc *crtc); |
106 | void (*enable)(struct drm_crtc *crtc); |
85 | 107 | ||
86 | /* atomic helpers */ |
108 | /* atomic helpers */ |
- | 109 | int (*atomic_check)(struct drm_crtc *crtc, |
|
87 | int (*atomic_check)(struct drm_crtc *crtc, |
110 | struct drm_crtc_state *state); |
- | 111 | void (*atomic_begin)(struct drm_crtc *crtc, |
|
88 | struct drm_crtc_state *state); |
112 | struct drm_crtc_state *old_crtc_state); |
Line 89... | Line 113... | ||
89 | void (*atomic_begin)(struct drm_crtc *crtc); |
113 | void (*atomic_flush)(struct drm_crtc *crtc, |
90 | void (*atomic_flush)(struct drm_crtc *crtc); |
114 | struct drm_crtc_state *old_crtc_state); |
- | 115 | }; |
|
- | 116 | ||
- | 117 | /** |
|
91 | }; |
118 | * struct drm_encoder_helper_funcs - helper operations for encoders |
- | 119 | * @dpms: set power state |
|
- | 120 | * @save: save connector state |
|
- | 121 | * @restore: restore connector state |
|
- | 122 | * @mode_fixup: try to fixup proposed mode for this connector |
|
- | 123 | * @prepare: part of the disable sequence, called before the CRTC modeset |
|
- | 124 | * @commit: called after the CRTC modeset |
|
92 | 125 | * @mode_set: set this mode, optional for atomic helpers |
|
- | 126 | * @get_crtc: return CRTC that the encoder is currently attached to |
|
93 | /** |
127 | * @detect: connection status detection |
94 | * drm_encoder_helper_funcs - helper operations for encoders |
128 | * @disable: disable encoder when not in use (overrides DPMS off) |
- | 129 | * @enable: enable encoder |
|
- | 130 | * @atomic_check: check for validity of an atomic update |
|
- | 131 | * |
|
- | 132 | * The helper operations are called by the mid-layer CRTC helper. |
|
- | 133 | * |
|
- | 134 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are |
|
- | 135 | * deprecated. Used @enable and @disable instead exclusively. |
|
95 | * @mode_fixup: try to fixup proposed mode for this connector |
136 | * |
96 | * @mode_set: set this mode |
137 | * With legacy crtc helpers there's a big semantic difference between @disable |
97 | * |
138 | * and the other hooks: @disable also needs to release any resources acquired in |
98 | * The helper operations are called by the mid-layer CRTC helper. |
139 | * @mode_set (like shared PLLs). |
99 | */ |
140 | */ |
Line 112... | Line 153... | ||
112 | struct drm_display_mode *adjusted_mode); |
153 | struct drm_display_mode *adjusted_mode); |
113 | struct drm_crtc *(*get_crtc)(struct drm_encoder *encoder); |
154 | struct drm_crtc *(*get_crtc)(struct drm_encoder *encoder); |
114 | /* detect for DAC style encoders */ |
155 | /* detect for DAC style encoders */ |
115 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, |
156 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, |
116 | struct drm_connector *connector); |
157 | struct drm_connector *connector); |
117 | /* disable encoder when not in use - more explicit than dpms off */ |
- | |
118 | void (*disable)(struct drm_encoder *encoder); |
158 | void (*disable)(struct drm_encoder *encoder); |
- | 159 | ||
- | 160 | void (*enable)(struct drm_encoder *encoder); |
|
- | 161 | ||
- | 162 | /* atomic helpers */ |
|
- | 163 | int (*atomic_check)(struct drm_encoder *encoder, |
|
- | 164 | struct drm_crtc_state *crtc_state, |
|
- | 165 | struct drm_connector_state *conn_state); |
|
119 | }; |
166 | }; |
Line 120... | Line 167... | ||
120 | 167 | ||
121 | /** |
168 | /** |
122 | * drm_connector_helper_funcs - helper operations for connectors |
169 | * struct drm_connector_helper_funcs - helper operations for connectors |
123 | * @get_modes: get mode list for this connector |
170 | * @get_modes: get mode list for this connector |
- | 171 | * @mode_valid: is this mode valid on the given connector? (optional) |
|
- | 172 | * @best_encoder: return the preferred encoder for this connector |
|
124 | * @mode_valid (optional): is this mode valid on the given connector? |
173 | * @atomic_best_encoder: atomic version of @best_encoder |
125 | * |
174 | * |
126 | * The helper operations are called by the mid-layer CRTC helper. |
175 | * The helper operations are called by the mid-layer CRTC helper. |
127 | */ |
176 | */ |
128 | struct drm_connector_helper_funcs { |
177 | struct drm_connector_helper_funcs { |
129 | int (*get_modes)(struct drm_connector *connector); |
178 | int (*get_modes)(struct drm_connector *connector); |
130 | enum drm_mode_status (*mode_valid)(struct drm_connector *connector, |
179 | enum drm_mode_status (*mode_valid)(struct drm_connector *connector, |
131 | struct drm_display_mode *mode); |
180 | struct drm_display_mode *mode); |
- | 181 | struct drm_encoder *(*best_encoder)(struct drm_connector *connector); |
|
- | 182 | struct drm_encoder *(*atomic_best_encoder)(struct drm_connector *connector, |
|
132 | struct drm_encoder *(*best_encoder)(struct drm_connector *connector); |
183 | struct drm_connector_state *connector_state); |
Line 133... | Line 184... | ||
133 | }; |
184 | }; |
134 | 185 | ||
135 | extern void drm_helper_disable_unused_functions(struct drm_device *dev); |
186 | extern void drm_helper_disable_unused_functions(struct drm_device *dev); |
Line 139... | Line 190... | ||
139 | int x, int y, |
190 | int x, int y, |
140 | struct drm_framebuffer *old_fb); |
191 | struct drm_framebuffer *old_fb); |
141 | extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc); |
192 | extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc); |
142 | extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder); |
193 | extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder); |
Line 143... | Line 194... | ||
143 | 194 | ||
Line 144... | Line 195... | ||
144 | extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode); |
195 | extern int drm_helper_connector_dpms(struct drm_connector *connector, int mode); |
Line 145... | Line 196... | ||
145 | 196 | ||
146 | extern void drm_helper_move_panel_connectors_to_head(struct drm_device *); |
197 | extern void drm_helper_move_panel_connectors_to_head(struct drm_device *); |
Line 147... | Line 198... | ||
147 | 198 | ||
148 | extern void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, |
199 | extern void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, |
149 | struct drm_mode_fb_cmd2 *mode_cmd); |
200 | struct drm_mode_fb_cmd2 *mode_cmd); |
150 | 201 | ||
151 | static inline void drm_crtc_helper_add(struct drm_crtc *crtc, |
202 | static inline void drm_crtc_helper_add(struct drm_crtc *crtc, |
Line 152... | Line 203... | ||
152 | const struct drm_crtc_helper_funcs *funcs) |
203 | const struct drm_crtc_helper_funcs *funcs) |
153 | { |
204 | { |
154 | crtc->helper_private = (void *)funcs; |
205 | crtc->helper_private = funcs; |
155 | } |
206 | } |
156 | 207 | ||
Line 157... | Line 208... | ||
157 | static inline void drm_encoder_helper_add(struct drm_encoder *encoder, |
208 | static inline void drm_encoder_helper_add(struct drm_encoder *encoder, |
158 | const struct drm_encoder_helper_funcs *funcs) |
209 | const struct drm_encoder_helper_funcs *funcs) |
159 | { |
210 | { |
160 | encoder->helper_private = (void *)funcs; |
211 | encoder->helper_private = funcs; |
161 | } |
212 | } |
Line 162... | Line 213... | ||
162 | 213 | ||
Line 163... | Line 214... | ||
163 | static inline void drm_connector_helper_add(struct drm_connector *connector, |
214 | static inline void drm_connector_helper_add(struct drm_connector *connector, |
Line 187... | Line 238... | ||
187 | extern bool drm_helper_hpd_irq_event(struct drm_device *dev); |
238 | extern bool drm_helper_hpd_irq_event(struct drm_device *dev); |
188 | extern void drm_kms_helper_hotplug_event(struct drm_device *dev); |
239 | extern void drm_kms_helper_hotplug_event(struct drm_device *dev); |
Line 189... | Line 240... | ||
189 | 240 | ||
190 | extern void drm_kms_helper_poll_disable(struct drm_device *dev); |
241 | extern void drm_kms_helper_poll_disable(struct drm_device *dev); |
- | 242 | extern void drm_kms_helper_poll_enable(struct drm_device *dev); |
|
Line 191... | Line 243... | ||
191 | extern void drm_kms_helper_poll_enable(struct drm_device *dev); |
243 | extern void drm_kms_helper_poll_enable_locked(struct drm_device *dev); |