linux/Documentation/DocBook
Aaron Plattner 89177644a7 drm: add prime helpers
Instead of reimplementing all of the dma_buf functionality in every driver,
create helpers drm_prime_import and drm_prime_export that implement them in
terms of new, lower-level hook functions:

  gem_prime_pin: callback when a buffer is created, used to pin buffers into GTT
  gem_prime_get_sg_table: convert a drm_gem_object to an sg_table for export
  gem_prime_import_sg_table: convert an sg_table into a drm_gem_object
  gem_prime_vmap, gem_prime_vunmap: map and unmap an object

These hooks are optional; drivers can opt in by using drm_gem_prime_import and
drm_gem_prime_export as the .gem_prime_import and .gem_prime_export fields of
struct drm_driver.

v2:
- Drop .begin_cpu_access.  None of the drivers this code replaces implemented
  it.  Having it here was a leftover from when I was trying to include i915 in
  this rework.
- Use mutex_lock instead of mutex_lock_interruptible, as these three drivers
  did.  This patch series shouldn't change that behavior.
- Rename helpers to gem_prime_get_sg_table and gem_prime_import_sg_table.
  Rename struct sg_table* variables to 'sgt' for clarity.
- Update drm.tmpl for these new hooks.

v3:
- Pass the vaddr down to the driver.  This lets drivers that just call vunmap on
  the pointer avoid having to store the pointer in their GEM private structures.
- Move documentation into a /** DOC */ comment in drm_prime.c and include it in
  drm.tmpl with a !P line.  I tried to use !F lines to include documentation of
  the individual functions from drmP.h, but the docproc / kernel-doc scripts
  barf on that file, so hopefully this is good enough for now.
- apply refcount fix from commit be8a42ae60
  ("drm/prime: drop reference on imported dma-buf come from gem")

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-02-08 13:39:08 +10:00
..
media Documentation: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
.gitignore [media] DocBook: Add a chapter to describe media errors 2011-07-27 17:53:35 -03:00
80211.tmpl mac80211: remove ieee80211_key_removed 2012-07-09 14:49:15 +02:00
Makefile MCA: delete all remaining traces of microchannel bus support. 2012-05-17 19:06:13 -04:00
alsa-driver-api.tmpl ALSA: Move ALSA docbooks to be with the rest of the kernel docbooks 2009-03-09 15:22:59 +01:00
debugobjects.tmpl debugobjects: Extend to assert that an object is initialized 2011-11-23 18:49:22 +01:00
device-drivers.tmpl Merge branch 'for-next' of git://gitorious.org/kernel-hsi/kernel-hsi 2012-04-02 09:50:40 -07:00
deviceiobook.tmpl docbook: change iomap source filename in deviceiobook 2012-01-23 08:44:54 -08:00
drm.tmpl drm: add prime helpers 2013-02-08 13:39:08 +10:00
filesystems.tmpl Documentation: get rid of write_super 2012-08-04 01:25:20 +04:00
gadget.tmpl usb: gadget: Remove File-backed Storage Gadget (g_file_storage). 2012-11-08 16:01:04 +02:00
genericirq.tmpl genirq: Update DocBook comments 2011-04-23 15:56:23 +02:00
kernel-api.tmpl kstrto*: add documentation 2012-12-17 17:15:22 -08:00
kernel-hacking.tmpl Documentation: Fix typo in multiple files in Documentation 2012-04-16 14:37:13 +02:00
kernel-locking.tmpl Fix common misspellings 2011-03-31 11:26:23 -03:00
kgdb.tmpl kgdb,debug_core: add the ability to control the reboot notifier 2012-03-22 15:07:16 -05:00
libata.tmpl Documentation: Fix typo in multiple files in Documentation 2012-04-16 14:37:13 +02:00
librs.tmpl
lsm.tmpl
media_api.tmpl [media] DocBook: various version/copyright year updates 2012-08-11 16:13:24 -03:00
mtdnand.tmpl mtd: nand: remove NAND_BBT_SEARCH option 2012-07-06 18:17:04 +01:00
networking.tmpl docbook: networking: fix file paths for uapi headers 2012-10-15 08:04:41 -07:00
rapidio.tmpl docbook: fix rapidio warning 2011-03-27 19:30:19 -07:00
regulator.tmpl Fix common misspellings 2011-03-31 11:26:23 -03:00
s390-drivers.tmpl docbook: fix s390 fatal error after header files moved 2008-08-05 16:56:29 -07:00
scsi.tmpl Documentation: update broken web addresses. 2010-08-04 15:21:40 +02:00
sh.tmpl sh: clkfwk: Kill off unused clk_set_rate_ex(). 2010-11-15 18:25:12 +09:00
stylesheet.xsl docbook: use IDs as filenames to support multiple books 2010-08-05 13:21:24 -07:00
tracepoint.tmpl workqueue: Add a workqueue chapter to the tracepoint docbook 2010-08-27 12:27:36 +02:00
uio-howto.tmpl drivers: uio_dmem_genirq: Don't use DMA_ERROR_CODE to indicate unmapped regions 2012-11-21 13:44:10 -08:00
usb.tmpl Fix common misspellings 2011-03-31 11:26:23 -03:00
writing-an-alsa-driver.tmpl ALSA: DocBook: Remove the description of __dev* 2012-12-07 07:53:38 +01:00
writing_usb_driver.tmpl USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
z8530book.tmpl Rationalise Randy's address a bit 2008-10-30 11:38:47 -07:00