summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-04 03:45:58 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-08 10:13:51 -0500
commit6fe14acd496e7ca27d6dfbeaa71b4f16656d10c2 (patch)
tree942e1121ff25123d4103320960397853fc92dce5 /include/drm
parentc0714fc907db3c427d2153b68bd29eb6d40c44fd (diff)
drm: Document drm_connector_funcs
The special case here is that both ->detect and ->force are actually functions only called by the probe helpers and hence really shouldn't be here. But since they've used by pretty much every driver I figured it's better to just document this for now instead of holding this doc patch hostage until that's all fixed. For that reason also group force right next to detect. v2: Use FIXME comments to annotate where we should move a hook to helpers. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-18-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_crtc.h84
1 files changed, 74 insertions, 10 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e75b06b61143..819eb45821cd 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -617,16 +617,28 @@ struct drm_connector_state {
617 617
618/** 618/**
619 * struct drm_connector_funcs - control connectors on a given device 619 * struct drm_connector_funcs - control connectors on a given device
620 * @dpms: set power state
621 * @detect: is this connector active?
622 * @fill_modes: fill mode list for this connector
623 * @force: notify the driver that the connector is forced on
624 * 620 *
625 * Each CRTC may have one or more connectors attached to it. The functions 621 * Each CRTC may have one or more connectors attached to it. The functions
626 * below allow the core DRM code to control connectors, enumerate available modes, 622 * below allow the core DRM code to control connectors, enumerate available modes,
627 * etc. 623 * etc.
628 */ 624 */
629struct drm_connector_funcs { 625struct drm_connector_funcs {
626 /**
627 * @dpms:
628 *
629 * Legacy entry point to set the per-connector DPMS state. Legacy DPMS
630 * is exposed as a standard property on the connector, but diverted to
631 * this callback in the drm core. Note that atomic drivers don't
632 * implement the 4 level DPMS support on the connector any more, but
633 * instead only have an on/off "ACTIVE" property on the CRTC object.
634 *
635 * Drivers implementing atomic modeset should use
636 * drm_atomic_helper_connector_dpms() to implement this hook.
637 *
638 * RETURNS:
639 *
640 * 0 on success or a negative error code on failure.
641 */
630 int (*dpms)(struct drm_connector *connector, int mode); 642 int (*dpms)(struct drm_connector *connector, int mode);
631 643
632 /** 644 /**
@@ -641,14 +653,67 @@ struct drm_connector_funcs {
641 */ 653 */
642 void (*reset)(struct drm_connector *connector); 654 void (*reset)(struct drm_connector *connector);
643 655
644 /* Check to see if anything is attached to the connector. 656 /**
645 * @force is set to false whilst polling, true when checking the 657 * @detect:
646 * connector due to user request. @force can be used by the driver 658 *
647 * to avoid expensive, destructive operations during automated 659 * Check to see if anything is attached to the connector. The parameter
648 * probing. 660 * force is set to false whilst polling, true when checking the
661 * connector due to a user request. force can be used by the driver to
662 * avoid expensive, destructive operations during automated probing.
663 *
664 * FIXME:
665 *
666 * Note that this hook is only called by the probe helper. It's not in
667 * the helper library vtable purely for historical reasons. The only DRM
668 * core entry point to probe connector state is @fill_modes.
669 *
670 * RETURNS:
671 *
672 * drm_connector_status indicating the connector's status.
649 */ 673 */
650 enum drm_connector_status (*detect)(struct drm_connector *connector, 674 enum drm_connector_status (*detect)(struct drm_connector *connector,
651 bool force); 675 bool force);
676
677 /**
678 * @force:
679 *
680 * This function is called to update internal encoder state when the
681 * connector is forced to a certain state by userspace, either through
682 * the sysfs interfaces or on the kernel cmdline. In that case the
683 * @detect callback isn't called.
684 *
685 * FIXME:
686 *
687 * Note that this hook is only called by the probe helper. It's not in
688 * the helper library vtable purely for historical reasons. The only DRM
689 * core entry point to probe connector state is @fill_modes.
690 */
691 void (*force)(struct drm_connector *connector);
692
693 /**
694 * @fill_modes:
695 *
696 * Entry point for output detection and basic mode validation. The
697 * driver should reprobe the output if needed (e.g. when hotplug
698 * handling is unreliable), add all detected modes to connector->modes
699 * and filter out any the device can't support in any configuration. It
700 * also needs to filter out any modes wider or higher than the
701 * parameters max_width and max_height indicate.
702 *
703 * The drivers must also prune any modes no longer valid from
704 * connector->modes. Furthermore it must update connector->status and
705 * connector->edid. If no EDID has been received for this output
706 * connector->edid must be NULL.
707 *
708 * Drivers using the probe helpers should use
709 * drm_helper_probe_single_connector_modes() or
710 * drm_helper_probe_single_connector_modes_nomerge() to implement this
711 * function.
712 *
713 * RETURNS:
714 *
715 * The number of modes detected and filled into connector->modes.
716 */
652 int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height); 717 int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
653 718
654 /** 719 /**
@@ -679,7 +744,6 @@ struct drm_connector_funcs {
679 * connector hotplugging (e.g. DisplayPort MST). 744 * connector hotplugging (e.g. DisplayPort MST).
680 */ 745 */
681 void (*destroy)(struct drm_connector *connector); 746 void (*destroy)(struct drm_connector *connector);
682 void (*force)(struct drm_connector *connector);
683 747
684 /** 748 /**
685 * @atomic_duplicate_state: 749 * @atomic_duplicate_state: