Skip to content

Commit 21376e2

Browse files
sravnborgdanvet
authored andcommitted
drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
In the quest to get rid of drmP.h move the newly added EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h. Fix the single user. Add a note to drmP.h to avoid further use of it. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Sean Paul <sean@poorly.run> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20190112193251.20450-3-sam@ravnborg.org
1 parent e9eafcb commit 21376e2

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

‎drivers/gpu/drm/drm_framebuffer.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <drm/drm_atomic.h>
2828
#include <drm/drm_atomic_uapi.h>
2929
#include <drm/drm_print.h>
30+
#include <drm/drm_util.h>
3031

3132
#include "drm_internal.h"
3233
#include "drm_crtc_internal.h"

‎include/drm/drmP.h‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ struct dma_buf_attachment;
9494
struct pci_dev;
9595
struct pci_controller;
9696

97-
#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
98-
#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
99-
#else
100-
#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
101-
#endif
97+
/*
98+
* NOTE: drmP.h is obsolete - do NOT add anything to this file
99+
*
100+
* Do not include drmP.h in new files.
101+
* Work is ongoing to remove drmP.h includes from existing files
102+
*/
102103

103104
#endif

‎include/drm/drm_util.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
#include <linux/kgdb.h>
3838
#include <linux/smp.h>
3939

40+
/*
41+
* Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall
42+
* only be visible for drmselftests.
43+
*/
44+
#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
45+
#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
46+
#else
47+
#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
48+
#endif
49+
4050
/**
4151
* for_each_if - helper for handling conditionals in various for_each macros
4252
* @condition: The condition to check

0 commit comments

Comments
 (0)