Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > fa21ac0b5c825597d4ae80018c3f2f25 > files > 1424

kernel-doc-2.6.38.6-26.rc1.fc15.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Memory management</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="Linux DRM Developer's Guide" /><link rel="up" href="drmInternals.html" title="Chapter&#160;2.&#160;DRM Internals" /><link rel="prev" href="ch02s03.html" title="VBlank event handling" /><link rel="next" href="ch02s05.html" title="Output management" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Memory management</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;2.&#160;DRM Internals</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch02s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Memory management"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2929328"></a>Memory management</h2></div></div></div><div class="toc"><dl><dt><span class="sect2"><a href="ch02s04.html#id2929341">The Translation Table Manager (TTM)</a></span></dt><dt><span class="sect2"><a href="ch02s04.html#id2929365">The Graphics Execution Manager (GEM)</a></span></dt></dl></div><p>
      The memory manager lies at the heart of many DRM operations, and
      is also required to support advanced client features like OpenGL
      pbuffers.  The DRM currently contains two memory managers, TTM
      and GEM.
    </p><div class="sect2" title="The Translation Table Manager (TTM)"><div class="titlepage"><div><div><h3 class="title"><a id="id2929341"></a>The Translation Table Manager (TTM)</h3></div></div></div><p>
	TTM was developed by Tungsten Graphics, primarily by Thomas
	Hellstr&#246;m, and is intended to be a flexible, high performance
	graphics memory manager.
      </p><p>
	Drivers wishing to support TTM must fill out a drm_bo_driver
	structure.
      </p><p>
	TTM design background and information belongs here.
      </p></div><div class="sect2" title="The Graphics Execution Manager (GEM)"><div class="titlepage"><div><div><h3 class="title"><a id="id2929365"></a>The Graphics Execution Manager (GEM)</h3></div></div></div><p>
	GEM is an Intel project, authored by Eric Anholt and Keith
	Packard.  It provides simpler interfaces than TTM, and is well
	suited for UMA devices.
      </p><p>
	GEM-enabled drivers must provide gem_init_object() and
	gem_free_object() callbacks to support the core memory
	allocation routines.  They should also provide several driver
	specific ioctls to support command execution, pinning, buffer
	read &amp; write, mapping, and domain ownership transfers.
      </p><p>
	On a fundamental level, GEM involves several operations: memory
	allocation and freeing, command execution, and aperture management
	at command execution time.  Buffer object allocation is relatively
	straightforward and largely provided by Linux's shmem layer, which
	provides memory to back each object.  When mapped into the GTT
	or used in a command buffer, the backing pages for an object are
	flushed to memory and marked write combined so as to be coherent
	with the GPU.  Likewise, when the GPU finishes rendering to an object,
	if the CPU accesses it, it must be made coherent with the CPU's view
	of memory, usually involving GPU cache flushing of various kinds.
	This core CPU&lt;-&gt;GPU coherency management is provided by the GEM
	set domain function, which evaluates an object's current domain and
	performs any necessary flushing or synchronization to put the object
	into the desired coherency domain (note that the object may be busy,
	i.e. an active render target; in that case the set domain function
	will block the client and wait for rendering to complete before
	performing any necessary flushing operations).
      </p><p>
	Perhaps the most important GEM function is providing a command
	execution interface to clients.  Client programs construct command
	buffers containing references to previously allocated memory objects
	and submit them to GEM.  At that point, GEM will take care to bind
	all the objects into the GTT, execute the buffer, and provide
	necessary synchronization between clients accessing the same buffers.
	This often involves evicting some objects from the GTT and re-binding
	others (a fairly expensive operation), and providing relocation
	support which hides fixed GTT offsets from clients.  Clients must
	take care not to submit command buffers that reference more objects
	than can fit in the GTT or GEM will reject them and no rendering
	will occur.  Similarly, if several objects in the buffer require
	fence registers to be allocated for correct rendering (e.g. 2D blits
	on pre-965 chips), care must be taken not to require more fence
	registers than are available to the client.  Such resource management
	should be abstracted from the client in libdrm.
      </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="drmInternals.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch02s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">VBlank event handling&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Output management</td></tr></table></div></body></html>