* [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch
@ 2022-07-17 18:43 Maíra Canal
2022-07-17 19:12 ` Guenter Roeck
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Maíra Canal @ 2022-07-17 18:43 UTC (permalink / raw)
To: Isabella Basso, magalilemes00, tales.aparecida, mwen,
andrealmeid, siqueirajordao, Trevor Woerner, Daniel Vetter,
David Airlie, Javier Martinez Canillas, José Expósito,
David Gow, Daniel Latypov, brendanhiggins, Guenter Roeck
Cc: kernel test robot, linux-kernel, dri-devel, Maíra Canal,
linux-kselftest, kunit-dev
The igt_check_drm_format_min_pitch() function had a lot of
KUNIT_EXPECT_* calls, all of which ended up allocating and initializing
various test assertion structures on the stack.
This behavior was producing -Wframe-larger-than warnings on PowerPC, i386,
and MIPS architectures, such as:
drivers/gpu/drm/tests/drm_format_test.c: In function 'igt_check_drm_format_min_pitch':
drivers/gpu/drm/tests/drm_format_test.c:271:1: error: the frame size of
3712 bytes is larger than 2048 bytes
So, the igt_check_drm_format_min_pitch() test case was split into three
smaller functions: one testing single plane formats, one testing multiple
planes formats, and the other testing tiled formats.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
---
drivers/gpu/drm/tests/drm_format_test.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tests/drm_format_test.c b/drivers/gpu/drm/tests/drm_format_test.c
index 056cb8599d6d..28f2b8f88818 100644
--- a/drivers/gpu/drm/tests/drm_format_test.c
+++ b/drivers/gpu/drm/tests/drm_format_test.c
@@ -91,7 +91,7 @@ static void igt_check_drm_format_block_height(struct kunit *test)
KUNIT_EXPECT_FALSE(test, drm_format_info_block_height(info, -1));
}
-static void igt_check_drm_format_min_pitch(struct kunit *test)
+static void igt_check_drm_format_min_pitch_for_single_plane(struct kunit *test)
{
const struct drm_format_info *info = NULL;
@@ -175,6 +175,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
(uint64_t)UINT_MAX * 4);
KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)),
(uint64_t)(UINT_MAX - 1) * 4);
+}
+
+static void igt_check_drm_format_min_pitch_for_multiple_planes(struct kunit *test)
+{
+ const struct drm_format_info *info = NULL;
/* Test 2 planes format */
info = drm_format_info(DRM_FORMAT_NV12);
@@ -249,6 +254,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
(uint64_t)(UINT_MAX - 1) / 2);
KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 2, (UINT_MAX - 1) / 2),
(uint64_t)(UINT_MAX - 1) / 2);
+}
+
+static void igt_check_drm_format_min_pitch_for_tiled_format(struct kunit *test)
+{
+ const struct drm_format_info *info = NULL;
/* Test tiled format */
info = drm_format_info(DRM_FORMAT_X0L2);
@@ -273,7 +283,9 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
static struct kunit_case drm_format_tests[] = {
KUNIT_CASE(igt_check_drm_format_block_width),
KUNIT_CASE(igt_check_drm_format_block_height),
- KUNIT_CASE(igt_check_drm_format_min_pitch),
+ KUNIT_CASE(igt_check_drm_format_min_pitch_for_single_plane),
+ KUNIT_CASE(igt_check_drm_format_min_pitch_for_multiple_planes),
+ KUNIT_CASE(igt_check_drm_format_min_pitch_for_tiled_format),
{ }
};
--
2.36.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch
2022-07-17 18:43 [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch Maíra Canal
@ 2022-07-17 19:12 ` Guenter Roeck
2022-07-27 12:23 ` Maíra Canal
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2022-07-17 19:12 UTC (permalink / raw)
To: Maíra Canal, Isabella Basso, magalilemes00, tales.aparecida,
mwen, andrealmeid, siqueirajordao, Trevor Woerner, Daniel Vetter,
David Airlie, Javier Martinez Canillas, José Expósito,
David Gow, Daniel Latypov, brendanhiggins
Cc: linux-kernel, kernel test robot, dri-devel, linux-kselftest, kunit-dev
On 7/17/22 11:43, Maíra Canal wrote:
> The igt_check_drm_format_min_pitch() function had a lot of
> KUNIT_EXPECT_* calls, all of which ended up allocating and initializing
> various test assertion structures on the stack.
>
> This behavior was producing -Wframe-larger-than warnings on PowerPC, i386,
> and MIPS architectures, such as:
>
> drivers/gpu/drm/tests/drm_format_test.c: In function 'igt_check_drm_format_min_pitch':
> drivers/gpu/drm/tests/drm_format_test.c:271:1: error: the frame size of
> 3712 bytes is larger than 2048 bytes
>
> So, the igt_check_drm_format_min_pitch() test case was split into three
> smaller functions: one testing single plane formats, one testing multiple
> planes formats, and the other testing tiled formats.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Maíra Canal <mairacanal@riseup.net>
I applied the patch to next-20220714 (the fixed file is gone
in next-20220715) and tested with i386, ppc, and mips compilers.
The problem is no longer seen after this patch is applied.
Tested-by: Guenter Roeck <linux@roeck-us.net>
Guenter
> ---
> drivers/gpu/drm/tests/drm_format_test.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_format_test.c b/drivers/gpu/drm/tests/drm_format_test.c
> index 056cb8599d6d..28f2b8f88818 100644
> --- a/drivers/gpu/drm/tests/drm_format_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_test.c
> @@ -91,7 +91,7 @@ static void igt_check_drm_format_block_height(struct kunit *test)
> KUNIT_EXPECT_FALSE(test, drm_format_info_block_height(info, -1));
> }
>
> -static void igt_check_drm_format_min_pitch(struct kunit *test)
> +static void igt_check_drm_format_min_pitch_for_single_plane(struct kunit *test)
> {
> const struct drm_format_info *info = NULL;
>
> @@ -175,6 +175,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)UINT_MAX * 4);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)),
> (uint64_t)(UINT_MAX - 1) * 4);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_multiple_planes(struct kunit *test)
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test 2 planes format */
> info = drm_format_info(DRM_FORMAT_NV12);
> @@ -249,6 +254,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)(UINT_MAX - 1) / 2);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 2, (UINT_MAX - 1) / 2),
> (uint64_t)(UINT_MAX - 1) / 2);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_tiled_format(struct kunit *test)
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test tiled format */
> info = drm_format_info(DRM_FORMAT_X0L2);
> @@ -273,7 +283,9 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> static struct kunit_case drm_format_tests[] = {
> KUNIT_CASE(igt_check_drm_format_block_width),
> KUNIT_CASE(igt_check_drm_format_block_height),
> - KUNIT_CASE(igt_check_drm_format_min_pitch),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_single_plane),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_multiple_planes),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_tiled_format),
> { }
> };
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch
2022-07-17 18:43 [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch Maíra Canal
2022-07-17 19:12 ` Guenter Roeck
@ 2022-07-27 12:23 ` Maíra Canal
2022-07-28 14:03 ` André Almeida
2022-07-28 16:11 ` Melissa Wen
3 siblings, 0 replies; 5+ messages in thread
From: Maíra Canal @ 2022-07-27 12:23 UTC (permalink / raw)
To: Isabella Basso, magalilemes00, tales.aparecida, mwen,
andrealmeid, siqueirajordao, Trevor Woerner, Daniel Vetter,
David Airlie, Javier Martinez Canillas, José Expósito,
David Gow, Daniel Latypov, brendanhiggins, Guenter Roeck
Cc: linux-kernel, kernel test robot, dri-devel, linux-kselftest, kunit-dev
Hi all,
Friendly ping: is someone available to take this, please?
Best Regards,
- Maíra Canal
On 7/17/22 15:43, Maíra Canal wrote:
> The igt_check_drm_format_min_pitch() function had a lot of
> KUNIT_EXPECT_* calls, all of which ended up allocating and initializing
> various test assertion structures on the stack.
>
> This behavior was producing -Wframe-larger-than warnings on PowerPC, i386,
> and MIPS architectures, such as:
>
> drivers/gpu/drm/tests/drm_format_test.c: In function 'igt_check_drm_format_min_pitch':
> drivers/gpu/drm/tests/drm_format_test.c:271:1: error: the frame size of
> 3712 bytes is larger than 2048 bytes
>
> So, the igt_check_drm_format_min_pitch() test case was split into three
> smaller functions: one testing single plane formats, one testing multiple
> planes formats, and the other testing tiled formats.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Maíra Canal <mairacanal@riseup.net>
> ---
> drivers/gpu/drm/tests/drm_format_test.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_format_test.c b/drivers/gpu/drm/tests/drm_format_test.c
> index 056cb8599d6d..28f2b8f88818 100644
> --- a/drivers/gpu/drm/tests/drm_format_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_test.c
> @@ -91,7 +91,7 @@ static void igt_check_drm_format_block_height(struct kunit *test)
> KUNIT_EXPECT_FALSE(test, drm_format_info_block_height(info, -1));
> }
>
> -static void igt_check_drm_format_min_pitch(struct kunit *test)
> +static void igt_check_drm_format_min_pitch_for_single_plane(struct kunit *test)
> {
> const struct drm_format_info *info = NULL;
>
> @@ -175,6 +175,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)UINT_MAX * 4);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)),
> (uint64_t)(UINT_MAX - 1) * 4);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_multiple_planes(struct kunit *test)
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test 2 planes format */
> info = drm_format_info(DRM_FORMAT_NV12);
> @@ -249,6 +254,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)(UINT_MAX - 1) / 2);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 2, (UINT_MAX - 1) / 2),
> (uint64_t)(UINT_MAX - 1) / 2);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_tiled_format(struct kunit *test)
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test tiled format */
> info = drm_format_info(DRM_FORMAT_X0L2);
> @@ -273,7 +283,9 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> static struct kunit_case drm_format_tests[] = {
> KUNIT_CASE(igt_check_drm_format_block_width),
> KUNIT_CASE(igt_check_drm_format_block_height),
> - KUNIT_CASE(igt_check_drm_format_min_pitch),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_single_plane),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_multiple_planes),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_tiled_format),
> { }
> };
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch
2022-07-17 18:43 [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch Maíra Canal
2022-07-17 19:12 ` Guenter Roeck
2022-07-27 12:23 ` Maíra Canal
@ 2022-07-28 14:03 ` André Almeida
2022-07-28 16:11 ` Melissa Wen
3 siblings, 0 replies; 5+ messages in thread
From: André Almeida @ 2022-07-28 14:03 UTC (permalink / raw)
To: Maíra Canal, Isabella Basso, magalilemes00, tales.aparecida,
mwen, siqueirajordao, Trevor Woerner, Daniel Vetter,
David Airlie, Javier Martinez Canillas, José Expósito,
David Gow, Daniel Latypov, brendanhiggins, Guenter Roeck
Cc: linux-kernel, kernel test robot, dri-devel, linux-kselftest, kunit-dev
Às 15:43 de 17/07/22, Maíra Canal escreveu:
> The igt_check_drm_format_min_pitch() function had a lot of
> KUNIT_EXPECT_* calls, all of which ended up allocating and initializing
> various test assertion structures on the stack.
>
> This behavior was producing -Wframe-larger-than warnings on PowerPC, i386,
> and MIPS architectures, such as:
>
> drivers/gpu/drm/tests/drm_format_test.c: In function 'igt_check_drm_format_min_pitch':
> drivers/gpu/drm/tests/drm_format_test.c:271:1: error: the frame size of
> 3712 bytes is larger than 2048 bytes
>
> So, the igt_check_drm_format_min_pitch() test case was split into three
> smaller functions: one testing single plane formats, one testing multiple
> planes formats, and the other testing tiled formats.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Maíra Canal <mairacanal@riseup.net>
> ---
Reviewed-by: André Almeida <andrealmeid@igalia.com>
> drivers/gpu/drm/tests/drm_format_test.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_format_test.c b/drivers/gpu/drm/tests/drm_format_test.c
> index 056cb8599d6d..28f2b8f88818 100644
> --- a/drivers/gpu/drm/tests/drm_format_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_test.c
> @@ -91,7 +91,7 @@ static void igt_check_drm_format_block_height(struct kunit *test)
> KUNIT_EXPECT_FALSE(test, drm_format_info_block_height(info, -1));
> }
>
> -static void igt_check_drm_format_min_pitch(struct kunit *test)
> +static void igt_check_drm_format_min_pitch_for_single_plane(struct kunit *test)
> {
> const struct drm_format_info *info = NULL;
>
> @@ -175,6 +175,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)UINT_MAX * 4);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)),
> (uint64_t)(UINT_MAX - 1) * 4);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_multiple_planes(struct kunit *test)
Minor nit: I think the wording is usually "multi-planar"
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test 2 planes format */
> info = drm_format_info(DRM_FORMAT_NV12);
> @@ -249,6 +254,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)(UINT_MAX - 1) / 2);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 2, (UINT_MAX - 1) / 2),
> (uint64_t)(UINT_MAX - 1) / 2);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_tiled_format(struct kunit *test)
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test tiled format */
> info = drm_format_info(DRM_FORMAT_X0L2);
> @@ -273,7 +283,9 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> static struct kunit_case drm_format_tests[] = {
> KUNIT_CASE(igt_check_drm_format_block_width),
> KUNIT_CASE(igt_check_drm_format_block_height),
> - KUNIT_CASE(igt_check_drm_format_min_pitch),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_single_plane),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_multiple_planes),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_tiled_format),
> { }
> };
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch
2022-07-17 18:43 [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch Maíra Canal
` (2 preceding siblings ...)
2022-07-28 14:03 ` André Almeida
@ 2022-07-28 16:11 ` Melissa Wen
3 siblings, 0 replies; 5+ messages in thread
From: Melissa Wen @ 2022-07-28 16:11 UTC (permalink / raw)
To: Maíra Canal
Cc: linux-kselftest, David Gow, siqueirajordao, magalilemes00,
David Airlie, tales.aparecida, Daniel Latypov, brendanhiggins,
Javier Martinez Canillas, dri-devel, linux-kernel,
kernel test robot, kunit-dev, José Expósito,
Isabella Basso, andrealmeid, Guenter Roeck
[-- Attachment #1: Type: text/plain, Size: 3258 bytes --]
On 07/17, Maíra Canal wrote:
> The igt_check_drm_format_min_pitch() function had a lot of
> KUNIT_EXPECT_* calls, all of which ended up allocating and initializing
> various test assertion structures on the stack.
>
> This behavior was producing -Wframe-larger-than warnings on PowerPC, i386,
> and MIPS architectures, such as:
>
> drivers/gpu/drm/tests/drm_format_test.c: In function 'igt_check_drm_format_min_pitch':
> drivers/gpu/drm/tests/drm_format_test.c:271:1: error: the frame size of
> 3712 bytes is larger than 2048 bytes
>
> So, the igt_check_drm_format_min_pitch() test case was split into three
> smaller functions: one testing single plane formats, one testing multiple
> planes formats, and the other testing tiled formats.
>
Hi Maíra,
Could you add a Fixes tag to indicate the commit that introduces the
issue?
Thanks,
Melissa
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Maíra Canal <mairacanal@riseup.net>
> ---
> drivers/gpu/drm/tests/drm_format_test.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_format_test.c b/drivers/gpu/drm/tests/drm_format_test.c
> index 056cb8599d6d..28f2b8f88818 100644
> --- a/drivers/gpu/drm/tests/drm_format_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_test.c
> @@ -91,7 +91,7 @@ static void igt_check_drm_format_block_height(struct kunit *test)
> KUNIT_EXPECT_FALSE(test, drm_format_info_block_height(info, -1));
> }
>
> -static void igt_check_drm_format_min_pitch(struct kunit *test)
> +static void igt_check_drm_format_min_pitch_for_single_plane(struct kunit *test)
> {
> const struct drm_format_info *info = NULL;
>
> @@ -175,6 +175,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)UINT_MAX * 4);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)),
> (uint64_t)(UINT_MAX - 1) * 4);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_multiple_planes(struct kunit *test)
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test 2 planes format */
> info = drm_format_info(DRM_FORMAT_NV12);
> @@ -249,6 +254,11 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> (uint64_t)(UINT_MAX - 1) / 2);
> KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 2, (UINT_MAX - 1) / 2),
> (uint64_t)(UINT_MAX - 1) / 2);
> +}
> +
> +static void igt_check_drm_format_min_pitch_for_tiled_format(struct kunit *test)
> +{
> + const struct drm_format_info *info = NULL;
>
> /* Test tiled format */
> info = drm_format_info(DRM_FORMAT_X0L2);
> @@ -273,7 +283,9 @@ static void igt_check_drm_format_min_pitch(struct kunit *test)
> static struct kunit_case drm_format_tests[] = {
> KUNIT_CASE(igt_check_drm_format_block_width),
> KUNIT_CASE(igt_check_drm_format_block_height),
> - KUNIT_CASE(igt_check_drm_format_min_pitch),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_single_plane),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_multiple_planes),
> + KUNIT_CASE(igt_check_drm_format_min_pitch_for_tiled_format),
> { }
> };
>
> --
> 2.36.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-07-28 17:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-17 18:43 [PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch Maíra Canal
2022-07-17 19:12 ` Guenter Roeck
2022-07-27 12:23 ` Maíra Canal
2022-07-28 14:03 ` André Almeida
2022-07-28 16:11 ` Melissa Wen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).