diff options
| author | Dave Airlie <airlied@redhat.com> | 2014-03-18 05:09:10 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2014-03-18 05:09:10 -0400 |
| commit | 978c6050165bba52eab7ef3581d447eb215def77 (patch) | |
| tree | f34ccf67a789fe7e8ec88b054b33a6c2e688fdf7 | |
| parent | 8ad2bc9796994ecba9f4ba2fc9abca27ee9d193d (diff) | |
| parent | fc1645ac826c82ebad4402aabbf65595b671ecca (diff) | |
Merge branch 'drm-docs' of ssh://people.freedesktop.org/~danvet/drm into drm-next
Here's my drm documentation update and driver api polish pull request.
Alex reviewed the entire pile, I've applied a little bit of spelling
polish in a few places since then and otherwise the Usual Suspects (David,
Rob, ...) don't seem up to have another look at it (I've poked them on
irc). So I think it's as good as it gets ;-)
Note that I've dropped the final imx breaker patch since that's blocked on
imx getting sane. Once that's landed I'll ping you to pick up that
straggler.
* 'drm-docs' of ssh://people.freedesktop.org/~danvet/drm: (34 commits)
drm/imx: remove drm_mode_connector_detach_encoder harder
drm: kerneldoc polish for drm_crtc.c
drm: kerneldoc polish for drm_crtc_helper.c
drm: drop error code for drm_helper_resume_force_mode
drm/crtc-helper: remove LOCKING from kerneldoc
drm: remove return value from drm_helper_mode_fill_fb_struct
drm/doc: Fix misplaced </para>
drm: remove drm_display_mode->private_size
drm: polish function kerneldoc for drm_modes.[hc]
drm/modes: drop maxPitch from drm_mode_validate_size
drm/modes: drop return value from drm_display_mode_from_videomode
drm/modes: remove drm_mode_height/width
drm: extract drm_modes.h for drm_crtc.h functions
drm: move drm_mode related functions into drm_modes.c
drm/doc: Repleace LOCKING kerneldoc sections in drm_modes.c
drm/doc: Integrate drm_modes.c kerneldoc
drm/kms: rip out drm_mode_connector_detach_encoder
drm/doc: Add function reference documentation for drm_mm.c
drm/doc: Overview documentation for drm_mm.c
drm/mm: Remove MM_UNUSED_TARGET
...
| -rw-r--r-- | Documentation/DocBook/drm.tmpl | 500 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 697 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 193 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_crtc_internal.h | 38 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_edid.c | 30 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_gem.c | 63 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_mm.c | 211 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_modes.c | 346 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_prime.c | 110 | ||||
| -rw-r--r-- | drivers/staging/imx-drm/imx-hdmi.c | 1 | ||||
| -rw-r--r-- | drivers/staging/imx-drm/imx-ldb.c | 2 | ||||
| -rw-r--r-- | drivers/staging/imx-drm/imx-tve.c | 2 | ||||
| -rw-r--r-- | drivers/staging/imx-drm/parallel-display.c | 2 | ||||
| -rw-r--r-- | include/drm/drmP.h | 29 | ||||
| -rw-r--r-- | include/drm/drm_crtc.h | 174 | ||||
| -rw-r--r-- | include/drm/drm_crtc_helper.h | 6 | ||||
| -rw-r--r-- | include/drm/drm_mm.h | 154 | ||||
| -rw-r--r-- | include/drm/drm_modes.h | 237 | ||||
| -rw-r--r-- | include/linux/hdmi.h | 12 |
20 files changed, 2013 insertions, 798 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index ed1d6d289022..9f5457ac0373 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
| @@ -29,12 +29,26 @@ | |||
| 29 | </address> | 29 | </address> |
| 30 | </affiliation> | 30 | </affiliation> |
| 31 | </author> | 31 | </author> |
| 32 | <author> | ||
| 33 | <firstname>Daniel</firstname> | ||
| 34 | <surname>Vetter</surname> | ||
| 35 | <contrib>Contributions all over the place</contrib> | ||
| 36 | <affiliation> | ||
| 37 | <orgname>Intel Corporation</orgname> | ||
| 38 | <address> | ||
| 39 | <email>daniel.vetter@ffwll.ch</email> | ||
| 40 | </address> | ||
| 41 | </affiliation> | ||
| 42 | </author> | ||
| 32 | </authorgroup> | 43 | </authorgroup> |
| 33 | 44 | ||
| 34 | <copyright> | 45 | <copyright> |
| 35 | <year>2008-2009</year> | 46 | <year>2008-2009</year> |
| 36 | <year>2012</year> | 47 | <year>2013-2014</year> |
| 37 | <holder>Intel Corporation</holder> | 48 | <holder>Intel Corporation</holder> |
| 49 | </copyright> | ||
| 50 | <copyright> | ||
| 51 | <year>2012</year> | ||
| 38 | <holder>Laurent Pinchart</holder> | 52 | <holder>Laurent Pinchart</holder> |
| 39 | </copyright> | 53 | </copyright> |
| 40 | 54 | ||
| @@ -60,7 +74,15 @@ | |||
| 60 | 74 | ||
| 61 | <toc></toc> | 75 | <toc></toc> |
| 62 | 76 | ||
| 63 | <!-- Introduction --> | 77 | <part id="drmCore"> |
| 78 | <title>DRM Core</title> | ||
| 79 | <partintro> | ||
| 80 | <para> | ||
| 81 | This first part of the DRM Developer's Guide documents core DRM code, | ||
| 82 | helper libraries for writting drivers and generic userspace interfaces | ||
| 83 | exposed by DRM drivers. | ||
| 84 | </para> | ||
| 85 | </partintro> | ||
| 64 | 86 | ||
| 65 | <chapter id="drmIntroduction"> | 87 | <chapter id="drmIntroduction"> |
| 66 | <title>Introduction</title> | 88 | <title>Introduction</title> |
| @@ -264,8 +286,8 @@ char *date;</synopsis> | |||
| 264 | <para> | 286 | <para> |
| 265 | The <methodname>load</methodname> method is the driver and device | 287 | The <methodname>load</methodname> method is the driver and device |
| 266 | initialization entry point. The method is responsible for allocating and | 288 | initialization entry point. The method is responsible for allocating and |
| 267 | initializing driver private data, specifying supported performance | 289 | initializing driver private data, performing resource allocation and |
| 268 | counters, performing resource allocation and mapping (e.g. acquiring | 290 | mapping (e.g. acquiring |
| 269 | clocks, mapping registers or allocating command buffers), initializing | 291 | clocks, mapping registers or allocating command buffers), initializing |
| 270 | the memory manager (<xref linkend="drm-memory-management"/>), installing | 292 | the memory manager (<xref linkend="drm-memory-management"/>), installing |
| 271 | the IRQ handler (<xref linkend="drm-irq-registration"/>), setting up | 293 | the IRQ handler (<xref linkend="drm-irq-registration"/>), setting up |
| @@ -295,7 +317,7 @@ char *date;</synopsis> | |||
| 295 | their <methodname>load</methodname> method called with flags to 0. | 317 | their <methodname>load</methodname> method called with flags to 0. |
| 296 | </para> | 318 | </para> |
| 297 | <sect3> | 319 | <sect3> |
| 298 | <title>Driver Private & Performance Counters</title> | 320 | <title>Driver Private Data</title> |
| 299 | <para> | 321 | <para> |
| 300 | The driver private hangs off the main | 322 | The driver private hangs off the main |
| 301 | <structname>drm_device</structname> structure and can be used for | 323 | <structname>drm_device</structname> structure and can be used for |
| @@ -307,14 +329,6 @@ char *date;</synopsis> | |||
| 307 | <structname>drm_device</structname>.<structfield>dev_priv</structfield> | 329 | <structname>drm_device</structname>.<structfield>dev_priv</structfield> |
| 308 | set to NULL when the driver is unloaded. | 330 | set to NULL when the driver is unloaded. |
| 309 | </para> | 331 | </para> |
| 310 | <para> | ||
| 311 | DRM supports several counters which were used for rough performance | ||
| 312 | characterization. This stat counter system is deprecated and should not | ||
| 313 | be used. If performance monitoring is desired, the developer should | ||
| 314 | investigate and potentially enhance the kernel perf and tracing | ||
| 315 | infrastructure to export GPU related performance information for | ||
| 316 | consumption by performance monitoring tools and applications. | ||
| 317 | </para> | ||
| 318 | </sect3> | 332 | </sect3> |
| 319 | <sect3 id="drm-irq-registration"> | 333 | <sect3 id="drm-irq-registration"> |
| 320 | <title>IRQ Registration</title> | 334 | <title>IRQ Registration</title> |
| @@ -697,55 +711,16 @@ char *date;</synopsis> | |||
| 697 | respectively. The conversion is handled by the DRM core without any | 711 | respectively. The conversion is handled by the DRM core without any |
| 698 | driver-specific support. | 712 | driver-specific support. |
| 699 | </para> | 713 | </para> |
| 700 | <para> | 714 | <para> |
| 701 | Similar to global names, GEM file descriptors are also used to share GEM | 715 | GEM also supports buffer sharing with dma-buf file descriptors through |
| 702 | objects across processes. They offer additional security: as file | 716 | PRIME. GEM-based drivers must use the provided helpers functions to |
| 703 | descriptors must be explicitly sent over UNIX domain sockets to be shared | 717 | implement the exporting and importing correctly. See <xref linkend="drm-prime-support" />. |
| 704 | between applications, they can't be guessed like the globally unique GEM | 718 | Since sharing file descriptors is inherently more secure than the |
| 705 | names. | 719 | easily guessable and global GEM names it is the preferred buffer |
| 706 | </para> | 720 | sharing mechanism. Sharing buffers through GEM names is only supported |
| 707 | <para> | 721 | for legacy userspace. Furthermore PRIME also allows cross-device |
| 708 | Drivers that support GEM file descriptors, also known as the DRM PRIME | 722 | buffer sharing since it is based on dma-bufs. |
| 709 | API, must set the DRIVER_PRIME bit in the struct | 723 | </para> |
| 710 | <structname>drm_driver</structname> | ||
| 711 | <structfield>driver_features</structfield> field, and implement the | ||
| 712 | <methodname>prime_handle_to_fd</methodname> and | ||
| 713 | <methodname>prime_fd_to_handle</methodname> operations. | ||
| 714 | </para> | ||
| 715 | <para> | ||
| 716 | <synopsis>int (*prime_handle_to_fd)(struct drm_device *dev, | ||
| 717 | struct drm_file *file_priv, uint32_t handle, | ||
| 718 | uint32_t flags, int *prime_fd); | ||
| 719 | int (*prime_fd_to_handle)(struct drm_device *dev, | ||
| 720 | struct drm_file *file_priv, int prime_fd, | ||
| 721 | uint32_t *handle);</synopsis> | ||
| 722 | Those two operations convert a handle to a PRIME file descriptor and | ||
| 723 | vice versa. Drivers must use the kernel dma-buf buffer sharing framework | ||
| 724 | to manage the PRIME file descriptors. | ||
| 725 | </para> | ||
| 726 | <para> | ||
| 727 | While non-GEM drivers must implement the operations themselves, GEM | ||
| 728 | drivers must use the <function>drm_gem_prime_handle_to_fd</function> | ||
| 729 | and <function>drm_gem_prime_fd_to_handle</function> helper functions. | ||
| 730 | Those helpers rely on the driver | ||
| 731 | <methodname>gem_prime_export</methodname> and | ||
| 732 | <methodname>gem_prime_import</methodname> operations to create a dma-buf | ||
| 733 | instance from a GEM object (dma-buf exporter role) and to create a GEM | ||
| 734 | object from a dma-buf instance (dma-buf importer role). | ||
| 735 | </para> | ||
| 736 | <para> | ||
| 737 | <synopsis>struct dma_buf * (*gem_prime_export)(struct drm_device *dev, | ||
| 738 | struct drm_gem_object *obj, | ||
