diff options
Diffstat (limited to 'Documentation/DocBook/gpu.tmpl')
-rw-r--r-- | Documentation/DocBook/gpu.tmpl | 250 |
1 files changed, 42 insertions, 208 deletions
diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl index 6c6e81a9eaf4..a8669330b456 100644 --- a/Documentation/DocBook/gpu.tmpl +++ b/Documentation/DocBook/gpu.tmpl | |||
@@ -1579,194 +1579,6 @@ void intel_crt_init(struct drm_device *dev) | |||
1579 | entities. | 1579 | entities. |
1580 | </para> | 1580 | </para> |
1581 | <sect2> | 1581 | <sect2> |
1582 | <title>Legacy CRTC Helper Operations</title> | ||
1583 | <itemizedlist> | ||
1584 | <listitem id="drm-helper-crtc-mode-fixup"> | ||
1585 | <synopsis>bool (*mode_fixup)(struct drm_crtc *crtc, | ||
1586 | const struct drm_display_mode *mode, | ||
1587 | struct drm_display_mode *adjusted_mode);</synopsis> | ||
1588 | <para> | ||
1589 | Let CRTCs adjust the requested mode or reject it completely. This | ||
1590 | operation returns true if the mode is accepted (possibly after being | ||
1591 | adjusted) or false if it is rejected. | ||
1592 | </para> | ||
1593 | <para> | ||
1594 | The <methodname>mode_fixup</methodname> operation should reject the | ||
1595 | mode if it can't reasonably use it. The definition of "reasonable" | ||
1596 | is currently fuzzy in this context. One possible behaviour would be | ||
1597 | to set the adjusted mode to the panel timings when a fixed-mode | ||
1598 | panel is used with hardware capable of scaling. Another behaviour | ||
1599 | would be to accept any input mode and adjust it to the closest mode | ||
1600 | supported by the hardware (FIXME: This needs to be clarified). | ||
1601 | </para> | ||
1602 | </listitem> | ||
1603 | <listitem> | ||
1604 | <synopsis>int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, | ||
1605 | struct drm_framebuffer *old_fb)</synopsis> | ||
1606 | <para> | ||
1607 | Move the CRTC on the current frame buffer (stored in | ||
1608 | <literal>crtc->fb</literal>) to position (x,y). Any of the frame | ||
1609 | buffer, x position or y position may have been modified. | ||
1610 | </para> | ||
1611 | <para> | ||
1612 | This helper operation is optional. If not provided, the | ||
1613 | <function>drm_crtc_helper_set_config</function> function will fall | ||
1614 | back to the <methodname>mode_set</methodname> helper operation. | ||
1615 | </para> | ||
1616 | <note><para> | ||
1617 | FIXME: Why are x and y passed as arguments, as they can be accessed | ||
1618 | through <literal>crtc->x</literal> and | ||
1619 | <literal>crtc->y</literal>? | ||
1620 | </para></note> | ||
1621 | </listitem> | ||
1622 | <listitem> | ||
1623 | <synopsis>void (*prepare)(struct drm_crtc *crtc);</synopsis> | ||
1624 | <para> | ||
1625 | Prepare the CRTC for mode setting. This operation is called after | ||
1626 | validating the requested mode. Drivers use it to perform | ||
1627 | device-specific operations required before setting the new mode. | ||
1628 | </para> | ||
1629 | </listitem> | ||
1630 | <listitem> | ||
1631 | <synopsis>int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode, | ||
1632 | struct drm_display_mode *adjusted_mode, int x, int y, | ||
1633 | struct drm_framebuffer *old_fb);</synopsis> | ||
1634 | <para> | ||
1635 | Set a new mode, position and frame buffer. Depending on the device | ||
1636 | requirements, the mode can be stored internally by the driver and | ||
1637 | applied in the <methodname>commit</methodname> operation, or | ||
1638 | programmed to the hardware immediately. | ||
1639 | </para> | ||
1640 | <para> | ||
1641 | The <methodname>mode_set</methodname> operation returns 0 on success | ||
1642 | or a negative error code if an error occurs. | ||
1643 | </para> | ||
1644 | </listitem> | ||
1645 | <listitem> | ||
1646 | <synopsis>void (*commit)(struct drm_crtc *crtc);</synopsis> | ||
1647 | <para> | ||
1648 | Commit a mode. This operation is called after setting the new mode. | ||
1649 | Upon return the device must use the new mode and be fully | ||
1650 | operational. | ||
1651 | </para> | ||
1652 | </listitem> | ||
1653 | </itemizedlist> | ||
1654 | </sect2> | ||
1655 | <sect2> | ||
1656 | <title>Encoder Helper Operations</title> | ||
1657 | <itemizedlist> | ||
1658 | <listitem> | ||
1659 | <synopsis>bool (*mode_fixup)(struct drm_encoder *encoder, | ||
1660 | const struct drm_display_mode *mode, | ||
1661 | struct drm_display_mode *adjusted_mode);</synopsis> | ||
1662 | <para> | ||
1663 | Let encoders adjust the requested mode or reject it completely. This | ||
1664 | operation returns true if the mode is accepted (possibly after being | ||
1665 | adjusted) or false if it is rejected. See the | ||
1666 | <link linkend="drm-helper-crtc-mode-fixup">mode_fixup CRTC helper | ||
1667 | operation</link> for an explanation of the allowed adjustments. | ||
1668 | </para> | ||
1669 | </listitem> | ||
1670 | <listitem> | ||
1671 | <synopsis>void (*prepare)(struct drm_encoder *encoder);</synopsis> | ||
1672 | <para> | ||
1673 | Prepare the encoder for mode setting. This operation is called after | ||
1674 | validating the requested mode. Drivers use it to perform | ||
1675 | device-specific operations required before setting the new mode. | ||
1676 | </para> | ||
1677 | </listitem> | ||
1678 | <listitem> | ||
1679 | <synopsis>void (*mode_set)(struct drm_encoder *encoder, | ||
1680 | struct drm_display_mode *mode, | ||
1681 | struct drm_display_mode *adjusted_mode);</synopsis> | ||
1682 | <para> | ||
1683 | Set a new mode. Depending on the device requirements, the mode can | ||
1684 | be stored internally by the driver and applied in the | ||
1685 | <methodname>commit</methodname> operation, or programmed to the | ||
1686 | hardware immediately. | ||
1687 | </para> | ||
1688 | </listitem> | ||
1689 | <listitem> | ||
1690 | <synopsis>void (*commit)(struct drm_encoder *encoder);</synopsis> | ||
1691 | <para> | ||
1692 | Commit a mode. This operation is called after setting the new mode. | ||
1693 | Upon return the device must use the new mode and be fully | ||
1694 | operational. | ||
1695 | </para> | ||
1696 | </listitem> | ||
1697 | </itemizedlist> | ||
1698 | </sect2> | ||
1699 | <sect2> | ||
1700 | <title>Connector Helper Operations</title> | ||
1701 | <itemizedlist> | ||
1702 | <listitem> | ||
1703 | <synopsis>struct drm_encoder *(*best_encoder)(struct drm_connector *connector);</synopsis> | ||
1704 | <para> | ||
1705 | Return a pointer to the best encoder for the connecter. Device that | ||
1706 | map connectors to encoders 1:1 simply return the pointer to the | ||
1707 | associated encoder. This operation is mandatory. | ||
1708 | </para> | ||
1709 | </listitem> | ||
1710 | <listitem> | ||
1711 | <synopsis>int (*get_modes)(struct drm_connector *connector);</synopsis> | ||
1712 | <para> | ||
1713 | Fill the connector's <structfield>probed_modes</structfield> list | ||
1714 | by parsing EDID data with <function>drm_add_edid_modes</function>, | ||
1715 | adding standard VESA DMT modes with <function>drm_add_modes_noedid</function>, | ||
1716 | or calling <function>drm_mode_probed_add</function> directly for every | ||
1717 | supported mode and return the number of modes it has detected. This | ||
1718 | operation is mandatory. | ||
1719 | </para> | ||
1720 | <para> | ||
1721 | Note that the caller function will automatically add standard VESA | ||
1722 | DMT modes up to 1024x768 if the <methodname>get_modes</methodname> | ||
1723 | helper operation returns no mode and if the connector status is | ||
1724 | connector_status_connected. There is no need to call | ||
1725 | <function>drm_add_edid_modes</function> manually in that case. | ||
1726 | </para> | ||
1727 | <para> | ||
1728 | The <structfield>vrefresh</structfield> value is computed by | ||
1729 | <function>drm_helper_probe_single_connector_modes</function>. | ||
1730 | </para> | ||
1731 | <para> | ||
1732 | When parsing EDID data, <function>drm_add_edid_modes</function> fills the | ||
1733 | connector <structfield>display_info</structfield> | ||
1734 | <structfield>width_mm</structfield> and | ||
1735 | <structfield>height_mm</structfield> fields. When creating modes | ||
1736 | manually the <methodname>get_modes</methodname> helper operation must | ||
1737 | set the <structfield>display_info</structfield> | ||
1738 | <structfield>width_mm</structfield> and | ||
1739 | <structfield>height_mm</structfield> fields if they haven't been set | ||
1740 | already (for instance at initialization time when a fixed-size panel is | ||
1741 | attached to the connector). The mode <structfield>width_mm</structfield> | ||
1742 | and <structfield>height_mm</structfield> fields are only used internally | ||
1743 | during EDID parsing and should not be set when creating modes manually. | ||
1744 | </para> | ||
1745 | </listitem> | ||
1746 | <listitem> | ||
1747 | <synopsis>int (*mode_valid)(struct drm_connector *connector, | ||
1748 | struct drm_display_mode *mode);</synopsis> | ||
1749 | <para> | ||
1750 | Verify whether a mode is valid for the connector. Return MODE_OK for | ||
1751 | supported modes and one of the enum drm_mode_status values (MODE_*) | ||
1752 | for unsupported modes. This operation is optional. | ||
1753 | </para> | ||
1754 | <para> | ||
1755 | As the mode rejection reason is currently not used beside for | ||
1756 | immediately removing the unsupported mode, an implementation can | ||
1757 | return MODE_BAD regardless of the exact reason why the mode is not | ||
1758 | valid. | ||
1759 | </para> | ||
1760 | <note><para> | ||
1761 | Note that the <methodname>mode_valid</methodname> helper operation is | ||
1762 | only called for modes detected by the device, and | ||
1763 | <emphasis>not</emphasis> for modes set by the user through the CRTC | ||
1764 | <methodname>set_config</methodname> operation. | ||
1765 | </para></note> | ||
1766 | </listitem> | ||
1767 | </itemizedlist> | ||
1768 | </sect2> | ||
1769 | <sect2> | ||
1770 | <title>Atomic Modeset Helper Functions Reference</title> | 1582 | <title>Atomic Modeset Helper Functions Reference</title> |
1771 | <sect3> | 1583 | <sect3> |
1772 | <title>Overview</title> | 1584 | <title>Overview</title> |
@@ -3625,41 +3437,63 @@ int num_ioctls;</synopsis> | |||
3625 | 3437 | ||
3626 | <chapter id="modes_of_use"> | 3438 | <chapter id="modes_of_use"> |
3627 | <title>Modes of Use</title> | 3439 | <title>Modes of Use</title> |
3628 | <sect1> | 3440 | <sect1> |
3629 | <title>Manual switching and manual power control</title> | 3441 | <title>Manual switching and manual power control</title> |
3630 | !Pdrivers/gpu/vga/vga_switcheroo.c Manual switching and manual power control | 3442 | !Pdrivers/gpu/vga/vga_switcheroo.c Manual switching and manual power control |
3631 | </sect1> | 3443 | </sect1> |
3632 | <sect1> | 3444 | <sect1> |
3633 | <title>Driver power control</title> | 3445 | <title>Driver power control</title> |
3634 | !Pdrivers/gpu/vga/vga_switcheroo.c Driver power control | 3446 | !Pdrivers/gpu/vga/vga_switcheroo.c Driver power control |
3635 | </sect1> | 3447 | </sect1> |
3636 | </chapter> | 3448 | </chapter> |
3637 | 3449 | ||
3638 | <chapter id="pubfunctions"> | 3450 | <chapter id="api"> |
3639 | <title>Public functions</title> | 3451 | <title>API</title> |
3452 | <sect1> | ||
3453 | <title>Public functions</title> | ||
3640 | !Edrivers/gpu/vga/vga_switcheroo.c | 3454 | !Edrivers/gpu/vga/vga_switcheroo.c |
3641 | </chapter> | 3455 | </sect1> |
3642 | 3456 | <sect1> | |
3643 | <chapter id="pubstructures"> | 3457 | <title>Public structures</title> |
3644 | <title>Public structures</title> | ||
3645 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_handler | 3458 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_handler |
3646 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_client_ops | 3459 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_client_ops |
3647 | </chapter> | 3460 | </sect1> |
3648 | 3461 | <sect1> | |
3649 | <chapter id="pubconstants"> | 3462 | <title>Public constants</title> |
3650 | <title>Public constants</title> | ||
3651 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_client_id | 3463 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_client_id |
3652 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_state | 3464 | !Finclude/linux/vga_switcheroo.h vga_switcheroo_state |
3653 | </chapter> | 3465 | </sect1> |
3654 | 3466 | <sect1> | |
3655 | <chapter id="privstructures"> | 3467 | <title>Private structures</title> |
3656 | <title>Private structures</title> | ||
3657 | !Fdrivers/gpu/vga/vga_switcheroo.c vgasr_priv | 3468 | !Fdrivers/gpu/vga/vga_switcheroo.c vgasr_priv |
3658 | !Fdrivers/gpu/vga/vga_switcheroo.c vga_switcheroo_client | 3469 | !Fdrivers/gpu/vga/vga_switcheroo.c vga_switcheroo_client |
3470 | </sect1> | ||
3471 | </chapter> | ||
3472 | |||
3473 | <chapter id="handlers"> | ||
3474 | <title>Handlers</title> | ||
3475 | <sect1> | ||
3476 | <title>apple-gmux Handler</title> | ||
3477 | !Pdrivers/platform/x86/apple-gmux.c Overview | ||
3478 | !Pdrivers/platform/x86/apple-gmux.c Interrupt | ||
3479 | <sect2> | ||
3480 | <title>Graphics mux</title> | ||
3481 | !Pdrivers/platform/x86/apple-gmux.c Graphics mux | ||
3482 | </sect2> | ||
3483 | <sect2> | ||
3484 | <title>Power control</title> | ||
3485 | !Pdrivers/platform/x86/apple-gmux.c Power control | ||
3486 | </sect2> | ||
3487 | <sect2> | ||
3488 | <title>Backlight control</title> | ||
3489 | !Pdrivers/platform/x86/apple-gmux.c Backlight control | ||
3490 | </sect2> | ||
3491 | </sect1> | ||
3659 | </chapter> | 3492 | </chapter> |
3660 | 3493 | ||
3661 | !Cdrivers/gpu/vga/vga_switcheroo.c | 3494 | !Cdrivers/gpu/vga/vga_switcheroo.c |
3662 | !Cinclude/linux/vga_switcheroo.h | 3495 | !Cinclude/linux/vga_switcheroo.h |
3496 | !Cdrivers/platform/x86/apple-gmux.c | ||
3663 | </part> | 3497 | </part> |
3664 | 3498 | ||
3665 | </book> | 3499 | </book> |