dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>,
	"seanpaul@chromium.org" <seanpaul@chromium.org>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"maxime.ripard@bootlin.com" <maxime.ripard@bootlin.com>,
	"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	Brian Starkey <Brian.Starkey@arm.com>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH] drm/selftests: Fix build warning -Wframe-larger-than
Date: Fri, 2 Nov 2018 14:26:24 +0100	[thread overview]
Message-ID: <a9cf19ef-77d8-0fc2-d52d-28c06b419097@linux.intel.com> (raw)
In-Reply-To: <20181102130103.7753-1-alexandru-cosmin.gheorghe@arm.com>

Op 02-11-18 om 14:01 schreef Alexandru-Cosmin Gheorghe:
> It seems for some random configuration drm_device is bigger than 2048
> bytes.
> The fix is to make the mock objects static variables.
>
> Bug reported by 0-DAY Kernel test infrastructure here:
> https://lists.01.org/pipermail/kbuild-all/2018-November/054431.html
>
> Fixes: 6ff3d9ffdcbb ("drm/selftests: Add tests for drm_internal_framebuffer_create")
> Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
> ---
>  .../gpu/drm/selftests/test-drm_framebuffer.c  | 30 ++++++++++---------
>  1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/selftests/test-drm_framebuffer.c b/drivers/gpu/drm/selftests/test-drm_framebuffer.c
> index 3098435678af..a04d02dacce2 100644
> --- a/drivers/gpu/drm/selftests/test-drm_framebuffer.c
> +++ b/drivers/gpu/drm/selftests/test-drm_framebuffer.c
> @@ -307,25 +307,27 @@ static struct drm_framebuffer *fb_create_mock(struct drm_device *dev,
>  	return ERR_PTR(-EINVAL);
>  }
>  
> +static struct drm_mode_config_funcs mock_config_funcs = {
> +	.fb_create = fb_create_mock,
> +};
> +
> +static struct drm_device mock_drm_device = {
> +	.mode_config = {
> +		.min_width = MIN_WIDTH,
> +		.max_width = MAX_WIDTH,
> +		.min_height = MIN_HEIGHT,
> +		.max_height = MAX_HEIGHT,
> +		.allow_fb_modifiers = true,
> +		.funcs = &mock_config_funcs,
> +	},
> +};
> +
>  static int execute_drm_mode_fb_cmd2(struct drm_mode_fb_cmd2 *r)
>  {
>  	int buffer_created = 0;
>  	struct drm_framebuffer *fb;
> -	struct drm_mode_config_funcs mock_config_funcs = {
> -		.fb_create = fb_create_mock,
> -	};
> -	struct drm_device mock_drm_device = {
> -		.mode_config = {
> -			.min_width = MIN_WIDTH,
> -			.max_width = MAX_WIDTH,
> -			.min_height = MIN_HEIGHT,
> -			.max_height = MAX_HEIGHT,
> -			.allow_fb_modifiers = true,
> -			.funcs = &mock_config_funcs,
> -		},
> -		.dev_private = &buffer_created
> -	};
>  
> +	mock_drm_device.dev_private = &buffer_created;
>  	fb = drm_internal_framebuffer_create(&mock_drm_device, r, NULL);
>  	return buffer_created;
>  }

Thanks, pushed. :)

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-11-02 13:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 13:01 [PATCH] drm/selftests: Fix build warning -Wframe-larger-than Alexandru-Cosmin Gheorghe
2018-11-02 13:26 ` Maarten Lankhorst [this message]

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=a9cf19ef-77d8-0fc2-d52d-28c06b419097@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=Alexandru-Cosmin.Gheorghe@arm.com \
    --cc=Brian.Starkey@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox