diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-12-22 09:36:37 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-28 13:30:24 +0100 |
commit | 3f85fb3462dc1c87a9353eb38714468d46248b2e (patch) | |
tree | 0b992d89057a98e2c10452db13f4ad439bb8f074 /drivers/gpu/drm/drm_mm.c | |
parent | drm: Apply tight eviction scanning to color_adjust (diff) | |
download | linux-3f85fb3462dc1c87a9353eb38714468d46248b2e.tar.xz 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 'drivers/gpu/drm/drm_mm.c')
-rw-r--r-- | drivers/gpu/drm/drm_mm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index b59978fe4c6e..c0024719f32b 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -323,7 +323,7 @@ int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node) } hole = list_last_entry(&hole->node_list, typeof(*hole), node_list); - if (!hole->hole_follows) + if (!drm_mm_hole_follows(hole)) return -ENOSPC; adj_start = hole_start = __drm_mm_hole_node_start(hole); @@ -408,7 +408,7 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node, u64 adj_start = hole_start; u64 adj_end = hole_end; - DRM_MM_BUG_ON(!hole_node->hole_follows || node->allocated); + DRM_MM_BUG_ON(!drm_mm_hole_follows(hole_node) || node->allocated); if (adj_start < start) adj_start = start; @@ -523,16 +523,16 @@ void drm_mm_remove_node(struct drm_mm_node *node) prev_node = list_entry(node->node_list.prev, struct drm_mm_node, node_list); - if (node->hole_follows) { + if (drm_mm_hole_follows(node)) { DRM_MM_BUG_ON(__drm_mm_hole_node_start(node) == __drm_mm_hole_node_end(node)); list_del(&node->hole_stack); - } else + } else { DRM_MM_BUG_ON(__drm_mm_hole_node_start(node) != __drm_mm_hole_node_end(node)); + } - - if (!prev_node->hole_follows) { + if (!drm_mm_hole_follows(prev_node)) { prev_node->hole_follows = 1; list_add(&prev_node->hole_stack, &mm->hole_stack); } else |