Skip to content

Commit

Permalink
drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTES…
Browse files Browse the repository at this point in the history
…T is enabled

If we want to be able to write drmselftests for non-static core
functions that are not intended to be used by drivers we need this
functions to be exported.

This adds a macro that is tied of CONFIG_DRM_DEBUG_SELFTEST, and uses
that to export drm_internal_framebuffer_create, in order for
subsequent patches to be able to test it.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181101151051.1509-7-alexandru-cosmin.gheorghe@arm.com
  • Loading branch information
Alexandru Gheorghe committed Nov 2, 2018
1 parent 0d1c7d0 commit 9aefed1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ drm_internal_framebuffer_create(struct drm_device *dev,

return fb;
}
EXPORT_SYMBOL_FOR_TESTS_ONLY(drm_internal_framebuffer_create);

/**
* drm_mode_addfb2 - add an FB to the graphics configuration
Expand Down
6 changes: 6 additions & 0 deletions include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,10 @@ static inline bool drm_can_sleep(void)
return true;
}

#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

#endif

0 comments on commit 9aefed1

Please sign in to comment.