AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joao Paulo Pereira da Silva <jppaulo11@usp.br>
To: rodrigo.siqueira@amd.com, airlied@gmail.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	corbet@lwn.net, daniel@ffwll.ch,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, Xinhui.Pan@amd.com
Cc: paulormm@ime.usp.br, airlied@linux.ie,
	amd-gfx@lists.freedesktop.org, andrealmeid@riseup.net,
	davidgow@google.com, dlatypov@google.com,
	dri-devel@lists.freedesktop.org, harry.wentland@amd.com,
	hersenxs.wu@amd.com, isabbasso@riseup.net, javierm@redhat.com,
	kunit-dev@googlegroups.com, magalilemes00@gmail.com,
	mairacanal@riseup.net, mwen@igalia.com, nicholas.choi@amd.com,
	sunpeng.li@amd.com, tales.aparecida@gmail.com,
	twoerner@gmail.com,
	Joao Paulo Pereira da Silva <jppaulo11@usp.br>,
	linux-doc@vger.kernel.org
Subject: [PATCH 0/4] drm/amd/display: Update Display Core unit tests
Date: Sat, 20 Apr 2024 15:48:15 -0300	[thread overview]
Message-ID: <20240420184929.97854-1-jppaulo11@usp.br> (raw)
In-Reply-To: <20240222155811.44096-1-Rodrigo.Siqueira@amd.com>

Hey, I'm interested in contributing for display tests from this patch-set.
I've noticed potential updates related to both refactoring and optimization.
This patch-set applies these suggestions.


[WHY]

1.	The single test suite in the file
	test/kunit/dc/dml/calcs/bw_fixed_test.c, which tests some static
	functions defined in the dc/basics/bpw_fixed.c, is not being run.
	According to kunit documentation
	(https://www.kernel.org/doc/html/latest/dev-tools/kunit/usage.html#testing-static-functions),
	there are two strategies for testing
	static functions, but none of them seem to be configured. Additionally,
	it appears that the Config DCE_KUNIT_TEST should be associated with this
	test, since it was introduced in the same patch of the test
	(https://lore.kernel.org/amd-gfx/20240222155811.44096-3-Rodrigo.Siqueira@amd.com/),
	but it is not being used anywhere in the display driver.

2.	Also, according to the documentation, "The display/tests folder replicates
	the folder hierarchy of the display folder". However, note that this test file
	(test/kunit/dc/dml/calcs/bw_fixed_test.c) has a conflicting path with the file
	that is being tested (dc/basics/bw_fixed.c).

3.	Config Names and Helps are a bit misleading and don't follow a strict
	pattern. For example, the config DML_KUNIT_TEST indicates that it is used
	to activate tests for the Display Core Engine, but instead activates tests
	for the Display Core Next. Also, note the different name patterns in
	DML_KUNIT_TEST and AMD_DC_BASICS_KUNIT_TEST.

4.	The test suite dcn21_update_bw_bounding_box_test_suite configures an init
	function that doesn't need to be executed before every test, but only once
	before the suite runs.

5.	There are some not updated info in the Documentation, such as the
	recommended command to run the tests:
	$ ./tools/testing/kunit/kunit.py run --arch=x86_64 \
	--kunitconfig=drivers/gpu/drm/amd/display/tests
	(it doesn't work since there is no .kunitconfig in
	drivers/gpu/drm/amd/display/tests)


[HOW]

1. Revise Config names and Help blocks.

2.	Change the path of the test file bw_fixed_test from
	test/kunit/dc/dml/calcs/bw_fixed_test.c to test/kunit/dc/basics/bw_fixed_test.c
	to make it consistent with the Documentation and the other display driver
	tests. Make this same test file run by importing it conditionally in the file
	dc/basics/bw_fixed_test.c.

3.	Turn the test init function of the suite
	dcn21_update_bw_bounding_box_test_suite into a suite init.

4.	Update Documentation

Joao Paulo Pereira da Silva (4):
  drm/amd/display: Refactor AMD display KUnit tests configs
  drm/amd/display/test: Fix kunit test that is not running
  drm/amd/display/test: Optimize kunit test suite
    dml_dcn20_fpu_dcn21_update_bw_bounding_box_test
  Documentation/gpu: Update AMD Display Core Unit Test documentation

 .../gpu/amdgpu/display/display-test.rst       | 20 ++++++------
 drivers/gpu/drm/amd/display/Kconfig           | 31 ++++++-------------
 .../gpu/drm/amd/display/dc/basics/bw_fixed.c  |  3 ++
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 +-
 .../dc/dml/dcn20/display_mode_vba_20.c        |  2 +-
 .../dc/dml/dcn20/display_rq_dlg_calc_20.c     |  2 +-
 .../drm/amd/display/test/kunit/.kunitconfig   |  7 ++---
 .../gpu/drm/amd/display/test/kunit/Makefile   |  4 +--
 .../dc/{dml/calcs => basics}/bw_fixed_test.c  |  0
 .../test/kunit/dc/dml/dcn20/dcn20_fpu_test.c  |  6 ++--
 10 files changed, 32 insertions(+), 45 deletions(-)
 rename drivers/gpu/drm/amd/display/test/kunit/dc/{dml/calcs => basics}/bw_fixed_test.c (100%)

-- 
2.44.0


  parent reply	other threads:[~2024-04-20 18:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 15:56 [PATCH v5 0/8] drm/amd/display: Introduce KUnit to Display Mode Library Rodrigo Siqueira
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 ` Joao Paulo Pereira da Silva [this message]
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=20240420184929.97854-1-jppaulo11@usp.br \
    --to=jppaulo11@usp.br \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.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=corbet@lwn.net \
    --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=linux-doc@vger.kernel.org \
    --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=paulormm@ime.usp.br \
    --cc=rodrigo.siqueira@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