<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/drm_plane.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-02-23T07:12:42Z</updated>
<entry>
<title>drm: Don't unref the same fb many times by mistake due to deadlock handling</title>
<updated>2024-02-23T07:12:42Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2023-12-11T08:16:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=376e21a9e4c2c63ee5d8d3aa74be5082c3882229'/>
<id>urn:sha1:376e21a9e4c2c63ee5d8d3aa74be5082c3882229</id>
<content type='text'>
commit cb4daf271302d71a6b9a7c01bd0b6d76febd8f0c upstream.

If we get a deadlock after the fb lookup in drm_mode_page_flip_ioctl()
we proceed to unref the fb and then retry the whole thing from the top.
But we forget to reset the fb pointer back to NULL, and so if we then
get another error during the retry, before the fb lookup, we proceed
the unref the same fb again without having gotten another reference.
The end result is that the fb will (eventually) end up being freed
while it's still in use.

Reset fb to NULL once we've unreffed it to avoid doing it again
until we've done another fb lookup.

This turned out to be pretty easy to hit on a DG2 when doing async
flips (and CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y). The first symptom I
saw that drm_closefb() simply got stuck in a busy loop while walking
the framebuffer list. Fortunately I was able to convince it to oops
instead, and from there it was easier to track down the culprit.

Cc: stable@vger.kernel.org
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20231211081625.25704-1-ville.syrjala@linux.intel.com
Acked-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/plane: Move range check for format_count earlier</title>
<updated>2022-06-14T14:59:16Z</updated>
<author>
<name>Steven Price</name>
</author>
<published>2021-12-03T10:28:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4ab7e453a3ee88c274cf97bee9487ab92a66d313'/>
<id>urn:sha1:4ab7e453a3ee88c274cf97bee9487ab92a66d313</id>
<content type='text'>
[ Upstream commit 4b674dd69701c2e22e8e7770c1706a69f3b17269 ]

While the check for format_count &gt; 64 in __drm_universal_plane_init()
shouldn't be hit (it's a WARN_ON), in its current position it will then
leak the plane-&gt;format_types array and fail to call
drm_mode_object_unregister() leaking the modeset identifier. Move it to
the start of the function to avoid allocating those resources in the
first place.

Signed-off-by: Steven Price &lt;steven.price@arm.com&gt;
Signed-off-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Link: https://lore.kernel.org/dri-devel/20211203102815.38624-1-steven.price@arm.com/
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/lease: Make sure implicit planes are leased</title>
<updated>2019-06-09T07:17:23Z</updated>
<author>
<name>Daniel Vetter</name>
</author>
<published>2019-02-28T14:49:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=390a0fd31b02f2f7086af2f3bdb8ae576b9a4b84'/>
<id>urn:sha1:390a0fd31b02f2f7086af2f3bdb8ae576b9a4b84</id>
<content type='text'>
commit 204f640da6914844b3270b41b29c84f6e3b74083 upstream.

If userspace doesn't enable universal planes, then we automatically
add the primary and cursor planes. But for universal userspace there's
no such check (and maybe we only want to give the lessee one plane,
maybe not even the primary one), hence we need to check for the
implied plane.

v2: don't forget setcrtc ioctl.

v3: Still allow disabling of the crtc in SETCRTC.

Cc: stable@vger.kernel.org
Cc: Keith Packard &lt;keithp@keithp.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@collabora.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190228144910.26488-6-daniel.vetter@ffwll.ch
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drm: Auto-set allow_fb_modifiers when given modifiers at plane init</title>
<updated>2019-04-05T20:33:15Z</updated>
<author>
<name>Paul Kocialkowski</name>
</author>
<published>2019-01-04T08:56:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d377200482b570b55ea4340bed85377c929eac5'/>
<id>urn:sha1:1d377200482b570b55ea4340bed85377c929eac5</id>
<content type='text'>
[ Upstream commit 890880ddfdbe256083170866e49c87618b706ac7 ]

When drivers pass non-empty lists of modifiers for initializing their
planes, we can infer that they allow framebuffer modifiers and set the
driver's allow_fb_modifiers mode config element.

In case the allow_fb_modifiers element was not set (some drivers tend
to set them after registering planes), the modifiers will still be
registered but won't be available to userspace unless the flag is set
later. However in that case, the IN_FORMATS blob won't be created.

In order to avoid this case and generally reduce the trouble associated
with the flag, always set allow_fb_modifiers when a non-empty list of
format modifiers is passed at plane init.

Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Paul Kocialkowski &lt;paul.kocialkowski@bootlin.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190104085610.5829-1-paul.kocialkowski@bootlin.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm: Introduce __setplane_atomic()</title>
<updated>2018-07-13T14:58:19Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2018-07-05T18:59:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7695eb6ea70ed143fafbcd12ce69886be3aa03d'/>
<id>urn:sha1:e7695eb6ea70ed143fafbcd12ce69886be3aa03d</id>
<content type='text'>
All the plane-&gt;fb/old_fb/crtc dance of __setplane_internal() is
pointless on atomic drivers. So let's just introduce a simpler
version that skips all that.

Ideally we could also skip the __setplane_check() as
drm_atomic_plane_check() already checks for everything, but the
legacy cursor/"async" .update_plane() tricks bypass that so
we still need to call __setplane_check(). Toss in a FIXME to
remind someone to clean this up later.

v2: Use drm_drv_uses_atomic_modeset() (Daniel)

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180705185907.9524-1-ville.syrjala@linux.intel.com
</content>
</entry>
<entry>
<title>drm: Extract __setplane_check()</title>
<updated>2018-07-13T14:58:19Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2018-06-28T13:54:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4dd4677c2d3d34a2bcd511c088da4535ea58e360'/>
<id>urn:sha1:4dd4677c2d3d34a2bcd511c088da4535ea58e360</id>
<content type='text'>
Pull all the error checking out from __set_plane_internal() to a helper
function. We'll have another user of this soon.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180628135457.14647-1-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm: Add checks for atomic_[duplicate/destroy]_state with atomic drivers</title>
<updated>2018-06-18T07:20:51Z</updated>
<author>
<name>Haneen Mohammed</name>
</author>
<published>2018-05-25T01:25:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ba1f665f161ce112a2703649317bfdc9b6521613'/>
<id>urn:sha1:ba1f665f161ce112a2703649317bfdc9b6521613</id>
<content type='text'>
This patch add checks for atomic_[duplicate/destroy]_state of
drm_[connector/crtc/plane]_funcs for atomic drivers in the relevant
drm_*_init functions since these callback are mandatory for atomic drivers.

Update the kerneldoc comments for those callbacks.

Signed-off-by: Haneen Mohammed &lt;hamohammed.sa@gmail.com&gt;
Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180525012555.GA8448@haneen-vb
</content>
</entry>
<entry>
<title>drm: Stop updating plane-&gt;crtc/fb/old_fb on atomic drivers</title>
<updated>2018-06-11T17:22:44Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2018-05-25T18:50:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e00fb8564ee98c5c3a72c74b1a27e441abff6cca'/>
<id>urn:sha1:e00fb8564ee98c5c3a72c74b1a27e441abff6cca</id>
<content type='text'>
Stop playing around with plane-&gt;crtc/fb/old_fb with atomic
drivers. Make life a lot simpler when we don't have to do the
magic old_fb vs. fb dance around plane updates. That way we
can't risk plane-&gt;fb getting out of sync with plane-&gt;state-&gt;fb
and we're less likely to leak any refcounts as well.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Acked-by: Harry Wentland &lt;harry.wentland@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180525185045.29689-14-ville.syrjala@linux.intel.com
Reviewed-by: Sinclair Yeh &lt;syeh@vmware.com&gt;
</content>
</entry>
<entry>
<title>drm: Trust format_mod_supported() when it OKs a plane modifier.</title>
<updated>2018-05-31T18:19:04Z</updated>
<author>
<name>Eric Anholt</name>
</author>
<published>2018-03-16T22:04:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8fb756dfa273bcb42bdaff65baae83548b6c326d'/>
<id>urn:sha1:8fb756dfa273bcb42bdaff65baae83548b6c326d</id>
<content type='text'>
For parameterized modifiers (Broadcom's SAND and UIF), we need to
allow the parameter fields to be filled in, while exposing only the
variant of the modifier with the parameter unfilled in the internal
arrays and the format blob.

Signed-off-by: Eric Anholt &lt;eric@anholt.net&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-1-eric@anholt.net
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>drm: Use plane-&gt;state-&gt;fb over plane-&gt;fb</title>
<updated>2018-03-29T16:14:21Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2018-03-22T15:22:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a36c027db57b6a33970c5c830a0d143f0e98c248'/>
<id>urn:sha1:a36c027db57b6a33970c5c830a0d143f0e98c248</id>
<content type='text'>
Stop looking at plane-&gt;fb on atomic drivers. Use plane-&gt;state-&gt;fb
instead.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-9-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
</content>
</entry>
</feed>
