summaryrefslogtreecommitdiffstats
path: root/include/drm/ttm
diff options
context:
space:
mode:
authorLauri Kasanen <cand@gmx.com>2014-04-02 20:03:57 +0300
committerDave Airlie <airlied@redhat.com>2014-04-04 09:28:14 +1000
commit62347f9e0f81d50e9b0923ec8a192f60ab7a1801 (patch)
treeb7d6db268abfe08ff52742a47902474877bfa0a4 /include/drm/ttm
parent2614dc66837c2a6fd0e14e3f8e72343782c8b784 (diff)
downloadtalos-obmc-linux-62347f9e0f81d50e9b0923ec8a192f60ab7a1801.tar.gz
talos-obmc-linux-62347f9e0f81d50e9b0923ec8a192f60ab7a1801.zip
drm: Add support for two-ended allocation, v3
Clients like i915 need to segregate cache domains within the GTT which can lead to small amounts of fragmentation. By allocating the uncached buffers from the bottom and the cacheable buffers from the top, we can reduce the amount of wasted space and also optimize allocation of the mappable portion of the GTT to only those buffers that require CPU access through the GTT. For other drivers, allocating small bos from one end and large ones from the other helps improve the quality of fragmentation. Based on drm_mm work by Chris Wilson. v3: Changed to use a TTM placement flag v2: Updated kerneldoc Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Christian König <deathsimple@vodafone.de> Signed-off-by: Lauri Kasanen <cand@gmx.com> Signed-off-by: David Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/ttm')
-rw-r--r--include/drm/ttm/ttm_placement.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
index c84ff153a564..8ed44f9bbdfb 100644
--- a/include/drm/ttm/ttm_placement.h
+++ b/include/drm/ttm/ttm_placement.h
@@ -65,6 +65,8 @@
* reference the buffer.
* TTM_PL_FLAG_NO_EVICT means that the buffer may never
* be evicted to make room for other buffers.
+ * TTM_PL_FLAG_TOPDOWN requests to be placed from the
+ * top of the memory area, instead of the bottom.
*/
#define TTM_PL_FLAG_CACHED (1 << 16)
@@ -72,6 +74,7 @@
#define TTM_PL_FLAG_WC (1 << 18)
#define TTM_PL_FLAG_SHARED (1 << 20)
#define TTM_PL_FLAG_NO_EVICT (1 << 21)
+#define TTM_PL_FLAG_TOPDOWN (1 << 22)
#define TTM_PL_MASK_CACHING (TTM_PL_FLAG_CACHED | \
TTM_PL_FLAG_UNCACHED | \
OpenPOWER on IntegriCloud