[PATCH] drm/tests: Split up test cases in igt_check_drm_format_min_pitch

3 views
Skip to first unread message

Maíra Canal

unread,
Jul 17, 2022, 2:43:50 PMJul 17
to Isabella Basso, magali...@gmail.com, tales.a...@gmail.com, mw...@igalia.com, andre...@riseup.net, siqueir...@riseup.net, Trevor Woerner, Daniel Vetter, David Airlie, Javier Martinez Canillas, José Expósito, David Gow, Daniel Latypov, brendan...@google.com, Guenter Roeck, kuni...@googlegroups.com, linux-k...@vger.kernel.org, dri-...@lists.freedesktop.org, linux-...@vger.kernel.org, Maíra Canal, kernel test robot
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 <l...@intel.com>
Reported-by: Guenter Roeck <li...@roeck-us.net>
Signed-off-by: Maíra Canal <maira...@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

Guenter Roeck

unread,
Jul 17, 2022, 3:12:25 PMJul 17
to Maíra Canal, Isabella Basso, magali...@gmail.com, tales.a...@gmail.com, mw...@igalia.com, andre...@riseup.net, siqueir...@riseup.net, Trevor Woerner, Daniel Vetter, David Airlie, Javier Martinez Canillas, José Expósito, David Gow, Daniel Latypov, brendan...@google.com, kuni...@googlegroups.com, linux-k...@vger.kernel.org, dri-...@lists.freedesktop.org, linux-...@vger.kernel.org, kernel test robot
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 <l...@intel.com>
> Reported-by: Guenter Roeck <li...@roeck-us.net>
> Signed-off-by: Maíra Canal <maira...@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 <li...@roeck-us.net>

Guenter

Maíra Canal

unread,
Jul 27, 2022, 8:23:37 AMJul 27
to Isabella Basso, magali...@gmail.com, tales.a...@gmail.com, mw...@igalia.com, andre...@riseup.net, siqueir...@riseup.net, Trevor Woerner, Daniel Vetter, David Airlie, Javier Martinez Canillas, José Expósito, David Gow, Daniel Latypov, brendan...@google.com, Guenter Roeck, kuni...@googlegroups.com, linux-k...@vger.kernel.org, dri-...@lists.freedesktop.org, linux-...@vger.kernel.org, kernel test robot
Hi all,

Friendly ping: is someone available to take this, please?

Best Regards,
- Maíra Canal

André Almeida

unread,
Jul 28, 2022, 10:03:48 AMJul 28
to Maíra Canal, Isabella Basso, magali...@gmail.com, tales.a...@gmail.com, mw...@igalia.com, siqueir...@riseup.net, Trevor Woerner, Daniel Vetter, David Airlie, Javier Martinez Canillas, José Expósito, David Gow, Daniel Latypov, brendan...@google.com, Guenter Roeck, kuni...@googlegroups.com, linux-k...@vger.kernel.org, dri-...@lists.freedesktop.org, linux-...@vger.kernel.org, kernel test robot
À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 <l...@intel.com>
> Reported-by: Guenter Roeck <li...@roeck-us.net>
> Signed-off-by: Maíra Canal <maira...@riseup.net>
> ---

Reviewed-by: André Almeida <andre...@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"

Melissa Wen

unread,
Jul 28, 2022, 12:12:50 PMJul 28
to Maíra Canal, Isabella Basso, magali...@gmail.com, tales.a...@gmail.com, andre...@riseup.net, siqueir...@riseup.net, Trevor Woerner, Daniel Vetter, David Airlie, Javier Martinez Canillas, José Expósito, David Gow, Daniel Latypov, brendan...@google.com, Guenter Roeck, kernel test robot, linux-...@vger.kernel.org, dri-...@lists.freedesktop.org, linux-k...@vger.kernel.org, kuni...@googlegroups.com
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
signature.asc

Maíra Canal

unread,
Jul 29, 2022, 8:47:49 AMJul 29
to Isabella Basso, magali...@gmail.com, tales.a...@gmail.com, mw...@igalia.com, andre...@riseup.net, siqueir...@riseup.net, Trevor Woerner, Daniel Vetter, David Airlie, Javier Martinez Canillas, David Gow, Daniel Latypov, brendan...@google.com, Guenter Roeck, kuni...@googlegroups.com, linux-k...@vger.kernel.org, dri-...@lists.freedesktop.org, linux-...@vger.kernel.org, Maíra Canal, kernel test robot, André Almeida
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
multi-planar formats, and the other testing tiled formats.

Fixes: 0421bb0baa84 ("drm: selftest: convert drm_format selftest to KUnit")
Reported-by: kernel test robot <l...@intel.com>
Reported-by: Guenter Roeck <li...@roeck-us.net>
Signed-off-by: Maíra Canal <maira...@riseup.net>
Tested-by: Guenter Roeck <li...@roeck-us.net>
Reviewed-by: André Almeida <andre...@igalia.com>
---
v1 -> v2:
- Add Guenter's Tested-by tag.
- Add André's Reviewed-by tag.
- Replace "multiple planes" for "multi-planar" (André Almeida).
- Add Fixes tag (Melissa Wen).
---
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..afb4bca72187 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_multi_planar(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_multi_planar),
+ KUNIT_CASE(igt_check_drm_format_min_pitch_for_tiled_format),
{ }
};

--
2.37.1

Melissa Wen

unread,
Jul 29, 2022, 12:42:35 PMJul 29
to Maíra Canal, Isabella Basso, magali...@gmail.com, tales.a...@gmail.com, andre...@riseup.net, siqueir...@riseup.net, Trevor Woerner, Daniel Vetter, David Airlie, Javier Martinez Canillas, David Gow, Daniel Latypov, brendan...@google.com, Guenter Roeck, kuni...@googlegroups.com, linux-k...@vger.kernel.org, dri-...@lists.freedesktop.org, linux-...@vger.kernel.org, kernel test robot, André Almeida
On 07/29, 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
> multi-planar formats, and the other testing tiled formats.
>
> Fixes: 0421bb0baa84 ("drm: selftest: convert drm_format selftest to KUnit")
> Reported-by: kernel test robot <l...@intel.com>
> Reported-by: Guenter Roeck <li...@roeck-us.net>
> Signed-off-by: Maíra Canal <maira...@riseup.net>
> Tested-by: Guenter Roeck <li...@roeck-us.net>
> Reviewed-by: André Almeida <andre...@igalia.com>

Applied to drm-misc-next

Thanks,

Melissa
signature.asc
Reply all
Reply to author
Forward
0 new messages