summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/selftests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-22 11:36:33 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-28 13:50:55 +0300
commit0b04d474a611e2831d142e246422a03a10998ae1 (patch)
tree7a5f68b8621326acf4ecc5809dea5d3300326e80 /drivers/gpu/drm/selftests
parent268c6498fba2f6555d215408ae4de3ca1a08fb77 (diff)
downloadlinux-0b04d474a611e2831d142e246422a03a10998ae1.tar.xz
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 'drivers/gpu/drm/selftests')
-rw-r--r--drivers/gpu/drm/selftests/test-drm_mm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c
index 997f2bc93b9b..1bbfc24342c5 100644
--- a/drivers/gpu/drm/selftests/test-drm_mm.c
+++ b/drivers/gpu/drm/selftests/test-drm_mm.c
@@ -1199,7 +1199,7 @@ static bool evict_nothing(struct drm_mm *mm,
struct drm_mm_node *node;
unsigned int n;
- drm_mm_scan_init(&scan, mm, 1, 0, 0);
+ drm_mm_scan_init(&scan, mm, 1, 0, 0, 0);
for (n = 0; n < total_size; n++) {
e = &nodes[n];
list_add(&e->link, &evict_list);
@@ -1246,7 +1246,7 @@ static bool evict_everything(struct drm_mm *mm,
unsigned int n;
int err;
- drm_mm_scan_init(&scan, mm, total_size, 0, 0);
+ drm_mm_scan_init(&scan, mm, total_size, 0, 0, 0);
for (n = 0; n < total_size; n++) {
e = &nodes[n];
list_add(&e->link, &evict_list);
@@ -1296,7 +1296,8 @@ static int evict_something(struct drm_mm *mm,
drm_mm_scan_init_with_range(&scan, mm,
size, alignment, 0,
- range_start, range_end);
+ range_start, range_end,
+ mode->create_flags);
if (!evict_nodes(&scan,
nodes, order, count,
&evict_list))
@@ -1874,7 +1875,8 @@ static int evict_color(struct drm_mm *mm,
drm_mm_scan_init_with_range(&scan, mm,
size, alignment, color,
- range_start, range_end);
+ range_start, range_end,
+ mode->create_flags);
if (!evict_nodes(&scan,
nodes, order, count,
&evict_list))