summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-22 11:36:37 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-28 15:30:24 +0300
commit3f85fb3462dc1c87a9353eb38714468d46248b2e (patch)
tree0b992d89057a98e2c10452db13f4ad439bb8f074 /include
parent3fa489dabea9a1cb0656e2da90354f7c4e53f890 (diff)
downloadlinux-3f85fb3462dc1c87a9353eb38714468d46248b2e.tar.xz
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')
-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.