summaryrefslogtreecommitdiff
path: root/include/drm/drm_mm.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-22 08:36:33 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-28 11:50:55 +0100
commit0b04d474a611e2831d142e246422a03a10998ae1 (patch)
tree7a5f68b8621326acf4ecc5809dea5d3300326e80 /include/drm/drm_mm.h
parent268c6498fba2f6555d215408ae4de3ca1a08fb77 (diff)
drm: Compute tight evictions for drm_mm_scan
Compute the minimal required hole during scan and only evict those nodes that overlap. This enables us to reduce the number of nodes we need to evict to the bare minimum. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161222083641.2691-31-chris@chris-wilson.co.uk
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r--include/drm/drm_mm.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index bae0f10da8e3..606336fc229a 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -120,6 +120,7 @@ struct drm_mm_scan {
struct drm_mm_node *prev_scanned_node;
unsigned long color;
+ unsigned int flags;
};
/**
@@ -388,11 +389,9 @@ __drm_mm_interval_first(const struct drm_mm *mm, u64 start, u64 last);
void drm_mm_scan_init_with_range(struct drm_mm_scan *scan,
struct drm_mm *mm,
- u64 size,
- u64 alignment,
- unsigned long color,
- u64 start,
- u64 end);
+ u64 size, u64 alignment, unsigned long color,
+ u64 start, u64 end,
+ unsigned int flags);
/**
* drm_mm_scan_init - initialize lru scanning
@@ -401,10 +400,10 @@ void drm_mm_scan_init_with_range(struct drm_mm_scan *scan,
* @size: size of the allocation
* @alignment: alignment of the allocation
* @color: opaque tag value to use for the allocation
+ * @flags: flags to specify how the allocation will be performed afterwards
*
* This simply sets up the scanning routines with the parameters for the desired
- * hole. Note that there's no need to specify allocation flags, since they only
- * change the place a node is allocated from within a suitable hole.
+ * hole.
*
* Warning:
* As long as the scan list is non-empty, no other operations than
@@ -414,10 +413,13 @@ static inline void drm_mm_scan_init(struct drm_mm_scan *scan,
struct drm_mm *mm,
u64 size,
u64 alignment,
- unsigned long color)
+ unsigned long color,
+ unsigned int flags)
{
- drm_mm_scan_init_with_range(scan, mm, size, alignment, color,
- 0, U64_MAX);
+ drm_mm_scan_init_with_range(scan, mm,
+ size, alignment, color,
+ 0, U64_MAX,
+ flags);
}
bool drm_mm_scan_add_block(struct drm_mm_scan *scan,