linux/Documentation/DocBook
David Herrmann fe3078fa5c drm: add unified vma offset manager
If we want to map GPU memory into user-space, we need to linearize the
addresses to not confuse mm-core. Currently, GEM and TTM both implement
their own offset-managers to assign a pgoff to each object for user-space
CPU access. GEM uses a hash-table, TTM uses an rbtree.

This patch provides a unified implementation that can be used to replace
both. TTM allows partial mmaps with a given offset, so we cannot use
hashtables as the start address may not be known at mmap time. Hence, we
use the rbtree-implementation of TTM.

We could easily update drm_mm to use an rbtree instead of a linked list
for it's object list and thus drop the rbtree from the vma-manager.
However, this would slow down drm_mm object allocation for all other
use-cases (rbtree insertion) and add another 4-8 bytes to each mm node.
Hence, use the separate tree but allow for later migration.

This is a rewrite of the 2012-proposal by David Airlie <airlied@linux.ie>

v2:
 - fix Docbook integration
 - drop drm_mm_node_linked() and use drm_mm_node_allocated()
 - remove unjustified likely/unlikely usage (but keep for rbtree paths)
 - remove BUG_ON() as drm_mm already does that
 - clarify page-based vs. byte-based addresses
 - use drm_vma_node_reset() for initialization, too
v4:
 - allow external locking via drm_vma_offset_un/lock_lookup()
 - add locked lookup helper drm_vma_offset_lookup_locked()
v5:
 - fix drm_vma_offset_lookup() to correctly validate range-mismatches
   (fix (offset > start + pages))
 - fix drm_vma_offset_exact_lookup() to actually do what it says
 - remove redundant vm_pages member (add drm_vma_node_size() helper)
 - remove unneeded goto
 - fix documentation

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-07-25 20:47:04 +10:00
..
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-07-13 12:09:57 -07:00
.gitignore [media] DocBook: Add a chapter to describe media errors 2011-07-27 17:53:35 -03:00
80211.tmpl wireless: fix kernel-doc 2013-06-05 09:33:32 +02:00
alsa-driver-api.tmpl
debugobjects.tmpl debugobjects: Extend to assert that an object is initialized 2011-11-23 18:49:22 +01:00
device-drivers.tmpl Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-07-09 16:04:31 -07:00
deviceiobook.tmpl docbook: change iomap source filename in deviceiobook 2012-01-23 08:44:54 -08:00
drm.tmpl drm: add unified vma offset manager 2013-07-25 20:47:04 +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: Add the generic chip to the genirq docbook 2013-06-28 12:56:04 +02:00
kernel-api.tmpl kstrto*: add documentation 2012-12-17 17:15:22 -08:00
kernel-hacking.tmpl Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-02-21 17:40:58 -08:00
kernel-locking.tmpl docbook: add futexes to kernel-locking docbook 2013-07-03 16:08:01 -07:00
kgdb.tmpl Documentation: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:38:03 -08:00
libata.tmpl Documentation: Fix typo in multiple files in Documentation 2012-04-16 14:37:13 +02:00
librs.tmpl
lsm.tmpl
Makefile MCA: delete all remaining traces of microchannel bus support. 2012-05-17 19:06:13 -04:00
media_api.tmpl [media] soc_camera: Add RGB666 & RGB888 formats 2013-04-04 19:40:08 -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
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 uio-howto: example bug 2013-01-17 10:19:51 -08:00
usb.tmpl Fix common misspellings 2011-03-31 11:26:23 -03:00
writing_usb_driver.tmpl doc: fix misspellings with 'codespell' tool 2013-05-28 12:02:12 +02:00
writing-an-alsa-driver.tmpl ALSA: Make snd_BUG_ON() always evaluate and return the conditional expression 2013-03-11 09:33:34 +01:00
z8530book.tmpl