<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/tests/drm_framebuffer_test.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-07-16T17:03:14+00:00</updated>
<entry>
<title>drm: Pass the format info to .fb_create()</title>
<updated>2025-07-16T17:03:14+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-07-01T09:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=81112eaac559ccd451b3dce3bbb64d6b69083961'/>
<id>urn:sha1:81112eaac559ccd451b3dce3bbb64d6b69083961</id>
<content type='text'>
Pass along the format information from the top to .fb_create()
so that we can avoid redundant (and somewhat expensive) lookups
in the drivers.

Done with cocci (with some manual fixups):
@@
identifier func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *func(
       struct drm_device *dev,
       struct drm_file *file,
+      const struct drm_format_info *info,
       const struct drm_mode_fb_cmd2 *mode_cmd)
{
...
(
- const struct drm_format_info *info = drm_get_format_info(...);
|
- const struct drm_format_info *info;
...
- info = drm_get_format_info(...);
)
&lt;...
- if (!info)
-    return ...;
...&gt;
}

@@
identifier func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *func(
       struct drm_device *dev,
       struct drm_file *file,
+      const struct drm_format_info *info,
       const struct drm_mode_fb_cmd2 *mode_cmd)
{
...
}

@find@
identifier fb_create_func =~ ".*create.*";
identifier dev, file, mode_cmd;
@@
struct drm_framebuffer *fb_create_func(
       struct drm_device *dev,
       struct drm_file *file,
+      const struct drm_format_info *info,
       const struct drm_mode_fb_cmd2 *mode_cmd);

@@
identifier find.fb_create_func;
expression dev, file, mode_cmd;
@@
fb_create_func(dev, file
+	       ,info
	       ,mode_cmd)

@@
expression dev, file, mode_cmd;
@@
drm_gem_fb_create(dev, file
+	       ,info
	       ,mode_cmd)

@@
expression dev, file, mode_cmd;
@@
drm_gem_fb_create_with_dirty(dev, file
+	       ,info
	       ,mode_cmd)

@@
expression dev, file_priv, mode_cmd;
identifier info, fb;
@@
info = drm_get_format_info(...);
...
fb = dev-&gt;mode_config.funcs-&gt;fb_create(dev, file_priv
+                                      ,info
                                       ,mode_cmd);

@@
identifier dev, file_priv, mode_cmd;
@@
struct drm_mode_config_funcs {
...
struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
                                     struct drm_file *file_priv,
+                                     const struct drm_format_info *info,
                                     const struct drm_mode_fb_cmd2 *mode_cmd);
...
};

v2: Fix kernel docs (Laurent)
    Fix commit msg (Geert)

Cc: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Cc: Maxime Ripard &lt;mripard@kernel.org&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Inki Dae &lt;inki.dae@samsung.com&gt;
Cc: Seung-Woo Kim &lt;sw0312.kim@samsung.com&gt;
Cc: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Cc: Patrik Jakobsson &lt;patrik.r.jakobsson@gmail.com&gt;
Cc: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
Cc: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Abhinav Kumar &lt;quic_abhinavk@quicinc.com&gt;
Cc: Dmitry Baryshkov &lt;lumag@kernel.org&gt;
Cc: Sean Paul &lt;sean@poorly.run&gt;
Cc: Marijn Suijten &lt;marijn.suijten@somainline.org&gt;
Cc: Marek Vasut &lt;marex@denx.de&gt;
Cc: Stefan Agner &lt;stefan@agner.ch&gt;
Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: Danilo Krummrich &lt;dakr@kernel.org&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Cc: Kieran Bingham &lt;kieran.bingham+renesas@ideasonboard.com&gt;
Cc: Biju Das &lt;biju.das.jz@bp.renesas.com&gt;
Cc: Sandy Huang &lt;hjc@rock-chips.com&gt;
Cc: "Heiko Stübner" &lt;heiko@sntech.de&gt;
Cc: Andy Yan &lt;andy.yan@rock-chips.com&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: Mikko Perttunen &lt;mperttunen@nvidia.com&gt;
Cc: Dave Stevenson &lt;dave.stevenson@raspberrypi.com&gt;
Cc: "Maíra Canal" &lt;mcanal@igalia.com&gt;
Cc: Raspberry Pi Kernel Maintenance &lt;kernel-list@raspberrypi.com&gt;
Cc: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Cc: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Cc: Chia-I Wu &lt;olvaffe@gmail.com&gt;
Cc: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: Oleksandr Andrushchenko &lt;oleksandr_andrushchenko@epam.com&gt;
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: virtualization@lists.linux.dev
Cc: spice-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Acked-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Acked-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-5-ville.syrjala@linux.intel.com
</content>
</entry>
<entry>
<title>drm/tests: Add test for drm_framebuffer_free()</title>
<updated>2024-09-11T12:17:11+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d2194256049910d286cd6c308c2689df521d8842'/>
<id>urn:sha1:d2194256049910d286cd6c308c2689df521d8842</id>
<content type='text'>
Add a single KUnit test case for the drm_framebuffer_free function.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-10-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add test for drm_framebuffer_init()</title>
<updated>2024-09-11T12:17:10+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2735d5e4060960c7bd06698b0a1990c7d42c762e'/>
<id>urn:sha1:2735d5e4060960c7bd06698b0a1990c7d42c762e</id>
<content type='text'>
Add three KUnit test cases for the drm_framebuffer_init function:

1. Test if expected values are being set after drm_framebuffer_init() call.
2. Try to init a framebuffer without setting its format.
3. Try calling drm_framebuffer_init() with mismatch of the drm_device
   passed at the first argument and the one pointed by fb-&gt;dev.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-9-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add test for drm_framebuffer_lookup()</title>
<updated>2024-09-11T12:17:10+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b3732b0d30fa2bb07c2b7f95df9b33b75e32d07'/>
<id>urn:sha1:3b3732b0d30fa2bb07c2b7f95df9b33b75e32d07</id>
<content type='text'>
Add two KUnit test cases for the drm_framebuffer_lookup function, one
for the base case, that tests if the lookup finds the correct framebuffer
object and another that tests the lookup for an inexistent framebuffer.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-8-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add test for drm_framebuffer_cleanup()</title>
<updated>2024-09-11T12:17:09+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1bb74f6cc3d593fff7c96314ec4901a4055cbf17'/>
<id>urn:sha1:1bb74f6cc3d593fff7c96314ec4901a4055cbf17</id>
<content type='text'>
Add a single KUnit test case for the drm_framebuffer_cleanup function.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-7-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add test for drm_framebuffer_check_src_coords()</title>
<updated>2024-09-11T12:17:08+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=49cdbcbad6142bd738d27cbd8dc063ac9a35a464'/>
<id>urn:sha1:49cdbcbad6142bd738d27cbd8dc063ac9a35a464</id>
<content type='text'>
Add a parametrized test for the drm_framebuffer_check_src_coords function.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-6-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add test case for drm_internal_framebuffer_create()</title>
<updated>2024-09-11T12:17:08+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fa90bc49882841b4985dd01f37a8d7703e832a6a'/>
<id>urn:sha1:fa90bc49882841b4985dd01f37a8d7703e832a6a</id>
<content type='text'>
Introduce a test to cover the creation of framebuffer with
modifier on a device that doesn't support it.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-5-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Replace strcpy to strscpy on drm_test_framebuffer_create test</title>
<updated>2024-09-11T12:17:07+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=80f48b7d77fc82b5f7b7f4ab14b4bbcb618c5e53'/>
<id>urn:sha1:80f48b7d77fc82b5f7b7f4ab14b4bbcb618c5e53</id>
<content type='text'>
Replace the use of strcpy to strscpy on the test_to_desc of the
drm_test_framebuffer_create test for better security and reliability.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-4-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Add parameters to the drm_test_framebuffer_create test</title>
<updated>2024-09-11T12:17:07+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e2b5f1da5fb9c899468067d859e604ae922664b1'/>
<id>urn:sha1:e2b5f1da5fb9c899468067d859e604ae922664b1</id>
<content type='text'>
Extend the existing test case to cover:
1. Invalid flag atribute in the struct drm_mode_fb_cmd2.
2. Pixel format which requires non-linear modifier with
DRM_FORMAT_MOD_LINEAR set.
3. Buffer offset for inexistent plane

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-3-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/tests: Stop using deprecated dev_private member on drm_framebuffer tests</title>
<updated>2024-09-11T12:16:59+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2024-09-11T00:15:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96d068ea0d77e3bec79cf8199fce1aaa28cd256e'/>
<id>urn:sha1:96d068ea0d77e3bec79cf8199fce1aaa28cd256e</id>
<content type='text'>
The dev_private member of drm_device is deprecated and its use should
be avoided. Stop using it by embedding the drm_device onto a mock struct.

The new mock struct allows to share variables and even further mocks
over the tests in a cleaner way than using dev_private void pointer.

Also start using drm_kunit_helper_alloc_drm_device() for allocating
the drm_device mock.

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Acked-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-2-gcarlos@disroot.org
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
</content>
</entry>
</feed>
