<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/vc4/tests, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-06-19T13:31:34+00:00</updated>
<entry>
<title>drm/vc4: tests: Use return instead of assert</title>
<updated>2025-06-19T13:31:34+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2025-04-03T13:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aba86d49e5ac3700295ab8c417436abacc19cc32'/>
<id>urn:sha1:aba86d49e5ac3700295ab8c417436abacc19cc32</id>
<content type='text'>
[ Upstream commit 9e26a3740cc08ef8bcdc5e5d824792cd677affce ]

The vc4_mock_atomic_add_output() and vc4_mock_atomic_del_output() assert
that the functions they are calling didn't fail. Since some of them can
return EDEADLK, we can't properly deal with it.

Since both functions are expected to return an int, and all caller check
the return value, let's just properly propagate the errors when they
occur.

Fixes: f759f5b53f1c ("drm/vc4: tests: Introduce a mocking infrastructure")
Fixes: 76ec18dc5afa ("drm/vc4: tests: Add unit test suite for the PV muxing")
Reviewed-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://lore.kernel.org/r/20250403-drm-vc4-kunit-failures-v2-1-e09195cc8840@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/vc4: Introduce generation number enum</title>
<updated>2024-12-05T13:01:43+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2024-06-21T15:20:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9550b15fbe5ce64bc3eadc21b751d486a527eb9a'/>
<id>urn:sha1:9550b15fbe5ce64bc3eadc21b751d486a527eb9a</id>
<content type='text'>
[ Upstream commit 24c5ed3ddf27313b248900455b0312bd7a9d3554 ]

With the introduction of the BCM2712 support, we will get yet another
generation of display engine to support.

The binary check of whether it's VC5 or not thus doesn't work anymore,
especially since some parts of the driver will have changed with BCM2711,
and some others with BCM2712.

Let's introduce an enum to store the generation the driver is running
on, which should provide more flexibility.

Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Reviewed-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240621152055.4180873-21-dave.stevenson@raspberrypi.com
Signed-off-by: Dave Stevenson &lt;dave.stevenson@raspberrypi.com&gt;
Stable-dep-of: cf1c87d978d4 ("drm/vc4: Match drm_dev_enter and exit calls in vc4_hvs_lut_load")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vc4: tests: Convert to plane creation helper</title>
<updated>2024-05-28T08:24:42+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2024-05-27T13:58:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b3bf19552ea3e700db4826d45aa64abc66bbefa6'/>
<id>urn:sha1:b3bf19552ea3e700db4826d45aa64abc66bbefa6</id>
<content type='text'>
Now that we have a plane create helper for kunit mocked drivers, let's
convert to it in vc4.

Reviewed-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240527-kms-hdmi-connector-state-v15-27-c5af16c3aae2@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vc4: tests: Remove vc4_dummy_plane structure</title>
<updated>2024-05-28T08:24:42+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2024-05-27T13:58:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=27e0a194a2566c376fb600e8195bdafef7519211'/>
<id>urn:sha1:27e0a194a2566c376fb600e8195bdafef7519211</id>
<content type='text'>
The vc4_dummy_plane structure was introduced as a mean to add
mock-specific fields.

However, we never really used it and it's still strictly equivalent to
vc4_plane (which is in the same situation vs drm_plane), so we can
simply remove the vc4_dummy_plane structure and make the mock code
cleaner.

Reviewed-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240527-kms-hdmi-connector-state-v15-26-c5af16c3aae2@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vc4: tests: Use KUNIT_DEFINE_ACTION_WRAPPER</title>
<updated>2023-12-18T20:21:14+00:00</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2023-11-28T07:24:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a08d4d6284393d44ef4e076288c31d04fc469a58'/>
<id>urn:sha1:a08d4d6284393d44ef4e076288c31d04fc469a58</id>
<content type='text'>
In order to pass functions to kunit_add_action(), they need to be of the
kunit_action_t type. While casting the function pointer can work, it
will break control-flow integrity.

vc4_mock already defines such a wrapper for drm_dev_unregister(), but it
involves less boilerplate to use the new macro, so replace the manual
implementation.

Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/vc4: tests: Fix UAF in the mock helpers</title>
<updated>2023-10-26T11:03:14+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2023-10-24T10:56:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cdcd6aef9db5797995d4153ea19fdf56d189f0e4'/>
<id>urn:sha1:cdcd6aef9db5797995d4153ea19fdf56d189f0e4</id>
<content type='text'>
The VC4 mock helpers allocate the CRTC, encoders and connectors using a
call to kunit_kzalloc(), but the DRM device they are attache to survives
for longer than the test itself which leads to use-after-frees reported
by KASAN.

Switch to drmm_kzalloc to tie the lifetime of these objects to the main
DRM device.

Fixes: f759f5b53f1c ("drm/vc4: tests: Introduce a mocking infrastructure")
Reported-by: Linux Kernel Functional Testing &lt;lkft@linaro.org&gt;
Closes: https://lore.kernel.org/all/CA+G9fYvJA2HGqzR9LGgq63v0SKaUejHAE6f7+z9cwWN-ourJ_g@mail.gmail.com/
Tested-by: Anders Roxell &lt;anders.roxell@linaro.org&gt;
Reviewed-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231024105640.352752-1-mripard@kernel.org
</content>
</entry>
<entry>
<title>drm/vc4: tests: pv-muxing: Document test scenario</title>
<updated>2023-07-31T12:19:58+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2023-07-28T09:06:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b229ea58cbe2f107dc0a7e2c7cdce193f7166b47'/>
<id>urn:sha1:b229ea58cbe2f107dc0a7e2c7cdce193f7166b47</id>
<content type='text'>
We've had a couple of tests that weren't really obvious, nor did they
document what they were supposed to test. Document that to make it
hopefully more obvious.

Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Link: https://lore.kernel.org/r/20230728-kms-kunit-actions-rework-v3-11-952565ccccfe@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vc4: tests: Switch to atomic state allocation helper</title>
<updated>2023-07-31T12:19:58+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2023-07-28T09:06:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ef726c8fbd6a970fe0e752d68bb051954d77461'/>
<id>urn:sha1:1ef726c8fbd6a970fe0e752d68bb051954d77461</id>
<content type='text'>
Now that we have a helper that takes care of an atomic state allocation
and cleanup, we can migrate to it to simplify our tests.

Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Link: https://lore.kernel.org/r/20230728-kms-kunit-actions-rework-v3-10-952565ccccfe@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vc4: tests: pv-muxing: Switch to managed locking init</title>
<updated>2023-07-31T12:19:58+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2023-07-28T09:06:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55ab5e608b2156e6535bb921ca899fb2409ae074'/>
<id>urn:sha1:55ab5e608b2156e6535bb921ca899fb2409ae074</id>
<content type='text'>
The new helper to init the locking context allows to remove some
boilerplate.

Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Link: https://lore.kernel.org/r/20230728-kms-kunit-actions-rework-v3-9-952565ccccfe@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vc4: tests: mock: Use a kunit action to unregister DRM device</title>
<updated>2023-07-31T12:19:57+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2023-07-28T09:06:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=571f88b0992b00f71579bb26abcfa7afda174d17'/>
<id>urn:sha1:571f88b0992b00f71579bb26abcfa7afda174d17</id>
<content type='text'>
The *_mock_device functions allocate a DRM device that needs to be
released using drm_dev_unregister.

Now that we have a kunit release action API, we can switch to it and
don't require any kind of garbage collection from the caller.

Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Link: https://lore.kernel.org/r/20230728-kms-kunit-actions-rework-v3-8-952565ccccfe@kernel.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
</feed>
