<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/tests, branch v6.12.22</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.22</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.22'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-03-22T19:54:18+00:00</updated>
<entry>
<title>drm/tests: hdmi: Fix recursive locking</title>
<updated>2025-03-22T19:54:18+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2025-01-29T14:21:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=02a12760d7c98c44541c46cd7b011d323b0d15d6'/>
<id>urn:sha1:02a12760d7c98c44541c46cd7b011d323b0d15d6</id>
<content type='text'>
[ Upstream commit 5d14c08a47460e8eedf0185a28b116420ea7f29d ]

The find_preferred_mode() functions takes the mode_config mutex, but due
to the order most tests have, is called with the crtc_ww_class_mutex
taken. This raises a warning for a circular dependency when running the
tests with lockdep.

Reorder the tests to call find_preferred_mode before the acquire context
has been created to avoid the issue.

Reviewed-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250129-test-kunit-v2-4-fe59c43805d5@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: hdmi: Reorder DRM entities variables assignment</title>
<updated>2025-03-22T19:54:17+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2025-01-29T14:21:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b0f9bb67869dcab549bfbd433aa0eede034d99d1'/>
<id>urn:sha1:b0f9bb67869dcab549bfbd433aa0eede034d99d1</id>
<content type='text'>
[ Upstream commit 6b6bfd63e1626ceedc738b2a06505aa5b46c1481 ]

The tests all deviate slightly in how they assign their local pointers
to DRM entities. This makes refactoring pretty difficult, so let's just
move the assignment as soon as the entities are allocated.

Reviewed-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250129-test-kunit-v2-3-fe59c43805d5@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: hdmi: Remove redundant assignments</title>
<updated>2025-03-22T19:54:17+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2025-01-29T14:21:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9828d2f2a6ee9a99996fc85158bd20256a274d74'/>
<id>urn:sha1:9828d2f2a6ee9a99996fc85158bd20256a274d74</id>
<content type='text'>
[ Upstream commit bb4f929a8875b4801db95b8cf3b2c527c1e475e0 ]

Some tests have the drm pointer assigned multiple times to the same
value. Drop the redundant assignments.

Reviewed-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250129-test-kunit-v2-2-fe59c43805d5@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: hdmi: Fix WW_MUTEX_SLOWPATH failures</title>
<updated>2025-02-21T13:01:19+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2025-01-29T14:21:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f3bafc92766897212ed165739e4a9180c67d8711'/>
<id>urn:sha1:f3bafc92766897212ed165739e4a9180c67d8711</id>
<content type='text'>
[ Upstream commit fb97bc2e47f694f79d6358d981ae0428db8e8088 ]

The light_up_connector helper function in the HDMI infrastructure unit
tests uses drm_atomic_set_crtc_for_connector(), but fails when it
returns an error.

This function can return EDEADLK though if the sequence needs to be
restarted, and WW_MUTEX_SLOWPATH is meant to test that we handle it
properly.

Let's handle EDEADLK and restart the sequence in our tests as well.

Fixes: eb66d34d793e ("drm/tests: Add output bpc tests")
Reported-by: Dave Airlie &lt;airlied@gmail.com&gt;
Closes: https://lore.kernel.org/r/CAPM=9tzJ4-ERDxvuwrCyUPY0=+P44orhp1kLWVGL7MCfpQjMEQ@mail.gmail.com/
Link: https://lore.kernel.org/r/20241031091558.2435850-1-mripard@kernel.org
Reviewed-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250129-test-kunit-v2-1-fe59c43805d5@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: hdmi: return meaningful value from set_connector_edid()</title>
<updated>2025-02-17T09:04:46+00:00</updated>
<author>
<name>Dmitry Baryshkov</name>
<email>dmitry.baryshkov@linaro.org</email>
</author>
<published>2024-11-30T01:52:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ebf2d94128efdb1c89a0acae51ac23c6cdfa32b0'/>
<id>urn:sha1:ebf2d94128efdb1c89a0acae51ac23c6cdfa32b0</id>
<content type='text'>
[ Upstream commit a8403be6eea91e4f5d8ad5dbc463dd08339eaece ]

The set_connector_edid() function returns a bogus 0, performing the
check on the connector-&gt;funcs-&gt;fill_modes() result internally. Make the
function pass the fill_modes()'s return value to the caller and move
corresponding checks to the caller site.

Reviewed-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241130-hdmi-mode-valid-v5-3-742644ec3b1f@linaro.org
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: hdmi: handle empty modes in find_preferred_mode()</title>
<updated>2025-02-17T09:04:45+00:00</updated>
<author>
<name>Dmitry Baryshkov</name>
<email>dmitry.baryshkov@linaro.org</email>
</author>
<published>2024-11-30T01:52:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0d048dabe33728ff228ac594e0e634ac5a95695'/>
<id>urn:sha1:e0d048dabe33728ff228ac594e0e634ac5a95695</id>
<content type='text'>
[ Upstream commit d3314efd6ebf335a3682b1d6b1b81cdab3d8254a ]

If the connector-&gt;modes list is empty, then list_first_entry() returns a
bogus entry. Change that to use list_first_entry_or_null().

Reviewed-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241130-hdmi-mode-valid-v5-1-742644ec3b1f@linaro.org
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: helpers: Fix compiler warning</title>
<updated>2025-01-23T16:22:52+00:00</updated>
<author>
<name>Yu-Chun Lin</name>
<email>eleanor15x@gmail.com</email>
</author>
<published>2025-01-04T16:51:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=17f0e22bcba091967c92fd52200659722a6756fa'/>
<id>urn:sha1:17f0e22bcba091967c92fd52200659722a6756fa</id>
<content type='text'>
[ Upstream commit b9097e4c8bf3934e4e07e6f9b88741957fef351e ]

Delete one line break to make the format correct, resolving the
following warning during a W=1 build:

&gt;&gt; drivers/gpu/drm/tests/drm_kunit_helpers.c:324: warning: bad line: for a KUnit test

Fixes: caa714f86699 ("drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202501032001.O6WY1VCW-lkp@intel.com/
Reviewed-by: Kuan-Wei Chiu &lt;visitorckw@gmail.com&gt;
Tested-by: Kuan-Wei Chiu &lt;visitorckw@gmail.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Yu-Chun Lin &lt;eleanor15x@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250104165134.1695864-1-eleanor15x@gmail.com
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()</title>
<updated>2024-10-31T09:31:35+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2024-10-30T02:35:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=add4163aca0d4a86e9fe4aa513865e4237db8aef'/>
<id>urn:sha1:add4163aca0d4a86e9fe4aa513865e4237db8aef</id>
<content type='text'>
modprobe drm_hdmi_state_helper_test and then rmmod it, the following
memory leak occurs.

The `mode` allocated in drm_mode_duplicate() called by
drm_display_mode_from_cea_vic() is not freed, which cause the memory leak:

	unreferenced object 0xffffff80ccd18100 (size 128):
	  comm "kunit_try_catch", pid 1851, jiffies 4295059695
	  hex dump (first 32 bytes):
	    57 62 00 00 80 02 90 02 f0 02 20 03 00 00 e0 01  Wb........ .....
	    ea 01 ec 01 0d 02 00 00 0a 00 00 00 00 00 00 00  ................
	  backtrace (crc c2f1aa95):
	    [&lt;000000000f10b11b&gt;] kmemleak_alloc+0x34/0x40
	    [&lt;000000001cd4cf73&gt;] __kmalloc_cache_noprof+0x26c/0x2f4
	    [&lt;00000000f1f3cffa&gt;] drm_mode_duplicate+0x44/0x19c
	    [&lt;000000008cbeef13&gt;] drm_display_mode_from_cea_vic+0x88/0x98
	    [&lt;0000000019daaacf&gt;] 0xffffffedc11ae69c
	    [&lt;000000000aad0f85&gt;] kunit_try_run_case+0x13c/0x3ac
	    [&lt;00000000a9210bac&gt;] kunit_generic_run_threadfn_adapter+0x80/0xec
	    [&lt;000000000a0b2e9e&gt;] kthread+0x2e8/0x374
	    [&lt;00000000bd668858&gt;] ret_from_fork+0x10/0x20
	......

Free `mode` by using drm_kunit_display_mode_from_cea_vic()
to fix it.

Cc: stable@vger.kernel.org
Fixes: 4af70f19e559 ("drm/tests: Add RGB Quantization tests")
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241030023504.530425-4-ruanjinjie@huawei.com
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic()</title>
<updated>2024-10-31T09:31:34+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2024-10-30T02:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=926163342a2e7595d950e84c17c693b1272bd491'/>
<id>urn:sha1:926163342a2e7595d950e84c17c693b1272bd491</id>
<content type='text'>
modprobe drm_connector_test and then rmmod drm_connector_test,
the following memory leak occurs.

The `mode` allocated in drm_mode_duplicate() called by
drm_display_mode_from_cea_vic() is not freed, which cause the memory leak:

	unreferenced object 0xffffff80cb0ee400 (size 128):
	  comm "kunit_try_catch", pid 1948, jiffies 4294950339
	  hex dump (first 32 bytes):
	    14 44 02 00 80 07 d8 07 04 08 98 08 00 00 38 04  .D............8.
	    3c 04 41 04 65 04 00 00 05 00 00 00 00 00 00 00  &lt;.A.e...........
	  backtrace (crc 90e9585c):
	    [&lt;00000000ec42e3d7&gt;] kmemleak_alloc+0x34/0x40
	    [&lt;00000000d0ef055a&gt;] __kmalloc_cache_noprof+0x26c/0x2f4
	    [&lt;00000000c2062161&gt;] drm_mode_duplicate+0x44/0x19c
	    [&lt;00000000f96c74aa&gt;] drm_display_mode_from_cea_vic+0x88/0x98
	    [&lt;00000000d8f2c8b4&gt;] 0xffffffdc982a4868
	    [&lt;000000005d164dbc&gt;] kunit_try_run_case+0x13c/0x3ac
	    [&lt;000000006fb23398&gt;] kunit_generic_run_threadfn_adapter+0x80/0xec
	    [&lt;000000006ea56ca0&gt;] kthread+0x2e8/0x374
	    [&lt;000000000676063f&gt;] ret_from_fork+0x10/0x20
	......

Free `mode` by using drm_kunit_display_mode_from_cea_vic()
to fix it.

Cc: stable@vger.kernel.org
Fixes: abb6f74973e2 ("drm/tests: Add HDMI TDMS character rate tests")
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241030023504.530425-3-ruanjinjie@huawei.com
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()</title>
<updated>2024-10-31T09:31:34+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2024-10-30T02:35:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=caa714f86699bcfb01aa2d698db12d91af7d0d81'/>
<id>urn:sha1:caa714f86699bcfb01aa2d698db12d91af7d0d81</id>
<content type='text'>
As Maxime suggested, add a new helper
drm_kunit_display_mode_from_cea_vic(), it can replace the direct call
of drm_display_mode_from_cea_vic(), and it will help solving
the `mode` memory leaks.

Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Suggested-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241030023504.530425-2-ruanjinjie@huawei.com
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
</feed>
