Skip to contentSkip to conversation

drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h

PATCH Superseded Sam Ravnborg 3 participants 4 messages Dec 30, 2018 – Jan 8, 2019

Subsystems (2)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 7/14 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.

Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_framebuffer.c |  1 +
 include/drm/drmP.h                | 11 ++++++-----
 include/drm/drm_util.h            | 10 ++++++++++
 3 files changed, 17 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_framebuffer.c +1 -0
index fcaea8f50513..7abcb265a108 100644
@@ -27,6 +27,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_uapi.h>
 #include <drm/drm_print.h>
+#include <drm/drm_util.h>
 
 #include "drm_internal.h"
 #include "drm_crtc_internal.h"
include/drm/drmP.h +6 -5
index bc4cb3732407..3f5c577c9dbd 100644
@@ -94,10 +94,11 @@ struct dma_buf_attachment;
 struct pci_dev;
 struct pci_controller;
 
-#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
-#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
-#else
-#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
-#endif
+/*
+ * NOTE: drmP.h is obsolete - do NOT add anything to this file
+ *
+ * Do not include drmP.h in new files.
+ * Work is ongoing to remove drmP.h includes from existing files
+ */
 
 #endif
include/drm/drm_util.h +10 -0
index 8fda5777471c..cd1e4be1dfb3 100644
@@ -37,6 +37,16 @@
 #include <linux/kgdb.h>
 #include <linux/smp.h>
 
+/*
+ * Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall
+ * only be visible for drmselftests.
+ */
+#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
+#else
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
+#endif
+
 /**
  * for_each_if - helper for handling conditionals in various for_each macros
  * @condition The condition to check
Signature · 1 line
2.12.0
#1 lore raw

include/drm/drm_util.h line 48

Quoted 9 lines · Sam Ravnborg
include/drm/drm_util.h +9 -0
+/*
+ * Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall
+ * only be visible for drmselftests.
+ */
+#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
+#else
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
+#endif

Btw, why isn't this an EXPORT_SYMBOL_GPL if it is only for internal tests?

#2 lore raw
Quoted 13 lines · Christoph Hellwig

include/drm/drm_util.h line 48

Quoted 9 lines · Sam Ravnborg
include/drm/drm_util.h +9 -0
+/*
+ * Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall
+ * only be visible for drmselftests.
+ */
+#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
+#else
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
+#endif

Btw, why isn't this an EXPORT_SYMBOL_GPL if it is only for internal tests?

Yeah EXPORT_SYMBOL_GPL makes sense here I think. Well most of drm is still MIT, so it's a bit hm, but the semantics of _GPL still seem like what we. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#3 lore raw
In reply to Christoph Hellwig

Hi Christoph

Quoted 13 lines · Christoph Hellwig

include/drm/drm_util.h line 48

Quoted 9 lines · Sam Ravnborg
include/drm/drm_util.h +9 -0
+/*
+ * Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall
+ * only be visible for drmselftests.
+ */
+#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE)
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x)
+#else
+#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)
+#endif

Btw, why isn't this an EXPORT_SYMBOL_GPL if it is only for internal tests?

I did see your comment but did not include this in the v3 of the patchset. I leave it to others to deal with this part so the patchset are not postponed due to GPL discussions.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel