<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/gpu/drm/gud, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>drm/gud: fix out-of-bounds write in gud_plane_atomic_check()</title>
<updated>2026-09-12T12:56:44+00:00</updated>
<author>
<name>Sajal Gupta</name>
<email>sajal2005gupta@gmail.com</email>
</author>
<published>2026-09-02T12:30:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=59ced288fcba9e91bd38e61a972ad782c4edb7d0'/>
<id>59ced288fcba9e91bd38e61a972ad782c4edb7d0</id>
<content type='text'>
The plane property loop uses req-&gt;properties[num_properties + i] as write
index while simultaneously incrementing `num_properties` inside the loop.
At iteration i, num_properties has also incremented by i, so the write
is done at `initial_num_properties + 2*i`, skipping every other index and
advancing by 2 per iteration.

With just 2 connector and 32 plane properties the last write happens at
index 64, one slot past the end of the 64-slot (indices 0–63)
allocation. A USB device can trigger OOB by advertising the maximum
number of properties.

Fix by dropping the redundant `+ i`; num_properties is already the correct
running index, as gud_connector_fill_properties() fills the preceding
slots.

Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Link: https://sashiko.dev/#/patchset/20260821071812.16500-1-sajal2005gupta%40gmail.com?part=1
Signed-off-by: Sajal Gupta &lt;sajal2005gupta@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260902123254.36987-1-sajal2005gupta@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The plane property loop uses req-&gt;properties[num_properties + i] as write
index while simultaneously incrementing `num_properties` inside the loop.
At iteration i, num_properties has also incremented by i, so the write
is done at `initial_num_properties + 2*i`, skipping every other index and
advancing by 2 per iteration.

With just 2 connector and 32 plane properties the last write happens at
index 64, one slot past the end of the 64-slot (indices 0–63)
allocation. A USB device can trigger OOB by advertising the maximum
number of properties.

Fix by dropping the redundant `+ i`; num_properties is already the correct
running index, as gud_connector_fill_properties() fills the preceding
slots.

Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Link: https://sashiko.dev/#/patchset/20260821071812.16500-1-sajal2005gupta%40gmail.com?part=1
Signed-off-by: Sajal Gupta &lt;sajal2005gupta@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260902123254.36987-1-sajal2005gupta@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gud: Ignore damage clips in full update mode</title>
<updated>2026-09-12T12:52:10+00:00</updated>
<author>
<name>Sophie D</name>
<email>patches@scd31.com</email>
</author>
<published>2026-09-10T01:49:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=effce1cb87ee0d8b3a8cbe7722968f4ea7efd360'/>
<id>effce1cb87ee0d8b3a8cbe7722968f4ea7efd360</id>
<content type='text'>
When running in full update mode, previously small updates (such as
moving the mouse across the screen) would cause many full frames to be
generated. This would bog down the bus and lower the effective framerate
significantly - I was seeing a drop from 60 FPS to 2 FPS.

Set ignore_damage_clips in full update mode so the damage iterator
yields a single full-plane rectangle instead of one per clip.

Fixes: 73cfd166e045 ("drm/gud: Replace simple display pipe with DRM atomic helpers")
Cc: &lt;stable@vger.kernel.org&gt; # 6.18.x
Signed-off-by: Sophie D &lt;patches@scd31.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260910014910.8564-1-patches@scd31.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When running in full update mode, previously small updates (such as
moving the mouse across the screen) would cause many full frames to be
generated. This would bog down the bus and lower the effective framerate
significantly - I was seeing a drop from 60 FPS to 2 FPS.

Set ignore_damage_clips in full update mode so the damage iterator
yields a single full-plane rectangle instead of one per clip.

Fixes: 73cfd166e045 ("drm/gud: Replace simple display pipe with DRM atomic helpers")
Cc: &lt;stable@vger.kernel.org&gt; # 6.18.x
Signed-off-by: Sophie D &lt;patches@scd31.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260910014910.8564-1-patches@scd31.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gud: validate GUD_ROTATION_0 is present in supported rotations</title>
<updated>2026-08-23T16:35:13+00:00</updated>
<author>
<name>Sajal Gupta</name>
<email>sajal2005gupta@gmail.com</email>
</author>
<published>2026-08-21T07:16:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cb732d027aa18e1fcf9d2797f47d20b179ebc59c'/>
<id>cb732d027aa18e1fcf9d2797f47d20b179ebc59c</id>
<content type='text'>
The rotation argument to drm_plane_create_rotation_property() is set to
DRM_MODE_ROTATE_0, and the device reported rotation bitmask is used as
the supported_rotations argument. The driver never validates that
GUD_ROTATION_0 is present, so a device that omits it from its
GUD_PROPERTY_ROTATION triggers the
WARN_ON(rotation &amp; ~supported_rotations) in
drm_plane_create_rotation_property()

Fix this by skipping the creation of rotation property if the device
doesn't have the GUD_ROTATION_0 bit

Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=efe2810681f1b065d3a8
Tested-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
Signed-off-by: Sajal Gupta &lt;sajal2005gupta@gmail.com&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260821071812.16500-1-sajal2005gupta@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The rotation argument to drm_plane_create_rotation_property() is set to
DRM_MODE_ROTATE_0, and the device reported rotation bitmask is used as
the supported_rotations argument. The driver never validates that
GUD_ROTATION_0 is present, so a device that omits it from its
GUD_PROPERTY_ROTATION triggers the
WARN_ON(rotation &amp; ~supported_rotations) in
drm_plane_create_rotation_property()

Fix this by skipping the creation of rotation property if the device
doesn't have the GUD_ROTATION_0 bit

Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=efe2810681f1b065d3a8
Tested-by: syzbot+efe2810681f1b065d3a8@syzkaller.appspotmail.com
Signed-off-by: Sajal Gupta &lt;sajal2005gupta@gmail.com&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260821071812.16500-1-sajal2005gupta@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gud: validate TV mode names before creating enum property</title>
<updated>2026-08-23T16:20:00+00:00</updated>
<author>
<name>Tao Yu</name>
<email>tao1.yu@intel.com</email>
</author>
<published>2026-08-19T07:28:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da1ea35fea67ad841f4ada28dd61b41be65e5437'/>
<id>da1ea35fea67ad841f4ada28dd61b41be65e5437</id>
<content type='text'>
The GUD protocol returns TV mode names as fixed-size
GUD_CONNECTOR_TV_MODE_NAME_LEN entries and requires each name to be
NUL-terminated.

gud_connector_add_tv_mode() currently passes each fixed-size entry
directly to drm_mode_create_tv_properties_legacy(), which eventually
reaches drm_property_add_enum() and strlen(). If a device returns an
entry without a terminating NUL byte, strlen() reads past the end of
the slot and can run beyond the allocated buffer, triggering an
out-of-bounds read.

Validate that each returned TV mode name contains a NUL terminator
within its fixed-size slot before passing it to the DRM property code.
If a malformed entry is found, reject the device response with -EIO.

This fixes the out-of-bounds read without changing the handling of
valid devices, and avoids silently truncating malformed protocol data.

Reported-by: syzbot+9ae8e7884e451eaed5b4@syzkaller.appspotmail.com
Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Signed-off-by: Tao Yu &lt;tao1.yu@intel.com&gt;
Reviewed-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260819072835.4074130-1-tao1.yu@intel.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The GUD protocol returns TV mode names as fixed-size
GUD_CONNECTOR_TV_MODE_NAME_LEN entries and requires each name to be
NUL-terminated.

gud_connector_add_tv_mode() currently passes each fixed-size entry
directly to drm_mode_create_tv_properties_legacy(), which eventually
reaches drm_property_add_enum() and strlen(). If a device returns an
entry without a terminating NUL byte, strlen() reads past the end of
the slot and can run beyond the allocated buffer, triggering an
out-of-bounds read.

Validate that each returned TV mode name contains a NUL terminator
within its fixed-size slot before passing it to the DRM property code.
If a malformed entry is found, reject the device response with -EIO.

This fixes the out-of-bounds read without changing the handling of
valid devices, and avoids silently truncating malformed protocol data.

Reported-by: syzbot+9ae8e7884e451eaed5b4@syzkaller.appspotmail.com
Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Signed-off-by: Tao Yu &lt;tao1.yu@intel.com&gt;
Reviewed-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260819072835.4074130-1-tao1.yu@intel.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gud: NUL-terminate TV mode names read from the device</title>
<updated>2026-08-23T15:36:36+00:00</updated>
<author>
<name>Deepanshu Kartikey</name>
<email>kartikey406@gmail.com</email>
</author>
<published>2026-08-16T08:52:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=500cb24cd61bad8a2747ddfc49b7034899c82d94'/>
<id>500cb24cd61bad8a2747ddfc49b7034899c82d94</id>
<content type='text'>
gud_connector_add_tv_mode() reads a buffer of fixed-size mode names from
the USB device and passes pointers into it to
drm_mode_create_tv_properties_legacy(), which calls strlen() on each one.
Nothing guarantees the device NUL-terminates a name, so strlen() can run
past the end of a slot and, for the last mode, past the end of the
allocation.

Terminate each name at the end of its slot before use.

Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=916c888ba5f1a54c9526
Tested-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com
Signed-off-by: Deepanshu Kartikey &lt;kartikey406@gmail.com&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260816085234.22053-1-kartikey406@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gud_connector_add_tv_mode() reads a buffer of fixed-size mode names from
the USB device and passes pointers into it to
drm_mode_create_tv_properties_legacy(), which calls strlen() on each one.
Nothing guarantees the device NUL-terminates a name, so strlen() can run
past the end of a slot and, for the last mode, past the end of the
allocation.

Terminate each name at the end of its slot before use.

Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=916c888ba5f1a54c9526
Tested-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com
Signed-off-by: Deepanshu Kartikey &lt;kartikey406@gmail.com&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260816085234.22053-1-kartikey406@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gud: Add RCade Display Adapter VID/PID pair</title>
<updated>2026-05-12T06:35:00+00:00</updated>
<author>
<name>Sophie D</name>
<email>patches@scd31.com</email>
</author>
<published>2026-05-09T02:54:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ac5ac0acf11df04295eb1811066097b7022d6c7f'/>
<id>ac5ac0acf11df04295eb1811066097b7022d6c7f</id>
<content type='text'>
The RCade Display Adapter is a hardware device that allows driving an
Arcade CRT display via the GUD protocol. Currently it spoofs an
existing GUD VID/PID pair. However, now that it has its own pair
assigned, it makes sense to add this to the list of pairs that GUD
supports natively.

More information can be found in the project repositories:
https://gitlab.scd31.com/stephen/stm32-usb-vga-adapter-hardware
https://gitlab.scd31.com/stephen/stm32-usb-vga-rcade-adapter

Link: https://pid.codes/1209/4FB3/
Signed-off-by: Sophie D &lt;patches@scd31.com&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patch.msgid.link/20260509025405.4143956-1-patches@scd31.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The RCade Display Adapter is a hardware device that allows driving an
Arcade CRT display via the GUD protocol. Currently it spoofs an
existing GUD VID/PID pair. However, now that it has its own pair
assigned, it makes sense to add this to the list of pairs that GUD
supports natively.

More information can be found in the project repositories:
https://gitlab.scd31.com/stephen/stm32-usb-vga-adapter-hardware
https://gitlab.scd31.com/stephen/stm32-usb-vga-rcade-adapter

Link: https://pid.codes/1209/4FB3/
Signed-off-by: Sophie D &lt;patches@scd31.com&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patch.msgid.link/20260509025405.4143956-1-patches@scd31.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Rename struct drm_atomic_state to drm_atomic_commit</title>
<updated>2026-05-04T04:05:04+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>mripard@kernel.org</email>
</author>
<published>2026-04-27T07:02:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5164f7e7ff8ec7d41065d3862630c2ba09854328'/>
<id>5164f7e7ff8ec7d41065d3862630c2ba09854328</id>
<content type='text'>
The KMS framework uses two slightly different definitions for the state
concept. For a given object (plane, CRTC, encoder, etc., so
drm_$OBJECT_state), the state is the entire state of that object.
However, at the device level, drm_atomic_state refers to a state update
for a limited number of objects.

Thus, drm_atomic_state isn't the entire device state, but only the full
state of some objects in that device. This has been an endless source of
confusion and thus bugs.

We can rename the drm_atomic_state structure to drm_atomic_commit to
make it less confusing.

This patch was created using:

rg -l drm_atomic_state | \
	xargs sed -i 's/drm_atomic_state/drm_atomic_commit/g; s/drm_atomic_commit_helper/drm_atomic_state_helper/g'
mv drivers/gpu/drm/tests/drm_atomic_state_test.c drivers/gpu/drm/tests/drm_atomic_commit_test.c

Acked-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Acked-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Reviewed-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Tested-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: https://patch.msgid.link/20260427-drm-drm-atomic-update-v4-1-c0e713bfdf25@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The KMS framework uses two slightly different definitions for the state
concept. For a given object (plane, CRTC, encoder, etc., so
drm_$OBJECT_state), the state is the entire state of that object.
However, at the device level, drm_atomic_state refers to a state update
for a limited number of objects.

Thus, drm_atomic_state isn't the entire device state, but only the full
state of some objects in that device. This has been an endless source of
confusion and thus bugs.

We can rename the drm_atomic_state structure to drm_atomic_commit to
make it less confusing.

This patch was created using:

rg -l drm_atomic_state | \
	xargs sed -i 's/drm_atomic_state/drm_atomic_commit/g; s/drm_atomic_commit_helper/drm_atomic_state_helper/g'
mv drivers/gpu/drm/tests/drm_atomic_state_test.c drivers/gpu/drm/tests/drm_atomic_commit_test.c

Acked-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Acked-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Reviewed-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Tested-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Signed-off-by: Maxime Ripard &lt;mripard@kernel.org&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: https://patch.msgid.link/20260427-drm-drm-atomic-update-v4-1-c0e713bfdf25@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>BackMerge tag 'v7.0-rc4' into drm-next</title>
<updated>2026-03-25T23:41:26+00:00</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2026-03-25T23:41:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=13c072b8e91a5ccb5855ca1ba6fe3ea467dbf94d'/>
<id>13c072b8e91a5ccb5855ca1ba6fe3ea467dbf94d</id>
<content type='text'>
Linux 7.0-rc4

Needed for rust tree.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Linux 7.0-rc4

Needed for rust tree.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gud: fix NULL crtc dereference on display disable</title>
<updated>2026-03-08T20:20:30+00:00</updated>
<author>
<name>Shenghao Yang</name>
<email>me@shenghaoyang.info</email>
</author>
<published>2026-02-22T05:45:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7149be786da012afc6bae293d38f8c1fff1fb90d'/>
<id>7149be786da012afc6bae293d38f8c1fff1fb90d</id>
<content type='text'>
gud_plane_atomic_update() currently handles both crtc state and
framebuffer updates - the complexity has led to a few accidental
NULL pointer dereferences.

Commit dc2d5ddb193e ("drm/gud: fix NULL fb and crtc dereferences
on USB disconnect") [1] fixed an earlier dereference but planes
can also be disabled in non-hotplug paths (e.g. display disables
via the desktop environment). The drm_dev_enter() call would not
cause an early return in those and subsequently oops on
dereferencing crtc:

BUG: kernel NULL pointer dereference, address: 00000000000005c8
CPU: 6 UID: 1000 PID: 3473 Comm: kwin_wayland Not tainted 6.18.2-200.vanilla.gud.fc42.x86_64 #1 PREEMPT(lazy)
RIP: 0010:gud_plane_atomic_update+0x148/0x470 [gud]
 &lt;TASK&gt;
 drm_atomic_helper_commit_planes+0x28e/0x310
 drm_atomic_helper_commit_tail+0x2a/0x70
 commit_tail+0xf1/0x150
 drm_atomic_helper_commit+0x13c/0x180
 drm_atomic_commit+0xb1/0xe0
info ? __pfx___drm_printfn_info+0x10/0x10
 drm_mode_atomic_ioctl+0x70f/0x7c0
 ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
 drm_ioctl_kernel+0xae/0x100
 drm_ioctl+0x2a8/0x550
 ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
 __x64_sys_ioctl+0x97/0xe0
 do_syscall_64+0x7e/0x7f0
 ? __ct_user_enter+0x56/0xd0
 ? do_syscall_64+0x158/0x7f0
 ? __ct_user_enter+0x56/0xd0
 ? do_syscall_64+0x158/0x7f0
 entry_SYSCALL_64_after_hwframe+0x76/0x7e

Split out crtc handling from gud_plane_atomic_update() into
atomic_enable() and atomic_disable() functions to delegate
crtc state transitioning work to the DRM helpers.

To preserve the gud state commit sequence [2], switch to
the runtime PM version of drm_atomic_helper_commit_tail() which
ensures that crtcs are enabled (hence sending the
GUD_REQ_SET_CONTROLLER_ENABLE and GUD_REQ_SET_DISPLAY_ENABLE
requests) before a framebuffer update is sent.

[1] https://lore.kernel.org/all/20251231055039.44266-1-me@shenghaoyang.info/
[2] https://github.com/notro/gud/wiki/GUD-Protocol#display-state

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Closes: https://lore.kernel.org/r/202601142159.0v8ilfVs-lkp@intel.com/
Fixes: 73cfd166e045 ("drm/gud: Replace simple display pipe with DRM atomic helpers")
Cc: &lt;stable@vger.kernel.org&gt; # 6.19.x
Cc: &lt;stable@vger.kernel.org&gt; # 6.18.x
Signed-off-by: Shenghao Yang &lt;me@shenghaoyang.info&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260222054551.80864-1-me@shenghaoyang.info
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gud_plane_atomic_update() currently handles both crtc state and
framebuffer updates - the complexity has led to a few accidental
NULL pointer dereferences.

Commit dc2d5ddb193e ("drm/gud: fix NULL fb and crtc dereferences
on USB disconnect") [1] fixed an earlier dereference but planes
can also be disabled in non-hotplug paths (e.g. display disables
via the desktop environment). The drm_dev_enter() call would not
cause an early return in those and subsequently oops on
dereferencing crtc:

BUG: kernel NULL pointer dereference, address: 00000000000005c8
CPU: 6 UID: 1000 PID: 3473 Comm: kwin_wayland Not tainted 6.18.2-200.vanilla.gud.fc42.x86_64 #1 PREEMPT(lazy)
RIP: 0010:gud_plane_atomic_update+0x148/0x470 [gud]
 &lt;TASK&gt;
 drm_atomic_helper_commit_planes+0x28e/0x310
 drm_atomic_helper_commit_tail+0x2a/0x70
 commit_tail+0xf1/0x150
 drm_atomic_helper_commit+0x13c/0x180
 drm_atomic_commit+0xb1/0xe0
info ? __pfx___drm_printfn_info+0x10/0x10
 drm_mode_atomic_ioctl+0x70f/0x7c0
 ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
 drm_ioctl_kernel+0xae/0x100
 drm_ioctl+0x2a8/0x550
 ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
 __x64_sys_ioctl+0x97/0xe0
 do_syscall_64+0x7e/0x7f0
 ? __ct_user_enter+0x56/0xd0
 ? do_syscall_64+0x158/0x7f0
 ? __ct_user_enter+0x56/0xd0
 ? do_syscall_64+0x158/0x7f0
 entry_SYSCALL_64_after_hwframe+0x76/0x7e

Split out crtc handling from gud_plane_atomic_update() into
atomic_enable() and atomic_disable() functions to delegate
crtc state transitioning work to the DRM helpers.

To preserve the gud state commit sequence [2], switch to
the runtime PM version of drm_atomic_helper_commit_tail() which
ensures that crtcs are enabled (hence sending the
GUD_REQ_SET_CONTROLLER_ENABLE and GUD_REQ_SET_DISPLAY_ENABLE
requests) before a framebuffer update is sent.

[1] https://lore.kernel.org/all/20251231055039.44266-1-me@shenghaoyang.info/
[2] https://github.com/notro/gud/wiki/GUD-Protocol#display-state

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Closes: https://lore.kernel.org/r/202601142159.0v8ilfVs-lkp@intel.com/
Fixes: 73cfd166e045 ("drm/gud: Replace simple display pipe with DRM atomic helpers")
Cc: &lt;stable@vger.kernel.org&gt; # 6.19.x
Cc: &lt;stable@vger.kernel.org&gt; # 6.18.x
Signed-off-by: Shenghao Yang &lt;me@shenghaoyang.info&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Signed-off-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260222054551.80864-1-me@shenghaoyang.info
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gud: Test for imported buffers with drm_gem_is_imported()</title>
<updated>2026-03-05T07:14:09+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2026-02-27T13:31:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2e20c8951e4bb5f4a828aed39813599980353b6'/>
<id>d2e20c8951e4bb5f4a828aed39813599980353b6</id>
<content type='text'>
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test. The test itself does not change.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Ruben Wauters &lt;rubenru09@aol.com&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260227133113.235940-4-tzimmermann@suse.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test. The test itself does not change.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Ruben Wauters &lt;rubenru09@aol.com&gt;
Acked-by: Ruben Wauters &lt;rubenru09@aol.com&gt;
Link: https://patch.msgid.link/20260227133113.235940-4-tzimmermann@suse.de
</pre>
</div>
</content>
</entry>
</feed>
