From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
To: Alex Deucher <alexander.deucher@amd.com>,
<christian.koenig@amd.com>, <Xinhui.Pan@amd.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
Nicholas Choi <nicholas.choi@amd.com>,
Daniel Latypov <dlatypov@google.com>,
David Gow <davidgow@google.com>, <hersenxs.wu@amd.com>,
<magalilemes00@gmail.com>
Cc: <kunit-dev@googlegroups.com>, <tales.aparecida@gmail.com>,
<amd-gfx@lists.freedesktop.org>, <mwen@igalia.com>,
<mairacanal@riseup.net>, <dri-devel@lists.freedesktop.org>,
Isabella Basso <isabbasso@riseup.net>, <andrealmeid@riseup.net>,
Trevor Woerner <twoerner@gmail.com>, <javierm@redhat.com>
Subject: [PATCH v5 0/8] drm/amd/display: Introduce KUnit to Display Mode Library
Date: Thu, 22 Feb 2024 08:56:12 -0700 [thread overview]
Message-ID: <20240222155811.44096-1-Rodrigo.Siqueira@amd.com> (raw)
In 2022, we got a great patchset from a GSoC project introducing unit
tests to the amdgpu display. Since version 3, this effort was put on
hold, and now I'm attempting to revive it. I'll add part of the original
cover letter at the bottom of this cover letter, but you can read all
the original messages at:
https://lore.kernel.org/amd-gfx/20220912155919.39877-1-mairacanal@riseup.net/
Changes since V3:
- Rebase and adjust conflicts.
- Rewrite part of the dc_dmub_srv_test to represent a real scenario that
simulates some parameter configuration for using 4k144 and 4k240
displays.
Changes since v4:
- Rebase.
- Change the folder organization to better align with the display code.
- Fix the wrong CONFIG used in the FPU code.
- Drop unstable tests.
Thanks
Siqueira
Original cover letter
Hello,
This series is version 3 of the introduction of unit testing to the
AMDPGU driver [1].
Our main goal is to bring unit testing to the AMD display driver; in
particular, we'll focus on the Display Mode Library (DML) for DCN2.0,
DMUB, and some of the DCE functions. This implementation intends to
help developers to recognize bugs before they are merged into the
mainline and also makes it possible for future code refactors of the
AMD display driver.
For the implementation of the tests, we decided to go with the Kernel
Unit Testing Framework (KUnit). KUnit makes it possible to run test
suites on kernel boot or load the tests as a module. It reports all test
case results through a TAP (Test Anything Protocol) in the kernel log.
Moreover, KUnit unifies the test structure and provides tools to
simplify the testing for developers and CI systems.
In regards to CI pipelines, we believe kunit_tool [2] provides
ease of use, but we are also working on integrating KUnit into IGT [3].
Since the second version, we've chosen a mix of approaches to integrate
KUnit tests into amdgpu:
1. Tests that use static functions are included through guards [4].
2. Tests without static functions are included through a Makefile.
We understand that testing static functions is not ideal, but taking into
consideration that this driver relies heavily on static functions with
complex behavior which would benefit from unit testing, otherwise, black-box
tested through public functions with dozens of arguments and sometimes high
cyclomatic complexity.
The first seven patches represent what we intend to do for the rest of the
DML modules: systematic testing of the DML functions, especially mathematically
complicated functions. Also, it shows how simple it is to add new tests to the DML.
Among the tests, we highlight the dcn20_fpu_test, which, had it existed
then, could catch the defects introduced to dcn20_fpu.c by 8861c27a6c [5]
later fixed by 9ad5d02c2a [6].
In this series, there's also an example of how unit tests can help avoid
regressions and keep track of changes in behavior.
[..]
Isabella Basso (1):
drm/amd/display: Introduce KUnit tests to display_rq_dlg_calc_20
Magali Lemes (1):
drm/amd/display: Introduce KUnit tests for dcn20_fpu
Maíra Canal (5):
drm/amd/display: Introduce KUnit tests to the bw_fixed library
drm/amd/display: Introduce KUnit tests to the display_mode_vba library
drm/amd/display: Introduce KUnit to dcn20/display_mode_vba_20 library
drm/amd/display: Introduce KUnit tests to dc_dmub_srv library
Documentation/gpu: Add Display Core Unit Test documentation
Tales Aparecida (1):
drm/amd/display: Introduce KUnit tests for fixed31_32 library
.../gpu/amdgpu/display/display-test.rst | 88 ++
Documentation/gpu/amdgpu/display/index.rst | 1 +
drivers/gpu/drm/amd/display/Kconfig | 52 ++
drivers/gpu/drm/amd/display/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 4 +
.../dc/dml/dcn20/display_mode_vba_20.c | 4 +
.../dc/dml/dcn20/display_rq_dlg_calc_20.c | 4 +
.../drm/amd/display/test/kunit/.kunitconfig | 9 +
.../gpu/drm/amd/display/test/kunit/Makefile | 18 +
.../test/kunit/dc/basics/fixpt31_32_test.c | 232 ++++++
.../display/test/kunit/dc/dc_dmub_srv_test.c | 159 ++++
.../test/kunit/dc/dml/calcs/bw_fixed_test.c | 323 ++++++++
.../test/kunit/dc/dml/dcn20/dcn20_fpu_test.c | 561 +++++++++++++
.../dc/dml/dcn20/display_mode_vba_20_test.c | 780 ++++++++++++++++++
.../dml/dcn20/display_rq_dlg_calc_20_test.c | 124 +++
.../test/kunit/dc/dml/display_mode_vba_test.c | 741 +++++++++++++++++
16 files changed, 3101 insertions(+), 1 deletion(-)
create mode 100644 Documentation/gpu/amdgpu/display/display-test.rst
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/.kunitconfig
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/Makefile
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/dc/basics/fixpt31_32_test.c
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/dc/dc_dmub_srv_test.c
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/dc/dml/calcs/bw_fixed_test.c
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/dc/dml/dcn20/dcn20_fpu_test.c
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/dc/dml/dcn20/display_mode_vba_20_test.c
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/dc/dml/dcn20/display_rq_dlg_calc_20_test.c
create mode 100644 drivers/gpu/drm/amd/display/test/kunit/dc/dml/display_mode_vba_test.c
--
2.43.0
next reply other threads:[~2024-02-22 15:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 15:56 Rodrigo Siqueira [this message]
2024-02-22 15:56 ` [PATCH v5 1/8] drm/amd/display: Introduce KUnit tests for fixed31_32 library Rodrigo Siqueira
2024-02-22 15:56 ` [PATCH v5 2/8] drm/amd/display: Introduce KUnit tests to the bw_fixed library Rodrigo Siqueira
2024-02-22 15:56 ` [PATCH v5 3/8] drm/amd/display: Introduce KUnit tests to display_rq_dlg_calc_20 Rodrigo Siqueira
2024-02-22 15:56 ` [PATCH v5 4/8] drm/amd/display: Introduce KUnit tests to the display_mode_vba library Rodrigo Siqueira
2024-02-22 15:56 ` [PATCH v5 5/8] drm/amd/display: Introduce KUnit to dcn20/display_mode_vba_20 library Rodrigo Siqueira
2024-02-22 15:56 ` [PATCH v5 6/8] drm/amd/display: Introduce KUnit tests for dcn20_fpu Rodrigo Siqueira
2024-02-22 15:56 ` [PATCH v5 7/8] drm/amd/display: Introduce KUnit tests to dc_dmub_srv library Rodrigo Siqueira
2024-02-26 11:12 ` Jani Nikula
2024-02-28 14:42 ` Rodrigo Siqueira Jordao
2024-02-22 15:56 ` [PATCH v5 8/8] Documentation/gpu: Add Display Core Unit Test documentation Rodrigo Siqueira
2024-04-20 18:48 ` [PATCH 0/4] drm/amd/display: Update Display Core unit tests Joao Paulo Pereira da Silva
2024-04-20 18:48 ` [PATCH 1/4] drm/amd/display: Refactor AMD display KUnit tests configs Joao Paulo Pereira da Silva
2024-04-20 18:48 ` [PATCH 2/4] drm/amd/display/test: Fix kunit test that is not running Joao Paulo Pereira da Silva
2024-04-20 18:48 ` [PATCH 3/4] drm/amd/display/test: Optimize kunit test suite dml_dcn20_fpu_dcn21_update_bw_bounding_box_test Joao Paulo Pereira da Silva
2024-04-20 18:48 ` [PATCH 4/4] Documentation/gpu: Update AMD Display Core Unit Test documentation Joao Paulo Pereira da Silva
2024-04-21 1:36 ` [PATCH 0/4] drm/amd/display: Update Display Core unit tests Tales
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=20240222155811.44096-1-Rodrigo.Siqueira@amd.com \
--to=rodrigo.siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrealmeid@riseup.net \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=davidgow@google.com \
--cc=dlatypov@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=isabbasso@riseup.net \
--cc=javierm@redhat.com \
--cc=kunit-dev@googlegroups.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=magalilemes00@gmail.com \
--cc=mairacanal@riseup.net \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=nicholas.choi@amd.com \
--cc=sunpeng.li@amd.com \
--cc=tales.aparecida@gmail.com \
--cc=twoerner@gmail.com \
--cc=tzimmermann@suse.de \
/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