<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/drm/ttm, branch v3.4.96</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/include/drm/ttm?h=v3.4.96</id>
<link rel='self' href='https://git.amat.us/linux/atom/include/drm/ttm?h=v3.4.96'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-03-04T22:54:34Z</updated>
<entry>
<title>BUG: headers with BUG/BUG_ON etc. need linux/bug.h</title>
<updated>2012-03-04T22:54:34Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-11-24T01:12:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=187f1882b5b0748b3c4c22274663fdb372ac0452'/>
<id>urn:sha1:187f1882b5b0748b3c4c22274663fdb372ac0452</id>
<content type='text'>
If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
other BUG variant in a static inline (i.e. not in a #define) then
that header really should be including &lt;linux/bug.h&gt; and not just
expecting it to be implicitly present.

We can make this change risk-free, since if the files using these
headers didn't have exposure to linux/bug.h already, they would have
been causing compile failures/warnings.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>ttm: fix agp since ttm tt rework</title>
<updated>2012-01-06T09:34:03Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2012-01-03T22:37:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dea7e0ac45fd28f90bbc38ff226d36a9f788efbf'/>
<id>urn:sha1:dea7e0ac45fd28f90bbc38ff226d36a9f788efbf</id>
<content type='text'>
ttm tt rework modified the way we allocate and populate the
ttm_tt structure, the AGP side was missing some bit to properly
work. Fix those and fix radeon and nouveau AGP support.

Tested on radeon only so far.

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: simplify memory accounting for ttm user v2</title>
<updated>2011-12-06T10:40:11Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2011-11-11T20:42:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=57de4ba959b290f0b8cf36ecd5e7f1b29d4b8a12'/>
<id>urn:sha1:57de4ba959b290f0b8cf36ecd5e7f1b29d4b8a12</id>
<content type='text'>
Provide helper function to compute the kernel memory size needed
for each buffer object. Move all the accounting inside ttm, simplifying
driver and avoiding code duplication accross them.

v2 fix accounting of ghost object, one would have thought that i
   would have run into the issue since a longtime but it seems
   ghost object are rare when you have plenty of vram ;)

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: isolate dma data from ttm_tt V4</title>
<updated>2011-12-06T10:40:02Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2011-11-09T22:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8e7e70522d760c4ccd4cd370ebfa0ba69e006c6e'/>
<id>urn:sha1:8e7e70522d760c4ccd4cd370ebfa0ba69e006c6e</id>
<content type='text'>
Move dma data to a superset ttm_dma_tt structure which herit
from ttm_tt. This allow driver that don't use dma functionalities
to not have to waste memory for it.

V2 Rebase on top of no memory account changes (where/when is my
   delorean when i need it ?)
V3 Make sure page list is initialized empty
V4 typo/syntax fixes

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: provide dma aware ttm page pool code V9</title>
<updated>2011-12-06T10:39:33Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2011-11-03T20:46:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2334b75ffbef6b8932f09ec4418b65ddb764ae99'/>
<id>urn:sha1:2334b75ffbef6b8932f09ec4418b65ddb764ae99</id>
<content type='text'>
In TTM world the pages for the graphic drivers are kept in three different
pools: write combined, uncached, and cached (write-back). When the pages
are used by the graphic driver the graphic adapter via its built in MMU
(or AGP) programs these pages in. The programming requires the virtual address
(from the graphic adapter perspective) and the physical address (either System RAM
or the memory on the card) which is obtained using the pci_map_* calls (which does the
virtual to physical - or bus address translation). During the graphic application's
"life" those pages can be shuffled around, swapped out to disk, moved from the
VRAM to System RAM or vice-versa. This all works with the existing TTM pool code
- except when we want to use the software IOTLB (SWIOTLB) code to "map" the physical
addresses to the graphic adapter MMU. We end up programming the bounce buffer's
physical address instead of the TTM pool memory's and get a non-worky driver.
There are two solutions:
1) using the DMA API to allocate pages that are screened by the DMA API, or
2) using the pci_sync_* calls to copy the pages from the bounce-buffer and back.

This patch fixes the issue by allocating pages using the DMA API. The second
is a viable option - but it has performance drawbacks and potential correctness
issues - think of the write cache page being bounced (SWIOTLB-&gt;TTM), the
WC is set on the TTM page and the copy from SWIOTLB not making it to the TTM
page until the page has been recycled in the pool (and used by another application).

The bounce buffer does not get activated often - only in cases where we have
a 32-bit capable card and we want to use a page that is allocated above the
4GB limit. The bounce buffer offers the solution of copying the contents
of that 4GB page to an location below 4GB and then back when the operation has been
completed (or vice-versa). This is done by using the 'pci_sync_*' calls.
Note: If you look carefully enough in the existing TTM page pool code you will
notice the GFP_DMA32 flag is used  - which should guarantee that the provided page
is under 4GB. It certainly is the case, except this gets ignored in two cases:
 - If user specifies 'swiotlb=force' which bounces _every_ page.
 - If user is using a Xen's PV Linux guest (which uses the SWIOTLB and the
   underlaying PFN's aren't necessarily under 4GB).

To not have this extra copying done the other option is to allocate the pages
using the DMA API so that there is not need to map the page and perform the
expensive 'pci_sync_*' calls.

This DMA API capable TTM pool requires for this the 'struct device' to
properly call the DMA API. It also has to track the virtual and bus address of
the page being handed out in case it ends up being swapped out or de-allocated -
to make sure it is de-allocated using the proper's 'struct device'.

Implementation wise the code keeps two lists: one that is attached to the
'struct device' (via the dev-&gt;dma_pools list) and a global one to be used when
the 'struct device' is unavailable (think shrinker code). The global list can
iterate over all of the 'struct device' and its associated dma_pool. The list
in dev-&gt;dma_pools can only iterate the device's dma_pool.
                                                            /[struct device_pool]\
        /---------------------------------------------------| dev                |
       /                                            +-------| dma_pool           |
 /-----+------\                                    /        \--------------------/
 |struct device|     /--&gt;[struct dma_pool for WC]&lt;/         /[struct device_pool]\
 | dma_pools   +----+                                     /-| dev                |
 |  ...        |    \---&gt;[struct dma_pool for uncached]&lt;-/--| dma_pool           |
 \-----+------/                                         /   \--------------------/
        \----------------------------------------------/
[Two pools associated with the device (WC and UC), and the parallel list
containing the 'struct dev' and 'struct dma_pool' entries]

The maximum amount of dma pools a device can have is six: write-combined,
uncached, and cached; then there are the DMA32 variants which are:
write-combined dma32, uncached dma32, and cached dma32.

Currently this code only gets activated when any variant of the SWIOTLB IOMMU
code is running (Intel without VT-d, AMD without GART, IBM Calgary and Xen PV
with PCI devices).

Tested-by: Michel Dänzer &lt;michel@daenzer.net&gt;
[v1: Using swiotlb_nr_tbl instead of swiotlb_enabled]
[v2: Major overhaul - added 'inuse_list' to seperate used from inuse and reorder
the order of lists to get better performance.]
[v3: Added comments/and some logic based on review, Added Jerome tag]
[v4: rebase on top of ttm_tt &amp; ttm_backend merge]
[v5: rebase on top of ttm memory accounting overhaul]
[v6: New rebase on top of more memory accouting changes]
[v7: well rebase on top of no memory accounting changes]
[v8: make sure pages list is initialized empty]
[v9: calll ttm_mem_global_free_page in unpopulate for accurate accountg]
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Acked-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: introduce callback for ttm_tt populate &amp; unpopulate V4</title>
<updated>2011-12-06T10:39:24Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2011-11-03T03:59:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b1e5f172325547270f35e7d1e42416a606e1dbd2'/>
<id>urn:sha1:b1e5f172325547270f35e7d1e42416a606e1dbd2</id>
<content type='text'>
Move the page allocation and freeing to driver callback and
provide ttm code helper function for those.

Most intrusive change, is the fact that we now only fully
populate an object this simplify some of code designed around
the page fault design.

V2 Rebase on top of memory accounting overhaul
V3 New rebase on top of more memory accouting changes
V4 Rebase on top of no memory account changes (where/when is my
   delorean when i need it ?)

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: merge ttm_backend and ttm_tt V5</title>
<updated>2011-12-06T10:39:17Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2011-11-02T00:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=649bf3ca77343e3be1e0af8e21356fa569b1abd9'/>
<id>urn:sha1:649bf3ca77343e3be1e0af8e21356fa569b1abd9</id>
<content type='text'>
ttm_backend will only exist with a ttm_tt, and ttm_tt
will only be of interest when bound to a backend. Merge them
to avoid code and data duplication.

V2 Rebase on top of memory accounting overhaul
V3 Rebase on top of more memory accounting changes
V4 Rebase on top of no memory account changes (where/when is my
   delorean when i need it ?)
V5 make sure ttm is unbound before destroying, change commit
   message on suggestion from Tormod Volden

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: page allocation use page array instead of list</title>
<updated>2011-12-06T10:39:11Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2011-11-10T23:24:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=822c4d9ae0d55a4fcea9f0a462bc6406a06692e2'/>
<id>urn:sha1:822c4d9ae0d55a4fcea9f0a462bc6406a06692e2</id>
<content type='text'>
Use the ttm_tt pages array for pages allocations, move the list
unwinding into the page allocation functions.

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: remove unused backend flags field</title>
<updated>2011-12-06T10:38:48Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2011-11-01T21:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a14af87b0b6f5c1d44c1adaa07f1bd347f81dc04'/>
<id>urn:sha1:a14af87b0b6f5c1d44c1adaa07f1bd347f81dc04</id>
<content type='text'>
This field is not use by any of the driver just drop it.

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm/ttm: remove split btw highmen and lowmem page</title>
<updated>2011-12-06T10:38:36Z</updated>
<author>
<name>Jerome Glisse</name>
<email>jglisse@redhat.com</email>
</author>
<published>2011-11-01T19:57:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=667b7a27c221acaea844ba41f1c0a713aba44d31'/>
<id>urn:sha1:667b7a27c221acaea844ba41f1c0a713aba44d31</id>
<content type='text'>
Split btw highmem and lowmem page was rendered useless by the
pool code. Remove it. Note further cleanup would change the
ttm page allocation helper to actualy take an array instead
of relying on list this could drasticly reduce the number of
function call in the common case of allocation whole buffer.

Signed-off-by: Jerome Glisse &lt;jglisse@redhat.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
</content>
</entry>
</feed>
