<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/vkms, branch linux-6.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-04-10T12:44:15Z</updated>
<entry>
<title>drm/vkms: Fix use after free and double free on init error</title>
<updated>2025-04-10T12:44:15Z</updated>
<author>
<name>José Expósito</name>
</author>
<published>2025-02-12T08:49:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f68f1cf09d06061eb549726ff8339e064eddebd'/>
<id>urn:sha1:1f68f1cf09d06061eb549726ff8339e064eddebd</id>
<content type='text'>
[ Upstream commit ed15511a773df86205bda66c37193569575ae828 ]

If the driver initialization fails, the vkms_exit() function might
access an uninitialized or freed default_config pointer and it might
double free it.

Fix both possible errors by initializing default_config only when the
driver initialization succeeded.

Reported-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Closes: https://lore.kernel.org/all/Z5uDHcCmAwiTsGte@louis-chauvet-laptop/
Fixes: 2df7af93fdad ("drm/vkms: Add vkms_config type")
Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmremann@suse.de&gt;
Reviewed-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250212084912.3196-1-jose.exposito89@gmail.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Round fixp2int conversion in lerp_u16</title>
<updated>2025-02-25T15:15:55Z</updated>
<author>
<name>Harry Wentland</name>
</author>
<published>2024-12-20T04:33:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ec43c58d3be615a71548bc09148212013fb7e5f'/>
<id>urn:sha1:8ec43c58d3be615a71548bc09148212013fb7e5f</id>
<content type='text'>
fixp2int always rounds down, fixp2int_ceil rounds up. We need
the new fixp2int_round.

Signed-off-by: Alex Hung &lt;alex.hung@amd.com&gt;
Signed-off-by: Harry Wentland &lt;harry.wentland@amd.com&gt;
Reviewed-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241220043410.416867-3-alex.hung@amd.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
<entry>
<title>drm: remove driver date from struct drm_driver and all drivers</title>
<updated>2024-12-05T10:35:42Z</updated>
<author>
<name>Jani Nikula</name>
</author>
<published>2024-12-04T14:31:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb2e1c2136f71618142557ceca3a8802e87a44cd'/>
<id>urn:sha1:cb2e1c2136f71618142557ceca3a8802e87a44cd</id>
<content type='text'>
We stopped using the driver initialized date in commit 7fb8af6798e8
("drm: deprecate driver date") and (eventually) started returning "0"
for drm_version ioctl instead.

Finish the job, and remove the unused date member from struct
drm_driver, its initialization from drivers, along with the common
DRIVER_DATE macros.

v2: Also update drivers/accel (kernel test robot)

Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Acked-by: Simon Ser &lt;contact@emersion.fr&gt;
Acked-by: Jeffrey Hugo &lt;quic_jhugo@quicinc.com&gt;
Acked-by: Lucas De Marchi &lt;lucas.demarchi@intel.com&gt;
Acked-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt; # msm
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1f2bf2543aed270a06f6c707fd6ed1b78bf16712.1733322525.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Remove useless drm_rotation_simplify</title>
<updated>2024-11-22T13:00:08Z</updated>
<author>
<name>Louis Chauvet</name>
</author>
<published>2024-11-18T18:28:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98efdd02e220fea84c1491012d7292749a71faeb'/>
<id>urn:sha1:98efdd02e220fea84c1491012d7292749a71faeb</id>
<content type='text'>
As all the rotation are now supported by VKMS, this simplification does
not make sense anymore, so remove it.

Acked-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-9-2dbc2f1e222c@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Re-introduce line-per-line composition algorithm</title>
<updated>2024-11-22T13:00:08Z</updated>
<author>
<name>Louis Chauvet</name>
</author>
<published>2024-11-18T18:28:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1626f53717cd5396ad3ce062b5d5867925e87e76'/>
<id>urn:sha1:1626f53717cd5396ad3ce062b5d5867925e87e76</id>
<content type='text'>
Re-introduce a line-by-line composition algorithm for each pixel format.
This allows more performance by not requiring an indirection per pixel
read. This patch is focused on readability of the code.

Line-by-line composition was introduced by [1] but rewritten back to
pixel-by-pixel algorithm in [2]. At this time, nobody noticed the impact
on performance, and it was merged.

This patch is almost a revert of [2], but in addition efforts have been
made to increase readability and maintainability of the rotation handling.
The blend function is now divided in two parts:
- Transformation of coordinates from the output referential to the source
referential
- Line conversion and blending

Most of the complexity of the rotation management is avoided by using
drm_rect_* helpers. The remaining complexity is around the clipping, to
avoid reading/writing outside source/destination buffers.

The pixel conversion is now done line-by-line, so the read_pixel_t was
replaced with read_pixel_line_t callback. This way the indirection is only
required once per line and per plane, instead of once per pixel and per
plane.

The read_line_t callbacks are very similar for most pixel format, but it
is required to avoid performance impact. Some helpers for color
conversion were introduced to avoid code repetition:
- *_to_argb_u16: perform colors conversion. They should be inlined by the
  compiler, and they are used to avoid repetition between multiple variants
  of the same format (argb/xrgb and maybe in the future for formats like
  bgr formats).

This new algorithm was tested with:
- kms_plane (for color conversions)
- kms_rotation_crc (for rotations of planes)
- kms_cursor_crc (for translations of planes)
- kms_rotation (for all rotations and formats combinations) [3]
The performance gain was mesured with kms_fb_stress [4] with some
modification to fix the writeback format.

The performance improvement is around 5 to 10%.

[1]: commit 8ba1648567e2 ("drm: vkms: Refactor the plane composer to accept
     new formats")
     https://lore.kernel.org/all/20220905190811.25024-7-igormtorrente@gmail.com/
[2]: commit 322d716a3e8a ("drm/vkms: isolate pixel conversion
     functionality")
     https://lore.kernel.org/all/20230418130525.128733-2-mcanal@igalia.com/
[3]: https://lore.kernel.org/igt-dev/20240313-new_rotation-v2-0-6230fd5cae59@bootlin.com/
[4]: https://lore.kernel.org/all/20240422-kms_fb_stress-dev-v5-0-0c577163dc88@riseup.net/

Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Acked-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-8-2dbc2f1e222c@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Introduce pixel_read_direction enum</title>
<updated>2024-11-22T13:00:08Z</updated>
<author>
<name>Louis Chauvet</name>
</author>
<published>2024-11-18T18:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b52fd27356af947f80b0c0855691e42a4c02ee79'/>
<id>urn:sha1:b52fd27356af947f80b0c0855691e42a4c02ee79</id>
<content type='text'>
The pixel_read_direction enum is useful to describe the reading direction
in a plane. It avoids using the rotation property of DRM, which not
practical to know the direction of reading.
This patch also introduce two helpers, one to compute the
pixel_read_direction from the DRM rotation property, and one to compute
the step, in byte, between two successive pixel in a specific direction.

Acked-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-7-2dbc2f1e222c@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Avoid computing blending limits inside pre_mul_alpha_blend</title>
<updated>2024-11-22T13:00:07Z</updated>
<author>
<name>Louis Chauvet</name>
</author>
<published>2024-11-18T18:28:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb6de83faa9049bf40e7dc6821d903016bec2337'/>
<id>urn:sha1:cb6de83faa9049bf40e7dc6821d903016bec2337</id>
<content type='text'>
The pre_mul_alpha_blend is dedicated to blending, so to avoid mixing
different concepts (coordinate calculation and color management), extract
the x_limit and x_dst computation outside of this helper.
It also increases the maintainability by grouping the computation related
to coordinates in the same place: the loop in `blend`.

Reviewed-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-6-2dbc2f1e222c@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Update pixels accessor to support packed and multi-plane formats.</title>
<updated>2024-11-22T13:00:07Z</updated>
<author>
<name>Louis Chauvet</name>
</author>
<published>2024-11-18T18:28:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d6dc39e495678d54a8125e1ae08b3ca35c306426'/>
<id>urn:sha1:d6dc39e495678d54a8125e1ae08b3ca35c306426</id>
<content type='text'>
Introduce the usage of block_h/block_w to compute the offset and the
pointer of a pixel. The previous implementation was specialized for
planes with block_h == block_w == 1. To avoid confusion and allow easier
implementation of tiled formats. It also remove the usage of the
deprecated format field `cpp`.

Introduce the plane_index parameter to get an offset/pointer on a
different plane.

Acked-by: Maíra Canal &lt;mairacanal@riseup.net&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-5-2dbc2f1e222c@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Use const for input pointers in pixel_read an pixel_write functions</title>
<updated>2024-11-22T13:00:06Z</updated>
<author>
<name>Louis Chauvet</name>
</author>
<published>2024-11-18T18:28:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51091b4ab257887d9ab79d93078b7989abeeda6f'/>
<id>urn:sha1:51091b4ab257887d9ab79d93078b7989abeeda6f</id>
<content type='text'>
As the pixel_read and pixel_write function should never modify the input
buffer, mark those pointers const.

Reviewed-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Reviewed-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-4-2dbc2f1e222c@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions</title>
<updated>2024-11-22T13:00:06Z</updated>
<author>
<name>Louis Chauvet</name>
</author>
<published>2024-11-18T18:28:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b21b580e57924ce1e58cb15f96566f3a52af216d'/>
<id>urn:sha1:b21b580e57924ce1e58cb15f96566f3a52af216d</id>
<content type='text'>
Introduce two typedefs: pixel_read_t and pixel_write_t. It allows the
compiler to check if the passed functions take the correct arguments.
Such typedefs will help ensuring consistency across the code base in
case of update of these prototypes.

Rename input/output variable in a consistent way between read_line and
write_line.

A warn has been added in get_pixel_*_function to alert when an unsupported
pixel format is requested. As those formats are checked before
atomic_update callbacks, it should never happen.

Document for those typedefs.

Reviewed-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-3-2dbc2f1e222c@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
</entry>
</feed>
