aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/drm/drm_mm.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-22 08:36:37 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-28 13:30:24 +0100
commit3f85fb3462dc1c87a9353eb38714468d46248b2e (patch)
tree0b992d89057a98e2c10452db13f4ad439bb8f074 /include/drm/drm_mm.h
parentdrm: Apply tight eviction scanning to color_adjust (diff)
downloadwireguard-linux-3f85fb3462dc1c87a9353eb38714468d46248b2e.tar.xz
wireguard-linux-3f85fb3462dc1c87a9353eb38714468d46248b2e.zip
drm: Wrap drm_mm_node.hole_follows
Insulate users from changes to the internal hole tracking within struct drm_mm_node by using an accessor for hole_follows. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> [danvet: resolve conflicts in i915_vma.c] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r--include/drm/drm_mm.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index aed93cbc4bde..7da7a171d6d5 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -155,6 +155,22 @@ static inline bool drm_mm_initialized(const struct drm_mm *mm)
return mm->hole_stack.next;
}
+/**
+ * drm_mm_hole_follows - checks whether a hole follows this node
+ * @node: drm_mm_node to check
+ *
+ * Holes are embedded into the drm_mm using the tail of a drm_mm_node.
+ * If you wish to know whether a hole follows this particular node,
+ * query this function.
+ *
+ * Returns:
+ * True if a hole follows the @node.
+ */
+static inline bool drm_mm_hole_follows(const struct drm_mm_node *node)
+{
+ return node->hole_follows;
+}
+
static inline u64 __drm_mm_hole_node_start(const struct drm_mm_node *hole_node)
{
return hole_node->start + hole_node->size;
@@ -166,14 +182,14 @@ static inline u64 __drm_mm_hole_node_start(const struct drm_mm_node *hole_node)
*
* This is useful for driver-specific debug dumpers. Otherwise drivers should
* not inspect holes themselves. Drivers must check first whether a hole indeed
- * follows by looking at node->hole_follows.
+ * follows by looking at drm_mm_hole_follows()
*
* Returns:
* Start of the subsequent hole.
*/
static inline u64 drm_mm_hole_node_start(const struct drm_mm_node *hole_node)
{
- DRM_MM_BUG_ON(!hole_node->hole_follows);
+ DRM_MM_BUG_ON(!drm_mm_hole_follows(hole_node));
return __drm_mm_hole_node_start(hole_node);
}
@@ -188,7 +204,7 @@ static inline u64 __drm_mm_hole_node_end(const struct drm_mm_node *hole_node)
*
* This is useful for driver-specific debug dumpers. Otherwise drivers should
* not inspect holes themselves. Drivers must check first whether a hole indeed
- * follows by looking at node->hole_follows.
+ * follows by looking at drm_mm_hole_follows().
*
* Returns:
* End of the subsequent hole.