diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-07-27 07:36:27 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-08-06 20:08:58 -0400 |
commit | 31e5d7c67bd492fd0b2988440e21e31809c7c9af (patch) | |
tree | 833339e49a2d739068e92f01d2f47c5e9cc6d5d0 /drivers/gpu/drm/via | |
parent | 7fc65eb731cda8304865669166fb9a4c519bee69 (diff) |
drm/mm: add "best_match" flag to drm_mm_insert_node()
Add a "best_match" flag similar to the drm_mm_search_*() helpers so we
can convert TTM to use them in follow up patches. We can also inline the
non-generic helpers and move them into the header to allow compile-time
optimizations.
To make calls to drm_mm_{search,insert}_node() more readable, this
converts the boolean argument to a flagset. There are pending patches that
add additional flags for top-down allocators and more.
v2:
- use flag parameter instead of boolean "best_match"
- convert *_search_free() helpers to also use flags argument
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/via')
-rw-r--r-- | drivers/gpu/drm/via/via_mm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/via/via_mm.c b/drivers/gpu/drm/via/via_mm.c index 0ab93ff09873..7e3ad87c366c 100644 --- a/drivers/gpu/drm/via/via_mm.c +++ b/drivers/gpu/drm/via/via_mm.c | |||
@@ -140,11 +140,11 @@ int via_mem_alloc(struct drm_device *dev, void *data, | |||
140 | if (mem->type == VIA_MEM_AGP) | 140 | if (mem->type == VIA_MEM_AGP) |
141 | retval = drm_mm_insert_node(&dev_priv->agp_mm, | 141 | retval = drm_mm_insert_node(&dev_priv->agp_mm, |
142 | &item->mm_node, | 142 | &item->mm_node, |
143 | tmpSize, 0); | 143 | tmpSize, 0, DRM_MM_SEARCH_DEFAULT); |
144 | else | 144 | else |
145 | retval = drm_mm_insert_node(&dev_priv->vram_mm, | 145 | retval = drm_mm_insert_node(&dev_priv->vram_mm, |
146 | &item->mm_node, | 146 | &item->mm_node, |
147 | tmpSize, 0); | 147 | tmpSize, 0, DRM_MM_SEARCH_DEFAULT); |
148 | if (retval) | 148 | if (retval) |
149 | goto fail_alloc; | 149 | goto fail_alloc; |
150 | 150 | ||