diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-12-22 08:36:29 +0000 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-27 16:44:13 +0100 |
commit | 9a71e277888b39b8f0e8364813ec1ba58a5a4371 (patch) | |
tree | b0564902f8ce34f7d3ab3ff7033bea42fb4471ff /include/drm/drm_mm.h | |
parent | 6259a56ba0e1c3a15954e22ea531e810944518cb (diff) | |
download | linux-9a71e277888b39b8f0e8364813ec1ba58a5a4371.tar.bz2 |
drm: Extract struct drm_mm_scan from struct drm_mm
The scan state occupies a large proportion of the struct drm_mm and is
rarely used and only contains temporary state. That makes it suitable to
moving to its struct and onto the stack of the callers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
[danvet: Fix up etnaviv to compile, was missing a BUG_ON.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r-- | include/drm/drm_mm.h | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 72e0c0ddf8d0..fcad718c5fb4 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h @@ -98,20 +98,29 @@ struct drm_mm { /* Keep an interval_tree for fast lookup of drm_mm_nodes by address. */ struct rb_root interval_tree; - unsigned int scan_check_range : 1; - unsigned int scanned_blocks; - unsigned long scan_color; - u64 scan_alignment; - u64 scan_size; - u64 scan_hit_start; - u64 scan_hit_end; - u64 scan_start; - u64 scan_end; - struct drm_mm_node *prev_scanned_node; - void (*color_adjust)(const struct drm_mm_node *node, unsigned long color, u64 *start, u64 *end); + + unsigned long scan_active; +}; + +struct drm_mm_scan { + struct drm_mm *mm; + + u64 size; + u64 alignment; + + u64 range_start; + u64 range_end; + + u64 hit_start; + u64 hit_end; + + struct drm_mm_node *prev_scanned_node; + + unsigned long color; + bool check_range : 1; }; /** @@ -378,18 +387,22 @@ __drm_mm_interval_first(const struct drm_mm *mm, u64 start, u64 last); node__ && node__->start < (end__); \ node__ = list_next_entry(node__, node_list)) -void drm_mm_init_scan(struct drm_mm *mm, +void drm_mm_scan_init(struct drm_mm_scan *scan, + struct drm_mm *mm, u64 size, u64 alignment, unsigned long color); -void drm_mm_init_scan_with_range(struct drm_mm *mm, +void drm_mm_scan_init_with_range(struct drm_mm_scan *scan, + struct drm_mm *mm, u64 size, u64 alignment, unsigned long color, u64 start, u64 end); -bool drm_mm_scan_add_block(struct drm_mm_node *node); -bool drm_mm_scan_remove_block(struct drm_mm_node *node); +bool drm_mm_scan_add_block(struct drm_mm_scan *scan, + struct drm_mm_node *node); +bool drm_mm_scan_remove_block(struct drm_mm_scan *scan, + struct drm_mm_node *node); void drm_mm_debug_table(const struct drm_mm *mm, const char *prefix); #ifdef CONFIG_DEBUG_FS |