diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-12-04 03:46:05 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-12-08 10:13:53 -0500 |
commit | 4ee6034c80c50b6e788f0f4291c3ad64debde390 (patch) | |
tree | 26f57374de4d2ce73a51a2ad9ad9b5220c62f05d /include/drm | |
parent | 11a0ba972d55dd21d88b62e918d6cf072c9c67af (diff) |
drm: Document drm_connector_helper_funcs
Nothing special, except the somewhat awkward split in probe helper
callbacks between here and drm_crtc_funcs.
v2: Suggestions from Thierry.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-25-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_modeset_helper_vtables.h | 106 |
1 files changed, 101 insertions, 5 deletions
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index c77b7dcf343b..4b3869bd49b5 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h | |||
@@ -270,18 +270,114 @@ static inline void drm_encoder_helper_add(struct drm_encoder *encoder, | |||
270 | 270 | ||
271 | /** | 271 | /** |
272 | * struct drm_connector_helper_funcs - helper operations for connectors | 272 | * struct drm_connector_helper_funcs - helper operations for connectors |
273 | * @get_modes: get mode list for this connector | ||
274 | * @mode_valid: is this mode valid on the given connector? (optional) | ||
275 | * @best_encoder: return the preferred encoder for this connector | ||
276 | * @atomic_best_encoder: atomic version of @best_encoder | ||
277 | * | 273 | * |
278 | * The helper operations are called by the mid-layer CRTC helper. | 274 | * These functions are used by the atomic and legacy modeset helpers and by the |
275 | * probe helpers. | ||
279 | */ | 276 | */ |
280 | struct drm_connector_helper_funcs { | 277 | struct drm_connector_helper_funcs { |
278 | /** | ||
279 | * @get_modes: | ||
280 | * | ||
281 | * This function should fill in all modes currently valid for the sink | ||
282 | * into the connector->probed_modes list. It should also update the | ||
283 | * EDID property by calling drm_mode_connector_update_edid_property(). | ||
284 | * | ||
285 | * The usual way to implement this is to cache the EDID retrieved in the | ||
286 | * probe callback somewhere in the driver-private connector structure. | ||
287 | * In this function drivers then parse the modes in the EDID and add | ||
288 | * them by calling drm_add_edid_modes(). But connectors that driver a | ||
289 | * fixed panel can also manually add specific modes using | ||
290 | * drm_mode_probed_add(). Finally drivers that support audio probably | ||
291 | * want to update the ELD data, too, using drm_edid_to_eld(). | ||
292 | * | ||
293 | * This function is only called after the ->detect() hook has indicated | ||
294 | * that a sink is connected and when the EDID isn't overridden through | ||
295 | * sysfs or the kernel commandline. | ||
296 | * | ||
297 | * This callback is used by the probe helpers in e.g. | ||
298 | * drm_helper_probe_single_connector_modes(). | ||
299 | * | ||
300 | * RETURNS: | ||
301 | * | ||
302 | * The number of modes added by calling drm_mode_probed_add(). | ||
303 | */ | ||
281 | int (*get_modes)(struct drm_connector *connector); | 304 | int (*get_modes)(struct drm_connector *connector); |
305 | |||
306 | /** | ||
307 | * @mode_valid: | ||
308 | * | ||
309 | * Callback to validate a mode for a connector, irrespective of the | ||
310 | * specific display configuration. | ||
311 | * | ||
312 | * This callback is used by the probe helpers to filter the mode list | ||
313 | * (which is usually derived from the EDID data block from the sink). | ||
314 | * See e.g. drm_helper_probe_single_connector_modes(). | ||
315 | * | ||
316 | * NOTE: | ||
317 | * | ||
318 | * This only filters the mode list supplied to userspace in the | ||
319 | * GETCONNECOTR IOCTL. Userspace is free to create modes of its own and | ||
320 | * ask the kernel to use them. It this case the atomic helpers or legacy | ||
321 | * CRTC helpers will not call this function. Drivers therefore must | ||
322 | * still fully validate any mode passed in in a modeset request. | ||
323 | * | ||
324 | * RETURNS: | ||
325 | * | ||
326 | * Either MODE_OK or one of the failure reasons in enum | ||
327 | * &drm_mode_status. | ||
328 | */ | ||
282 | enum drm_mode_status (*mode_valid)(struct drm_connector *connector, | 329 | enum drm_mode_status (*mode_valid)(struct drm_connector *connector, |
283 | struct drm_display_mode *mode); | 330 | struct drm_display_mode *mode); |
331 | /** | ||
332 | * @best_encoder: | ||
333 | * | ||
334 | * This function should select the best encoder for the given connector. | ||
335 | * | ||
336 | * This function is used by both the atomic helpers (in the | ||
337 | * drm_atomic_helper_check_modeset() function) and in the legacy CRTC | ||
338 | * helpers. | ||
339 | * | ||
340 | * NOTE: | ||
341 | * | ||
342 | * In atomic drivers this function is called in the check phase of an | ||
343 | * atomic update. The driver is not allowed to change or inspect | ||
344 | * anything outside of arguments passed-in. Atomic drivers which need to | ||
345 | * inspect dynamic configuration state should instead use | ||
346 | * @atomic_best_encoder. | ||
347 | * | ||
348 | * RETURNS: | ||
349 | * | ||
350 | * Encoder that should be used for the given connector and connector | ||
351 | * state, or NULL if no suitable encoder exists. Note that the helpers | ||
352 | * will ensure that encoders aren't used twice, drivers should not check | ||
353 | * for this. | ||
354 | */ | ||
284 | struct drm_encoder *(*best_encoder)(struct drm_connector *connector); | 355 | struct drm_encoder *(*best_encoder)(struct drm_connector *connector); |
356 | |||
357 | /** | ||
358 | * @atomic_best_encoder: | ||
359 | * | ||
360 | * This is the atomic version of @best_encoder for atomic drivers which | ||
361 | * need to select the best encoder depending upon the desired | ||
362 | * configuration and can't select it statically. | ||
363 | * | ||
364 | * This function is used by drm_atomic_helper_check_modeset() and either | ||
365 | * this or @best_encoder is required. | ||
366 | * | ||
367 | * NOTE: | ||
368 | * | ||
369 | * This function is called in the check phase of an atomic update. The | ||
370 | * driver is not allowed to change anything outside of the free-standing | ||
371 | * state objects passed-in or assembled in the overall &drm_atomic_state | ||
372 | * update tracking structure. | ||
373 | * | ||
374 | * RETURNS: | ||
375 | * | ||
376 | * Encoder that should be used for the given connector and connector | ||
377 | * state, or NULL if no suitable encoder exists. Note that the helpers | ||
378 | * will ensure that encoders aren't used twice, drivers should not check | ||
379 | * for this. | ||
380 | */ | ||
285 | struct drm_encoder *(*atomic_best_encoder)(struct drm_connector *connector, | 381 | struct drm_encoder *(*atomic_best_encoder)(struct drm_connector *connector, |
286 | struct drm_connector_state *connector_state); | 382 | struct drm_connector_state *connector_state); |
287 | }; | 383 | }; |