* [PATCH v2 07/14] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
@ 2018-12-30 17:48 Sam Ravnborg
2019-01-03 8:16 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2018-12-30 17:48 UTC (permalink / raw)
To: Daniel Vetter, David Airlie, Maarten Lankhorst, Maxime Ripard,
Sean Paul, David Lechner, Laurent Pinchart, linux-kernel,
dri-devel
Cc: Sam Ravnborg
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>
---
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(-)
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index fcaea8f50513..7abcb265a108 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -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"
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index bc4cb3732407..3f5c577c9dbd 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -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
diff --git a/include/drm/drm_util.h b/include/drm/drm_util.h
index 8fda5777471c..cd1e4be1dfb3 100644
--- a/include/drm/drm_util.h
+++ b/include/drm/drm_util.h
@@ -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
--
2.12.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 07/14] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
2018-12-30 17:48 [PATCH v2 07/14] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h Sam Ravnborg
@ 2019-01-03 8:16 ` Christoph Hellwig
2019-01-07 10:33 ` Daniel Vetter
2019-01-08 19:36 ` Sam Ravnborg
0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2019-01-03 8:16 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Daniel Vetter, David Airlie, Maarten Lankhorst, Maxime Ripard,
Sean Paul, David Lechner, Laurent Pinchart, linux-kernel,
dri-devel
On Sun, Dec 30, 2018 at 06:48:31PM +0100, Sam Ravnborg wrote:
> +/*
> + * 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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 07/14] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
2019-01-03 8:16 ` Christoph Hellwig
@ 2019-01-07 10:33 ` Daniel Vetter
2019-01-08 19:36 ` Sam Ravnborg
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2019-01-07 10:33 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Sam Ravnborg, Daniel Vetter, David Airlie, Maarten Lankhorst,
Maxime Ripard, Sean Paul, David Lechner, Laurent Pinchart,
linux-kernel, dri-devel
On Thu, Jan 03, 2019 at 12:16:46AM -0800, Christoph Hellwig wrote:
> On Sun, Dec 30, 2018 at 06:48:31PM +0100, Sam Ravnborg wrote:
> > +/*
> > + * 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
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 07/14] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
2019-01-03 8:16 ` Christoph Hellwig
2019-01-07 10:33 ` Daniel Vetter
@ 2019-01-08 19:36 ` Sam Ravnborg
1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2019-01-08 19:36 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Daniel Vetter, David Airlie, Maarten Lankhorst, Maxime Ripard,
Sean Paul, David Lechner, Laurent Pinchart, linux-kernel,
dri-devel
Hi Christoph
On Thu, Jan 03, 2019 at 12:16:46AM -0800, Christoph Hellwig wrote:
> On Sun, Dec 30, 2018 at 06:48:31PM +0100, Sam Ravnborg wrote:
> > +/*
> > + * 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-08 19:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-30 17:48 [PATCH v2 07/14] drm: move EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h Sam Ravnborg
2019-01-03 8:16 ` Christoph Hellwig
2019-01-07 10:33 ` Daniel Vetter
2019-01-08 19:36 ` Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox