diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-12-22 03:36:06 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-27 06:29:41 -0500 |
commit | b3ee963fe41d0034cf8b6aff1f0cc9c91bf8d478 (patch) | |
tree | a83aa9ad241ffe2af888f57535a56b70850b5999 /include/drm/drm_mm.h | |
parent | 2bc98c86517b08304b5008f427b751c08659b100 (diff) |
drm: Compile time enabling for asserts in drm_mm
Use CONFIG_DRM_DEBUG_MM to conditionally enable the internal and
validation checking using BUG_ON. Ideally these paths should all be
exercised by CI selftests (with the asserts enabled).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161222083641.2691-4-chris@chris-wilson.co.uk
Link: http://patchwork.freedesktop.org/patch/msgid/20161222083641.2691-4-chris@chris-wilson.co.uk
Diffstat (limited to 'include/drm/drm_mm.h')
-rw-r--r-- | include/drm/drm_mm.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index f6a68ed5ecaf..525543019896 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -48,6 +48,12 @@ | |||
48 | #include <linux/stackdepot.h> | 48 | #include <linux/stackdepot.h> |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #ifdef CONFIG_DRM_DEBUG_MM | ||
52 | #define DRM_MM_BUG_ON(expr) BUG_ON(expr) | ||
53 | #else | ||
54 | #define DRM_MM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr) | ||
55 | #endif | ||
56 | |||
51 | enum drm_mm_search_flags { | 57 | enum drm_mm_search_flags { |
52 | DRM_MM_SEARCH_DEFAULT = 0, | 58 | DRM_MM_SEARCH_DEFAULT = 0, |
53 | DRM_MM_SEARCH_BEST = 1 << 0, | 59 | DRM_MM_SEARCH_BEST = 1 << 0, |
@@ -155,7 +161,7 @@ static inline u64 __drm_mm_hole_node_start(const struct drm_mm_node *hole_node) | |||
155 | */ | 161 | */ |
156 | static inline u64 drm_mm_hole_node_start(const struct drm_mm_node *hole_node) | 162 | static inline u64 drm_mm_hole_node_start(const struct drm_mm_node *hole_node) |
157 | { | 163 | { |
158 | BUG_ON(!hole_node->hole_follows); | 164 | DRM_MM_BUG_ON(!hole_node->hole_follows); |
159 | return __drm_mm_hole_node_start(hole_node); | 165 | return __drm_mm_hole_node_start(hole_node); |
160 | } | 166 | } |
161 | 167 | ||