summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_mm.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-27 11:10:57 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-28 14:05:20 +0100
commit1c9bd1ede83cb391db2af481c73b01b63ab41e96 (patch)
tree928e5b165223a3d26d886a442427e4ccd4807f37 /drivers/gpu/drm/drm_mm.c
parentdrm: Use drm_mm_insert_node_in_range_generic() for everyone (diff)
downloadlinux-1c9bd1ede83cb391db2af481c73b01b63ab41e96.tar.xz
linux-1c9bd1ede83cb391db2af481c73b01b63ab41e96.zip
drm/mm: Document locking rules
Drivers need to take care. Motivated by a discussion between Mark and Rob on dri-devel. Cc: Mark yao <mark.yao@rock-chips.com> Cc: Rob Clark <robdclark@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> [danvet: s/alloc|freeing/modifications/ per Chris' suggestion.] Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1482833457-29592-1-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_mm.c')
-rw-r--r--drivers/gpu/drm/drm_mm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 58a7e3bbe130..713f4336107f 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -90,6 +90,11 @@
*
* Finally iteration helpers to walk all nodes and all holes are provided as are
* some basic allocator dumpers for debugging.
+ *
+ * Note that this range allocator is not thread-safe, drivers need to protect
+ * modifications with their on locking. The idea behind this is that for a full
+ * memory manager additional data needs to be protected anyway, hence internal
+ * locking would be fully redundant.
*/
static struct drm_mm_node *drm_mm_search_free_in_range_generic(const struct drm_mm *mm,