<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/gpu/drm/drm_client_modeset.c, branch linux-rolling-lts</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>drm/client: Do not destroy NULL modes</title>
<updated>2026-03-12T11:09:16+00:00</updated>
<author>
<name>Jonathan Cavitt</name>
<email>jonathan.cavitt@intel.com</email>
</author>
<published>2026-02-24T22:12:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4e3ca5f82346cc23c0a71f1ceb006115ff6b0745'/>
<id>4e3ca5f82346cc23c0a71f1ceb006115ff6b0745</id>
<content type='text'>
[ Upstream commit c601fd5414315fc515f746b499110e46272e7243 ]

'modes' in drm_client_modeset_probe may fail to kcalloc.  If this
occurs, we jump to 'out', calling modes_destroy on it, which
dereferences it.  This may result in a NULL pointer dereference in the
error case.  Prevent that.

Fixes: 3039cc0c0653 ("drm/client: Make copies of modes")
Signed-off-by: Jonathan Cavitt &lt;jonathan.cavitt@intel.com&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patch.msgid.link/20260224221227.69126-2-jonathan.cavitt@intel.com
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 c601fd5414315fc515f746b499110e46272e7243 ]

'modes' in drm_client_modeset_probe may fail to kcalloc.  If this
occurs, we jump to 'out', calling modes_destroy on it, which
dereferences it.  This may result in a NULL pointer dereference in the
error case.  Prevent that.

Fixes: 3039cc0c0653 ("drm/client: Make copies of modes")
Signed-off-by: Jonathan Cavitt &lt;jonathan.cavitt@intel.com&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patch.msgid.link/20260224221227.69126-2-jonathan.cavitt@intel.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: Include &lt;linux/export.h&gt;</title>
<updated>2025-06-16T07:02:29+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2025-06-12T12:09:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8b7a4b100c783218378a67a4113939f92b455104'/>
<id>8b7a4b100c783218378a67a4113939f92b455104</id>
<content type='text'>
Fixes the compile-time warnings

  drivers/gpu/drm/clients/drm_client_setup.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_client.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_client_event.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_client_modeset.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fb_helper.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fbdev_dma.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fbdev_shmem.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fbdev_ttm.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Fixes: a934a57a42f6 ("scripts/misc-check: check missing #include &lt;linux/export.h&gt; when W=1")
Reviewed-by: André Almeida &lt;andrealmeid@igalia.com&gt;
Cc: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Cc: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://lore.kernel.org/r/20250612121633.229222-5-tzimmermann@suse.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes the compile-time warnings

  drivers/gpu/drm/clients/drm_client_setup.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_client.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_client_event.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_client_modeset.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fb_helper.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fbdev_dma.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fbdev_shmem.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing
  drivers/gpu/drm/drm_fbdev_ttm.c: warning: EXPORT_SYMBOL() is used, but #include &lt;linux/export.h&gt; is missing

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Fixes: a934a57a42f6 ("scripts/misc-check: check missing #include &lt;linux/export.h&gt; when W=1")
Reviewed-by: André Almeida &lt;andrealmeid@igalia.com&gt;
Cc: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Cc: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://lore.kernel.org/r/20250612121633.229222-5-tzimmermann@suse.de
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: s/unsigned int i/int i/</title>
<updated>2025-03-13T16:33:57+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-02-28T21:14:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dbe74119ff71c00f2d863a32f72aab2d15e61c39'/>
<id>dbe74119ff71c00f2d863a32f72aab2d15e61c39</id>
<content type='text'>
Replace the 'unsigned int i' footguns with plain old signed
int. Avoids accidents if/when someone decides they need
to iterate backwards.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the 'unsigned int i' footguns with plain old signed
int. Avoids accidents if/when someone decides they need
to iterate backwards.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: Move variables to tighter scope</title>
<updated>2025-03-13T16:33:40+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-02-28T21:14:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c11acfe20c24f91588f1d9401f79da71a74fc5a1'/>
<id>c11acfe20c24f91588f1d9401f79da71a74fc5a1</id>
<content type='text'>
Bunch of variables are only needed inside loops and whatnot.
Move them to a tighter scope to make the code less confusing.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bunch of variables are only needed inside loops and whatnot.
Move them to a tighter scope to make the code less confusing.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: s/new_crtc/crtc/</title>
<updated>2025-03-13T16:33:31+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-02-28T21:14:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4e5613849ecde8c8c4b0cb4e7bfe25ba5d149020'/>
<id>4e5613849ecde8c8c4b0cb4e7bfe25ba5d149020</id>
<content type='text'>
Rename the 'new_crtc' variable to just 'crtc' in
drm_client_firmware_config(). We don't call any of the other
stuff in here new or old so this feels out of place.

v2: Rebase

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename the 'new_crtc' variable to just 'crtc' in
drm_client_firmware_config(). We don't call any of the other
stuff in here new or old so this feels out of place.

v2: Rebase

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: Stop using the legacy crtc-&gt;mode</title>
<updated>2025-03-13T16:33:11+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-02-28T21:14:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=82f9570b3563e9045c70658f474f11a48a21d4b9'/>
<id>82f9570b3563e9045c70658f474f11a48a21d4b9</id>
<content type='text'>
crtc-&gt;mode is legacy junk and shouldn't really be used with
atomic drivers.

Most (all?) atomic drivers do end up still calling
drm_atomic_helper_update_legacy_modeset_state() at some
point, so crtc-&gt;mode does still get populated, and this
does work for now. But now that the modes[] lifetime issues
have been sorted out we can just switch over to the
proper crtc-&gt;state-&gt;mode.

v2: Rebase

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
crtc-&gt;mode is legacy junk and shouldn't really be used with
atomic drivers.

Most (all?) atomic drivers do end up still calling
drm_atomic_helper_update_legacy_modeset_state() at some
point, so crtc-&gt;mode does still get populated, and this
does work for now. But now that the modes[] lifetime issues
have been sorted out we can just switch over to the
proper crtc-&gt;state-&gt;mode.

v2: Rebase

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: Make copies of modes</title>
<updated>2025-03-13T16:32:18+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-02-28T21:14:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3039cc0c0653c6e15130a8719c3237329a954670'/>
<id>3039cc0c0653c6e15130a8719c3237329a954670</id>
<content type='text'>
drm_client_firmware_config() is currently picking up the current
mode of the crtc via the legacy crtc-&gt;mode, which is not supposed
to be used by atomic drivers at all. We can't simply switch over
to the proper crtc-&gt;state-&gt;mode because we drop the crtc-&gt;mutex
(which protects crtc-&gt;state) before the mode gets used.

The most straightforward solution to extend the lifetime of
modes[] seem to be to make full copies of the modes.

And with this we can undo also commit 3eadd887dbac
("drm/client:Fully protect modes[] with dev-&gt;mode_config.mutex")
as the lifetime of modes[] no longer has anything to do with
that lock.

v2: Don't try to copy NULL modes
v3: Keep storing pointers and use drm_mode_{duplicate,destroy}()

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
drm_client_firmware_config() is currently picking up the current
mode of the crtc via the legacy crtc-&gt;mode, which is not supposed
to be used by atomic drivers at all. We can't simply switch over
to the proper crtc-&gt;state-&gt;mode because we drop the crtc-&gt;mutex
(which protects crtc-&gt;state) before the mode gets used.

The most straightforward solution to extend the lifetime of
modes[] seem to be to make full copies of the modes.

And with this we can undo also commit 3eadd887dbac
("drm/client:Fully protect modes[] with dev-&gt;mode_config.mutex")
as the lifetime of modes[] no longer has anything to do with
that lock.

v2: Don't try to copy NULL modes
v3: Keep storing pointers and use drm_mode_{duplicate,destroy}()

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: Streamline mode selection debugs</title>
<updated>2025-03-13T16:30:39+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-02-28T21:14:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7640a1c20f144eb933d981102b60080c8114d1d5'/>
<id>7640a1c20f144eb933d981102b60080c8114d1d5</id>
<content type='text'>
Get rid of all the redundant debugs and just wait until the end
to print which mode (and of which type) we picked.

Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-4-ville.syrjala@linux.intel.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Get rid of all the redundant debugs and just wait until the end
to print which mode (and of which type) we picked.

Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-4-ville.syrjala@linux.intel.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: Use array notation for function arguments</title>
<updated>2025-03-13T16:30:10+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-02-28T21:14:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b218e72b8ac2c11ccab4d41263dd0406d8291c6f'/>
<id>b218e72b8ac2c11ccab4d41263dd0406d8291c6f</id>
<content type='text'>
Use the array notation rather that the pointer notation for
function arguments. This makes it clear to the reader that
we are in fact dealing with an array rather than a single
pointer. Functionally the two are equivalent.

Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-3-ville.syrjala@linux.intel.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the array notation rather that the pointer notation for
function arguments. This makes it clear to the reader that
we are in fact dealing with an array rather than a single
pointer. Functionally the two are equivalent.

Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-3-ville.syrjala@linux.intel.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/client: Constify modes</title>
<updated>2025-03-13T16:29:33+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-03-03T09:38:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f68429691c938a2e9131faf2ab2a8f0563966ba1'/>
<id>f68429691c938a2e9131faf2ab2a8f0563966ba1</id>
<content type='text'>
The modes used by the client code live on the connectors' mode
lists, which are not owned by the client code, and thus it has
no business modifying the modes. Mark the modes const to make
that fact abundantly clear.

v2: Fix up the kunit test

Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250303093847.7698-1-ville.syrjala@linux.intel.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The modes used by the client code live on the connectors' mode
lists, which are not owned by the client code, and thus it has
no business modifying the modes. Mark the modes const to make
that fact abundantly clear.

v2: Fix up the kunit test

Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250303093847.7698-1-ville.syrjala@linux.intel.com
</pre>
</div>
</content>
</entry>
</feed>
