<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/gpu/drm/vkms, branch linux-6.13.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>drm/vkms: Fix use after free and double free on init error</title>
<updated>2025-04-10T12:41:35+00:00</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2025-02-12T08:49:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b8a18bb53e06d6d3c1fd03d12533d6e333ba8853'/>
<id>b8a18bb53e06d6d3c1fd03d12533d6e333ba8853</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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Round fixp2int conversion in lerp_u16</title>
<updated>2025-03-22T19:56:51+00:00</updated>
<author>
<name>Harry Wentland</name>
<email>harry.wentland@amd.com</email>
</author>
<published>2024-12-20T04:33:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=16d35c2725857954a3adbea74f0aa2aaac880ab2'/>
<id>16d35c2725857954a3adbea74f0aa2aaac880ab2</id>
<content type='text'>
[ Upstream commit 8ec43c58d3be615a71548bc09148212013fb7e5f ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 8ec43c58d3be615a71548bc09148212013fb7e5f ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Remove usage of legacy drm_crtc members</title>
<updated>2024-11-04T14:27:49+00:00</updated>
<author>
<name>Louis Chauvet</name>
<email>louis.chauvet@bootlin.com</email>
</author>
<published>2024-10-03T15:41:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aafc45d5f88843a4645e1a53328a0601601d0c12'/>
<id>aafc45d5f88843a4645e1a53328a0601601d0c12</id>
<content type='text'>
Some members of the drm_crtc structure have been deprecated in favor of
equivalent members in the drm_crtc_state structure. As reported by Ville
Syrjala [1], the VKMS driver was still using these deprecated fields. This
commit updates the VKMS driver to use the new drm_crtc_state fields
instead.

Additionally, this commit removes the call to
`drm_calc_timestamping_constants` in `vkms_enable_vblank` as it is
redundant. This calculation is already performed in
`vkms_atomic_commit_tail` by calling
`drm_atomic_helper_commit_modeset_disables`.

[1]:https://lore.kernel.org/all/20241002182200.15363-1-ville.syrjala@linux.intel.com/

Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241003-remove-legacy-v1-1-0b7db1f1a1a6@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some members of the drm_crtc structure have been deprecated in favor of
equivalent members in the drm_crtc_state structure. As reported by Ville
Syrjala [1], the VKMS driver was still using these deprecated fields. This
commit updates the VKMS driver to use the new drm_crtc_state fields
instead.

Additionally, this commit removes the call to
`drm_calc_timestamping_constants` in `vkms_enable_vblank` as it is
redundant. This calculation is already performed in
`vkms_atomic_commit_tail` by calling
`drm_atomic_helper_commit_modeset_disables`.

[1]:https://lore.kernel.org/all/20241002182200.15363-1-ville.syrjala@linux.intel.com/

Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241003-remove-legacy-v1-1-0b7db1f1a1a6@bootlin.com
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Drop unnecessary call to drm_crtc_cleanup()</title>
<updated>2024-11-04T11:03:21+00:00</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2024-10-31T18:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1d43dddd7c38ea1aa93f78f7ee10087afb0a561f'/>
<id>1d43dddd7c38ea1aa93f78f7ee10087afb0a561f</id>
<content type='text'>
CRTC creation uses drmm_crtc_init_with_planes(), which automatically
handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is
still present in the vkms_output_init() error path.

Fixes: 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()")
Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Reviewed-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241031183835.3633-1-jose.exposito89@gmail.com
Acked-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CRTC creation uses drmm_crtc_init_with_planes(), which automatically
handles cleanup. However, an unnecessary call to drm_crtc_cleanup() is
still present in the vkms_output_init() error path.

Fixes: 99cc528ebe92 ("drm/vkms: Use drmm_crtc_init_with_planes()")
Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Reviewed-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241031183835.3633-1-jose.exposito89@gmail.com
Acked-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Run DRM default client setup</title>
<updated>2024-09-26T07:31:28+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2024-09-24T07:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7e31ad9bb0f59185dcb57fbe7e994865a6b7afe0'/>
<id>7e31ad9bb0f59185dcb57fbe7e994865a6b7afe0</id>
<content type='text'>
Call drm_client_setup() to run the kernel's default client setup
for DRM. Set fbdev_probe in struct drm_driver, so that the client
setup can start the common fbdev client.

v5:
- select DRM_CLIENT_SELECTION

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Cc: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Cc: "Maíra Canal" &lt;mairacanal@riseup.net&gt;
Cc: Haneen Mohammed &lt;hamohammed.sa@gmail.com&gt;
Acked-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-63-tzimmermann@suse.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Call drm_client_setup() to run the kernel's default client setup
for DRM. Set fbdev_probe in struct drm_driver, so that the client
setup can start the common fbdev client.

v5:
- select DRM_CLIENT_SELECTION

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Cc: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Cc: "Maíra Canal" &lt;mairacanal@riseup.net&gt;
Cc: Haneen Mohammed &lt;hamohammed.sa@gmail.com&gt;
Acked-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-63-tzimmermann@suse.de
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Add missing check for CRTC initialization</title>
<updated>2024-09-24T23:44:59+00:00</updated>
<author>
<name>Louis Chauvet</name>
<email>louis.chauvet@bootlin.com</email>
</author>
<published>2024-09-06T16:15:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2f7bd9d66e638e1ce4a20fea83c9d44c25c3dae8'/>
<id>2f7bd9d66e638e1ce4a20fea83c9d44c25c3dae8</id>
<content type='text'>
CRTC initialization call drm_mode_crtc_set_gamma_size without the proper
checks, introduce this check to avoid issues.

Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240906-vkms-add-missing-check-v1-1-1afb3bf3d0a6@bootlin.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CRTC initialization call drm_mode_crtc_set_gamma_size without the proper
checks, introduce this check to avoid issues.

Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240906-vkms-add-missing-check-v1-1-1afb3bf3d0a6@bootlin.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Suppress context imbalance detected by sparse warning</title>
<updated>2024-09-24T23:39:56+00:00</updated>
<author>
<name>Louis Chauvet</name>
<email>louis.chauvet@bootlin.com</email>
</author>
<published>2024-09-12T15:25:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2b75feb312894f87d0539d46eeb364f447df723f'/>
<id>2b75feb312894f87d0539d46eeb364f447df723f</id>
<content type='text'>
The functions `vkms_crtc_atomic_begin` and `vkms_crtc_atomic_flush` are
responsible for locking and unlocking a mutex, respectively. Add the
`__acquires` and `__releases` annotations to these functions to prevent
the associated sparse warning about context imbalance.

Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240912-vkms-warnings-v1-1-59f3e13ea8e5@bootlin.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The functions `vkms_crtc_atomic_begin` and `vkms_crtc_atomic_flush` are
responsible for locking and unlocking a mutex, respectively. Add the
`__acquires` and `__releases` annotations to these functions to prevent
the associated sparse warning about context imbalance.

Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240912-vkms-warnings-v1-1-59f3e13ea8e5@bootlin.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Add documentation</title>
<updated>2024-09-24T23:37:40+00:00</updated>
<author>
<name>Louis Chauvet</name>
<email>louis.chauvet@bootlin.com</email>
</author>
<published>2024-09-05T13:27:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6e5eb6dcb3042adcda432a3498d0d62d91588c4d'/>
<id>6e5eb6dcb3042adcda432a3498d0d62d91588c4d</id>
<content type='text'>
Add documentation around vkms_output and its initialization.
Add some documentation on pixel conversion functions.
Update of outdated comments for pixel_write functions.

Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240905-google-clarifications-v4-1-e43c1f2e3d87@bootlin.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add documentation around vkms_output and its initialization.
Add some documentation on pixel conversion functions.
Update of outdated comments for pixel_write functions.

Reviewed-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240905-google-clarifications-v4-1-e43c1f2e3d87@bootlin.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Formatting and typo fix</title>
<updated>2024-08-15T14:01:48+00:00</updated>
<author>
<name>Louis Chauvet</name>
<email>louis.chauvet@bootlin.com</email>
</author>
<published>2024-08-14T08:46:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a98a1a3c448820dfb3974839e1ccedf80b6fcacd'/>
<id>a98a1a3c448820dfb3974839e1ccedf80b6fcacd</id>
<content type='text'>
Some newlines were missing around comments.

Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240814-google-clarifications-v1-1-3ee76d7d0c28@bootlin.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some newlines were missing around comments.

Signed-off-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Signed-off-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240814-google-clarifications-v1-1-3ee76d7d0c28@bootlin.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vkms: Fix cpu_to_le16()/le16_to_cpu() warnings</title>
<updated>2024-08-08T08:04:13+00:00</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2024-07-16T16:17:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=17419a5c8c75e1f9de01b094f763ec1c6ad02979'/>
<id>17419a5c8c75e1f9de01b094f763ec1c6ad02979</id>
<content type='text'>
Building with Sparse enabled prints this warning for cpu_to_le16()
calls:

    warning: incorrect type in assignment (different base types)
        expected unsigned short [usertype]
        got restricted __le16 [usertype]

And this warning for le16_to_cpu() calls:

    warning: cast to restricted __le16

Declare the target buffer as __le16 to fix both warnings.

Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Acked-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240716161725.41408-2-jose.exposito89@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Building with Sparse enabled prints this warning for cpu_to_le16()
calls:

    warning: incorrect type in assignment (different base types)
        expected unsigned short [usertype]
        got restricted __le16 [usertype]

And this warning for le16_to_cpu() calls:

    warning: cast to restricted __le16

Declare the target buffer as __le16 to fix both warnings.

Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Louis Chauvet &lt;louis.chauvet@bootlin.com&gt;
Acked-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240716161725.41408-2-jose.exposito89@gmail.com
</pre>
</div>
</content>
</entry>
</feed>
