diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-03 22:00:59 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-04 13:43:13 +0100 |
commit | 4ee92c7149da9cb1991684628a9e47166a5e26f6 (patch) | |
tree | fb2ef8434e43ceaeaa4f6f9cda0cd31b5044b1c2 /include/drm/drm_mm.h | |
parent | 71724f708997595919cb1e75c5e48916c8846d2e (diff) | |
download | linux-stable-4ee92c7149da9cb1991684628a9e47166a5e26f6.tar.gz linux-stable-4ee92c7149da9cb1991684628a9e47166a5e26f6.tar.bz2 linux-stable-4ee92c7149da9cb1991684628a9e47166a5e26f6.zip |
drm/mm: Convert drm_mm_node booleans to bitops
A straightforward conversion of assignment and checking of the boolean
state flags (allocated, scanned) into non-atomic bitops. The caller
remains responsible for all locking around the drm_mm and its nodes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191003210100.22250-4-chris@chris-wilson.co.uk
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r-- | include/drm/drm_mm.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 2c3bbb43c7d1..d7939c054259 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h @@ -168,8 +168,9 @@ struct drm_mm_node { struct rb_node rb_hole_addr; u64 __subtree_last; u64 hole_size; - bool allocated : 1; - bool scanned_block : 1; + unsigned long flags; +#define DRM_MM_NODE_ALLOCATED_BIT 0 +#define DRM_MM_NODE_SCANNED_BIT 1 #ifdef CONFIG_DRM_DEBUG_MM depot_stack_handle_t stack; #endif @@ -253,7 +254,7 @@ struct drm_mm_scan { */ static inline bool drm_mm_node_allocated(const struct drm_mm_node *node) { - return node->allocated; + return test_bit(DRM_MM_NODE_ALLOCATED_BIT, &node->flags); } /** |