mbox series

[v3,0/6] Increase code coverage on drm_format_helper.c

Message ID 20230814-gsoc-drm-format-test-v2-v3-0-bd3e9f9bc2fb@riseup.net (mailing list archive)
Headers show
Series Increase code coverage on drm_format_helper.c | expand

Message

Arthur Grillo Aug. 14, 2023, 10:11 p.m. UTC
The following series include improvements and new KUnit tests to some
functions on drm_format_helper.c.

The first patch improves existing conversion tests to assure that the
default pitch is used when NULL is used on the `dst_pitch` argument.

Patches 2, 3, 4, and 6 add the new parametrized tests to the following
functions:

- drm_fb_swab()
- drm_fb_clip_offset()
- drm_fb_build_fourcc_list()
- drm_fb_memcpy()

The 5th patch is a change to the conversion_buf_size() helper used on
the tests, this change was needed to make the patch 6.

a coverage report for the file can be found below:
https://grillo-0.github.io/coverage-reports/gsoc-drm-format-test/drivers/gpu/drm/drm_format_helper.c.gcov.html

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---

v1->v2: https://lore.kernel.org/r/20230721182316.560649-1-arthurgrillo@riseup.net
- Change patch prefix to "drm/tests" (Maíra Canal)
- Simplify the code by changing to an ternary operator on the
  pitch (Maíra Canal)
- Explain how the expected swab colors were obtained (André Almeida)
- Fix multi-line comment style (André Almeida)
- Remove unnecessary use of drm_kunit_helper_free_device() (Maíra Canal)
- Hard-code the expected number of fourcss (Maíra Canal & Andre Almeida)
- Fix some sparce warnings (kernel test robot)

v2->v3: https://lore.kernel.org/r/20230811-gsoc-drm-format-test-v2-v2-0-763b17890644@riseup.net
- Hard-code the number of native fourcss (Maíra Canal)
- Change to a ternary operator on them memcpy test too (Maíra Canal)
- Remove the memcpy_result and place the expected values with the
  parameters
- s/multi_plane_op/fb_memcpy/ (Maíra Canal)

---
Arthur Grillo (6):
      drm/tests: Test default pitch fallback
      drm/tests: Add KUnit tests for drm_fb_swab()
      drm/tests: Add KUnit tests for drm_fb_clip_offset()
      drm/tests: Add KUnit tests for drm_fb_build_fourcc_list()
      drm/tests: Add multi-plane support to conversion_buf_size()
      drm/tests: Add KUnit tests for drm_fb_memcpy()

 drivers/gpu/drm/tests/drm_format_helper_test.c | 815 +++++++++++++++++++++++--
 1 file changed, 757 insertions(+), 58 deletions(-)
---
base-commit: b31f784ffff96643fa6dec31b182a3466cf4139e
change-id: 20230810-gsoc-drm-format-test-v2-1989f08e115b

Best regards,

Comments

Maíra Canal Aug. 26, 2023, 2:52 p.m. UTC | #1
Hi Arthur,

On 8/14/23 19:11, Arthur Grillo wrote:
> The following series include improvements and new KUnit tests to some
> functions on drm_format_helper.c.
> 
> The first patch improves existing conversion tests to assure that the
> default pitch is used when NULL is used on the `dst_pitch` argument.
> 
> Patches 2, 3, 4, and 6 add the new parametrized tests to the following
> functions:
> 
> - drm_fb_swab()
> - drm_fb_clip_offset()
> - drm_fb_build_fourcc_list()
> - drm_fb_memcpy()
> 
> The 5th patch is a change to the conversion_buf_size() helper used on
> the tests, this change was needed to make the patch 6.
> 
> a coverage report for the file can be found below:
> https://grillo-0.github.io/coverage-reports/gsoc-drm-format-test/drivers/gpu/drm/drm_format_helper.c.gcov.html
> 
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>

Applied to drm-misc/drm-misc-next. Thanks!

Best Regards,
- Maíra

> ---
> 
> v1->v2: https://lore.kernel.org/r/20230721182316.560649-1-arthurgrillo@riseup.net
> - Change patch prefix to "drm/tests" (Maíra Canal)
> - Simplify the code by changing to an ternary operator on the
>    pitch (Maíra Canal)
> - Explain how the expected swab colors were obtained (André Almeida)
> - Fix multi-line comment style (André Almeida)
> - Remove unnecessary use of drm_kunit_helper_free_device() (Maíra Canal)
> - Hard-code the expected number of fourcss (Maíra Canal & Andre Almeida)
> - Fix some sparce warnings (kernel test robot)
> 
> v2->v3: https://lore.kernel.org/r/20230811-gsoc-drm-format-test-v2-v2-0-763b17890644@riseup.net
> - Hard-code the number of native fourcss (Maíra Canal)
> - Change to a ternary operator on them memcpy test too (Maíra Canal)
> - Remove the memcpy_result and place the expected values with the
>    parameters
> - s/multi_plane_op/fb_memcpy/ (Maíra Canal)
> 
> ---
> Arthur Grillo (6):
>        drm/tests: Test default pitch fallback
>        drm/tests: Add KUnit tests for drm_fb_swab()
>        drm/tests: Add KUnit tests for drm_fb_clip_offset()
>        drm/tests: Add KUnit tests for drm_fb_build_fourcc_list()
>        drm/tests: Add multi-plane support to conversion_buf_size()
>        drm/tests: Add KUnit tests for drm_fb_memcpy()
> 
>   drivers/gpu/drm/tests/drm_format_helper_test.c | 815 +++++++++++++++++++++++--
>   1 file changed, 757 insertions(+), 58 deletions(-)
> ---
> base-commit: b31f784ffff96643fa6dec31b182a3466cf4139e
> change-id: 20230810-gsoc-drm-format-test-v2-1989f08e115b
> 
> Best regards,