All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/selftests: Fix build warning -Wframe-larger-than
@ 2018-11-02 13:01 Alexandru-Cosmin Gheorghe
  2018-11-02 13:26 ` Maarten Lankhorst
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru-Cosmin Gheorghe @ 2018-11-02 13:01 UTC (permalink / raw)
  To: seanpaul, airlied, dri-devel, maxime.ripard, maarten.lankhorst,
	daniel.vetter, Liviu Dudau, Brian Starkey
  Cc: nd, 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;
 }
-- 
2.19.1

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/selftests: Fix build warning -Wframe-larger-than
  2018-11-02 13:01 [PATCH] drm/selftests: Fix build warning -Wframe-larger-than Alexandru-Cosmin Gheorghe
@ 2018-11-02 13:26 ` Maarten Lankhorst
  0 siblings, 0 replies; 2+ messages in thread
From: Maarten Lankhorst @ 2018-11-02 13:26 UTC (permalink / raw)
  To: Alexandru-Cosmin Gheorghe, seanpaul, airlied, dri-devel,
	maxime.ripard, daniel.vetter, Liviu Dudau, Brian Starkey
  Cc: nd

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-02 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.