drm: Introduce an iterator over holes in the drm_mm range manager
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 15 Nov 2012 11:32:17 +0000 (11:32 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 30 Nov 2012 22:20:54 +0000 (23:20 +0100)
commit9e8944ab564f2e3dde90a518cd32048c58918608
tree25a2dffcd1cfa8d01c50d03d8791817bafd05574
parent5973c7ee519e2a240c68b290a1836bdb25ed3701
drm: Introduce an iterator over holes in the drm_mm range manager

This will be used i915 in forthcoming patches in order to measure the
largest contiguous chunk of memory available for enabling chipset
features.

v2: Try to make the macro marginally safer and more readable by not
depending upon the drm_mm_hole_node_end() being non-zero. Note that we
need to open code list_for_each() in order to update the hole_start,
hole_end variable on each iteration and keep the macro sane.

v3: Tidy up few BUG_ONs that fell foul of adding additional tests to
drm_mm_hole_node_start().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_mm.c
include/drm/drm_mm.h