<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/drm/drm_atomic.h, branch linux-4.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.15.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.15.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2018-02-28T09:21:38Z</updated>
<entry>
<title>drm/atomic: Fix memleak on ERESTARTSYS during non-blocking commits</title>
<updated>2018-02-28T09:21:38Z</updated>
<author>
<name>Leo (Sunpeng) Li</name>
<email>sunpeng.li@amd.com</email>
</author>
<published>2018-01-17T11:51:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d9076e2789f00dd8fea022b90949db21cd7f64ad'/>
<id>urn:sha1:d9076e2789f00dd8fea022b90949db21cd7f64ad</id>
<content type='text'>
commit 54f809cfbd6b4a43959039f5d33596ed3297ce16 upstream.

During a non-blocking commit, it is possible to return before the
commit_tail work is queued (-ERESTARTSYS, for example).

Since a reference on the crtc commit object is obtained for the pending
vblank event when preparing the commit, the above situation will leave
us with an extra reference.

Therefore, if the commit_tail worker has not consumed the event at the
end of a commit, release it's reference.

Changes since v1:
- Also check for state-&gt;event-&gt;base.completion being set, to
  handle the case where stall_checks() fails in setup_crtc_commit().
Changes since v2:
- Add a flag to drm_crtc_commit, to prevent dereferencing a freed event.
  i915 may unreference the state in a worker.

Fixes: 24835e442f28 ("drm: reference count event-&gt;completion")
Cc: &lt;stable@vger.kernel.org&gt; # v4.11+
Signed-off-by: Leo (Sunpeng) Li &lt;sunpeng.li@amd.com&gt;
Acked-by: Harry Wentland &lt;harry.wentland@amd.com&gt; #v1
Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180117115108.29608-1-maarten.lankhorst@linux.intel.com
Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drm/atomic: Make atomic iterators less surprising</title>
<updated>2017-10-06T09:06:11Z</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-09-27T08:35:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=331494eb51002d0ee99414e3918e06d5e9a3962d'/>
<id>urn:sha1:331494eb51002d0ee99414e3918e06d5e9a3962d</id>
<content type='text'>
Commit 669c9215afea ("drm/atomic: Make async plane update checks work as
intended, v2.") assumed incorrectly that if only 1 plane is matched in
the loop, the variables will be set to that plane. In reality we reset
them to NULL every time a new plane was iterated. This behavior is
surprising, so fix this by making the for loops only assign the
variables on a match.

When we have not added all the planes/crtc/connector to the state, and
there's a few NULL ones after the last one we iterated, te assumption
is broken that the pointers will hold the values from the last loop
iteration, which holds true for all other for_each macros we're using.
Except of course the iterator pointer itself, but that one really is
entirely internal.

Cc: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Fixes: 669c9215afea ("drm/atomic: Make async plane update checks work as intended, v2.")
Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-2-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
</content>
</entry>
<entry>
<title>drm/atomic: Remove unneeded null check for private objects</title>
<updated>2017-10-06T09:05:50Z</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-09-27T08:35:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f0d2e86c1b9ecd9cbe967b94e2f0d197f30cb3e7'/>
<id>urn:sha1:f0d2e86c1b9ecd9cbe967b94e2f0d197f30cb3e7</id>
<content type='text'>
It can be seen in drm_atomic_get_private_obj_state() that
ptr will never be NULL, so skip the check for that case.

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-1-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/atomic: Remove deprecated accessor macros</title>
<updated>2017-09-08T08:39:37Z</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-07-19T14:39:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=77ac3b00b13185741effd0d5e2f1f05e4bfef7dc'/>
<id>urn:sha1:77ac3b00b13185741effd0d5e2f1f05e4bfef7dc</id>
<content type='text'>
Now that the last users have been converted, we can finally get rid of
for_each_obj_in_state, we have better macros to replace them with.

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: Jani Nikula &lt;jani.nikula@linux.intel.com&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170719143920.25685-8-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.</title>
<updated>2017-09-08T08:39:37Z</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-09-04T10:48:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=21a01abbe32a3cbeb903378a24e504bfd9fe0648'/>
<id>urn:sha1:21a01abbe32a3cbeb903378a24e504bfd9fe0648</id>
<content type='text'>
Currently we neatly track the crtc state, but forget to look at
plane/connector state.

When doing a nonblocking modeset, immediately followed by a setprop
before the modeset completes, the setprop will see the modesets new
state as the old state and free it.

This has to be solved by waiting for hw_done on the connector, even
if it's not assigned to a crtc. When a connector is unbound we take
the last crtc commit, and when it stays unbound we create a new
fake crtc commit for that gets signaled on hw_done for all the
planes/connectors.

We wait for it the same way as we do for crtc's, which will make
sure we never run into a use-after-free situation.

Changes since v1:
- Only create a single disable commit. (danvet)
- Fix leak in intel_legacy_cursor_update.
Changes since v2:
- Make reference counting in drm_atomic_helper_setup_commit
  more obvious. (pinchartl)
- Call cleanup_done for fake commit. (danvet)
- Add comments to drm_atomic_helper_setup_commit. (danvet, pinchartl)
- Add comment to drm_atomic_helper_swap_state. (pinchartl)

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Testcase: kms_atomic_transition.plane-use-after-nonblocking-unbind*
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170904104838.23822-6-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/atomic: Move drm_crtc_commit to drm_crtc_state, v4.</title>
<updated>2017-09-08T08:39:37Z</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-09-04T15:04:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=163bcc2c74a22c891c1906e6e343e28a70a54978'/>
<id>urn:sha1:163bcc2c74a22c891c1906e6e343e28a70a54978</id>
<content type='text'>
Most code only cares about the current commit or previous commit.
Fortuantely we already have a place to track those. Move it to
drm_crtc_state where it belongs. :)

The per-crtc commit_list is kept for places where we have to look
deeper than the current or previous commit for checking whether to stall
on unpin. This is used in drm_atomic_helper_setup_commit and
intel_has_pending_fb_unpin.

Changes since v1:
- Update kerneldoc for drm_crtc.commit_list. (danvet)
Changes since v2:
- Remove drm_atomic_helper_async_check hunk. (pinchartl)
Changes since v3:
- Fix use-after-free in drm_atomic_helper_commit_cleanup_done().

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170904150456.31049-1-maarten.lankhorst@linux.intel.com
[mlankhorst: preceeding -&gt; preceding (checkpatch)]
</content>
</entry>
<entry>
<title>drm/atomic: Return commit in drm_crtc_commit_get for better annotation</title>
<updated>2017-09-08T08:39:37Z</updated>
<author>
<name>Maarten Lankhorst</name>
<email>maarten.lankhorst@linux.intel.com</email>
</author>
<published>2017-09-04T10:48:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f46640b931e588aeec5285b4a9547b354ad10cd0'/>
<id>urn:sha1:f46640b931e588aeec5285b4a9547b354ad10cd0</id>
<content type='text'>
This will allow code to do x-&gt;commit = drm_crtc_commit_get(commit),
making it clearer where references are used.

Signed-off-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170904104838.23822-5-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/atomic: Fix typo in kerneldoc</title>
<updated>2017-09-01T17:51:42Z</updated>
<author>
<name>Thierry Reding</name>
<email>treding@nvidia.com</email>
</author>
<published>2017-09-01T14:40:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=46ad42a3756d5e2078ed05bc99aa197815afac5d'/>
<id>urn:sha1:46ad42a3756d5e2078ed05bc99aa197815afac5d</id>
<content type='text'>
The for_each_crtc_in_state() is used to iterate over CRTCs rather than
connectors.

Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170901144042.6023-2-thierry.reding@gmail.com
</content>
</entry>
<entry>
<title>drm: Nuke drm_atomic_legacy_backoff</title>
<updated>2017-08-08T12:49:29Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-25T08:01:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=16fece0153d5b6573c3fcb8cfbe483f83ca8eb01'/>
<id>urn:sha1:16fece0153d5b6573c3fcb8cfbe483f83ca8eb01</id>
<content type='text'>
Finally all users are gone!

Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170725080122.20548-9-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm: Nuke drm_atomic_helper_connector_set_property</title>
<updated>2017-08-08T12:47:37Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-25T08:01:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=482b0e3c2fd73b5c27a4459638b682147ce8119e'/>
<id>urn:sha1:482b0e3c2fd73b5c27a4459638b682147ce8119e</id>
<content type='text'>
It's dead code, the core handles all this directly now. This also
allows us to unexport drm_atomic_helper_connector_set_property.

The only special case is nouveau which used one function for both
pre-nv50 legacy modeset code and post-nv50 atomic world instead of 2
vtables. But amounts to exactly the same.

What is rather strange here is how few drivers set this up, I suspect
the earlier patch to handle properties in the core did end up fixing a
pile of possible issues.

Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: Jani Nikula &lt;jani.nikula@linux.intel.com&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Ben Skeggs &lt;bskeggs@redhat.com&gt;
Cc: Benjamin Gaignard &lt;benjamin.gaignard@linaro.org&gt;
Cc: Vincent Abriou &lt;vincent.abriou@st.com&gt;
Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: intel-gfx@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170725080122.20548-7-daniel.vetter@ffwll.ch
Acked-by: Vincent Abriou &lt;vincent.abriou@st.com&gt;
</content>
</entry>
</feed>
