summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-22 08:36:06 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-27 12:29:41 +0100
commitb3ee963fe41d0034cf8b6aff1f0cc9c91bf8d478 (patch)
treea83aa9ad241ffe2af888f57535a56b70850b5999 /include/drm
parent2bc98c86517b08304b5008f427b751c08659b100 (diff)
downloadlinux-stable-b3ee963fe41d0034cf8b6aff1f0cc9c91bf8d478.tar.gz
linux-stable-b3ee963fe41d0034cf8b6aff1f0cc9c91bf8d478.tar.bz2
linux-stable-b3ee963fe41d0034cf8b6aff1f0cc9c91bf8d478.zip
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')
-rw-r--r--include/drm/drm_mm.h8
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 @@
#include <linux/stackdepot.h>
#endif
+#ifdef CONFIG_DRM_DEBUG_MM
+#define DRM_MM_BUG_ON(expr) BUG_ON(expr)
+#else
+#define DRM_MM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
+#endif
+
enum drm_mm_search_flags {
DRM_MM_SEARCH_DEFAULT = 0,
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)
*/
static inline u64 drm_mm_hole_node_start(const struct drm_mm_node *hole_node)
{
- BUG_ON(!hole_node->hole_follows);
+ DRM_MM_BUG_ON(!hole_node->hole_follows);
return __drm_mm_hole_node_start(hole_node);
}