All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Cc: Charles Xu <Charles.Xu@arm.com>, nd <nd@arm.com>,
	Matt Szczesiak <matt.szczesiak@arm.com>,
	"airlied@linux.ie" <airlied@linux.ie>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"maxime.ripard@bootlin.com" <maxime.ripard@bootlin.com>,
	David Garbett <David.Garbett@arm.com>,
	"seanpaul@chromium.org" <seanpaul@chromium.org>,
	Lisa Wu <lisa.wu@arm.com>,
	"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
	"malidp@foss.arm.com" <malidp@foss.arm.com>,
	Ayan Halder <Ayan.Halder@arm.com>,
	"james qian wang (Arm Technology China)"
	<james.qian.wang@arm.com>,
	Brendan Higgins <brendanhiggins@google.com>
Subject: Re: [PATCH v6 8/9] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled
Date: Tue, 30 Oct 2018 10:16:34 +0100	[thread overview]
Message-ID: <20181030091634.GK21967@phenom.ffwll.local> (raw)
In-Reply-To: <20181029171419.4512-9-alexandru-cosmin.gheorghe@arm.com>

On Mon, Oct 29, 2018 at 05:14:43PM +0000, Alexandru-Cosmin Gheorghe wrote:
> 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.
> 
> Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>

Adding Brendan from kunit, maybe this is something of interest for him
too. I'm not entirely clear how he solves this little problem (or whether
kunit simply builds everything static).

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/drm_framebuffer.c | 1 +
>  include/drm/drmP.h                | 6 ++++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
> index 167c1c4544af..fcaea8f50513 100644
> --- a/drivers/gpu/drm/drm_framebuffer.c
> +++ b/drivers/gpu/drm/drm_framebuffer.c
> @@ -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
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 05350424a4d3..514beb2d483a 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -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
> -- 
> 2.19.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-10-30  9:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 17:14 [PATCH v6 0/9] Add method to describe tile/bit_level_packed formats Alexandru-Cosmin Gheorghe
2018-10-29 17:14 ` [PATCH v6 1/9] drm/fourcc: Add char_per_block, block_w and block_h in drm_format_info Alexandru-Cosmin Gheorghe
2018-10-30  9:29   ` Daniel Vetter
2018-10-29 17:14 ` [PATCH v6 2/9] drm/fourcc: Add fourcc for Mali linear tiled formats Alexandru-Cosmin Gheorghe
2018-10-29 17:14 ` [PATCH v6 3/9] drm: mali-dp: Enable Mali-DP tiled buffer formats Alexandru-Cosmin Gheorghe
2018-11-01 13:31   ` Alexandru-Cosmin Gheorghe
2018-11-01 15:24     ` Liviu Dudau
2018-10-29 17:14 ` [PATCH v6 4/9] drm: Extend framebuffer_check to handle formats with cpp/char_per_block 0 Alexandru-Cosmin Gheorghe
2018-10-30  9:30   ` Daniel Vetter
2018-10-29 17:14 ` [PATCH v6 5/9] drm/fourcc: Add AFBC yuv fourccs for Mali Alexandru-Cosmin Gheorghe
2018-10-29 17:14 ` [PATCH v6 6/9] drm/afbc: Add AFBC modifier usage documentation Alexandru-Cosmin Gheorghe
2018-10-29 17:14 ` [PATCH v6 7/9] drm/selftests: Add tests for drm_format_info* helpers Alexandru-Cosmin Gheorghe
2018-10-29 17:14 ` [PATCH v6 8/9] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled Alexandru-Cosmin Gheorghe
2018-10-30  9:16   ` Daniel Vetter [this message]
2019-11-06 13:53   ` Chris Wilson
2019-11-06 13:53     ` Chris Wilson
2018-10-29 17:14 ` [PATCH v6 9/9] drm/selftests: Add tests for drm_internal_framebuffer_create Alexandru-Cosmin Gheorghe
2018-10-30  9:28   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181030091634.GK21967@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Alexandru-Cosmin.Gheorghe@arm.com \
    --cc=Ayan.Halder@arm.com \
    --cc=Charles.Xu@arm.com \
    --cc=David.Garbett@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=airlied@linux.ie \
    --cc=brendanhiggins@google.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=james.qian.wang@arm.com \
    --cc=lisa.wu@arm.com \
    --cc=malidp@foss.arm.com \
    --cc=matt.szczesiak@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=nd@arm.com \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.