<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/vkms, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-10-07T16:58:30Z</updated>
<entry>
<title>drm/vkms: Avoid assigning 0 for possible_crtc</title>
<updated>2019-10-07T16:58:30Z</updated>
<author>
<name>Rodrigo Siqueira</name>
</author>
<published>2019-06-26T01:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bdcef6cd4c946cca8706baef4915d5af54d96e82'/>
<id>urn:sha1:bdcef6cd4c946cca8706baef4915d5af54d96e82</id>
<content type='text'>
[ Upstream commit e9d85f731de06a35d2ae6cdcf7d0e037c98ef41a ]

When vkms invoke drm_universal_plane_init(), it sets 0 for
possible_crtcs parameter which means that planes can't be attached to
any CRTC. It currently works due to some safeguard in the drm_crtc file;
however, it is possible to identify the problem by trying to append a
second connector. This patch fixes this issue by modifying
vkms_plane_init() to accept an index parameter which makes the code a
little bit more flexible and avoid set zero to possible_crtcs.

Signed-off-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/d67849c62a8d8ace1a0af455998b588798a4c45f.1561491964.git.rodrigosiqueiramelo@gmail.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Fix crc worker races</title>
<updated>2019-10-07T16:58:28Z</updated>
<author>
<name>Daniel Vetter</name>
</author>
<published>2019-06-06T22:27:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b66b85d544947d4588ad7fdfe14d38f89a6d15c1'/>
<id>urn:sha1:b66b85d544947d4588ad7fdfe14d38f89a6d15c1</id>
<content type='text'>
[ Upstream commit 18d0952a838ba559655b0cd9cf85097ad63d9bca ]

The issue we have is that the crc worker might fall behind. We've
tried to handle this by tracking both the earliest frame for which it
still needs to compute a crc, and the last one. Plus when the
crtc_state changes, we have a new work item, which are all run in
order due to the ordered workqueue we allocate for each vkms crtc.

Trouble is there's been a few small issues in the current code:
- we need to capture frame_end in the vblank hrtimer, not in the
  worker. The worker might run much later, and then we generate a lot
  of crc for which there's already a different worker queued up.
- frame number might be 0, so create a new crc_pending boolean to
  track this without confusion.
- we need to atomically grab frame_start/end and clear it, so do that
  all in one go. This is not going to create a new race, because if we
  race with the hrtimer then our work will be re-run.
- only race that can happen is the following:
  1. worker starts
  2. hrtimer runs and updates frame_end
  3. worker grabs frame_start/end, already reading the new frame_end,
  and clears crc_pending
  4. hrtimer calls queue_work()
  5. worker completes
  6. worker gets  re-run, crc_pending is false
  Explain this case a bit better by rewording the comment.

v2: Demote warning level output to debug when we fail to requeue, this
is expected under high load when the crc worker can't quite keep up.

Cc: Shayenne Moura &lt;shayenneluzmoura@gmail.com&gt;
Cc: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Cc: Haneen Mohammed &lt;hamohammed.sa@gmail.com&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Reviewed-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Tested-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Signed-off-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-2-daniel.vetter@ffwll.ch
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Forward timer right after drm_crtc_handle_vblank</title>
<updated>2019-07-31T05:24:37Z</updated>
<author>
<name>Daniel Vetter</name>
</author>
<published>2019-06-06T08:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee80886991a62c8e6f30b892c73d28252b6690fb'/>
<id>urn:sha1:ee80886991a62c8e6f30b892c73d28252b6690fb</id>
<content type='text'>
[ Upstream commit 7355965da22b8d9ebac8bce4b776399fb0bb9d32 ]

In

commit def35e7c592616bc09be328de8795e5e624a3cf8
Author: Shayenne Moura &lt;shayenneluzmoura@gmail.com&gt;
Date:   Wed Jan 30 14:06:36 2019 -0200

    drm/vkms: Bugfix extra vblank frame

we fixed the vblank counter to give accurate results outside of
drm_crtc_handle_vblank, which fixed bugs around vblank timestamps
being off-by-one and causing the vblank counter to jump when it
shouldn't.

The trouble is that this completely broke crc generation. Shayenne and
Rodrigo tracked this down to the vblank timestamp going backwards in
time somehow. Which then resulted in an underflow in drm_vblank.c
code, which resulted in all kinds of things breaking really badly.

The reason for this is that once we've called drm_crtc_handle_vblank
and the hrtimer isn't forwarded yet, we're returning a vblank
timestamp in the past. This race is really hard to hit since it's
small, except when you enable crc generation: In that case there's a
call to drm_crtc_accurate_vblank right in-betwen, so we're guaranteed
to hit the bug.

The fix is to roll the hrtimer forward _before_ we do the vblank
processing (which has a side-effect of incrementing the vblank
counter), and we always subtract one frame from the hrtimer - since
now it's always one frame in the future.

To make sure we don't hit this again also add a WARN_ON checking for
whether our timestamp is somehow moving into the past, which is never
should.

This also aligns more with how real hw works:
1. first all registers are updated with the new timestamp/vblank
counter values.
2. then an interrupt is generated
3. kernel interrupt handler eventually fires.

So doing this aligns vkms closer with what drm_vblank.c expects.
Document this also in a comment.

Cc: Shayenne Moura &lt;shayenneluzmoura@gmail.com&gt;
Cc: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Tested-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Reviewed-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Signed-off-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190606084404.12014-1-daniel.vetter@ffwll.ch
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Add SPDX license identifier - Makefile/Kconfig</title>
<updated>2019-05-21T08:50:46Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-05-19T12:07:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec8f24b7faaf3d4799a7c3f4c1b87f6b02778ad1'/>
<id>urn:sha1:ec8f24b7faaf3d4799a7c3f4c1b87f6b02778ad1</id>
<content type='text'>
Add SPDX license identifiers to all Make/Kconfig files which:

 - Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>BackMerge v5.1-rc5 into drm-next</title>
<updated>2019-04-15T05:51:49Z</updated>
<author>
<name>Dave Airlie</name>
</author>
<published>2019-04-15T05:51:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f06ddb53096b4cddad2c530125a78a3c2a1d28a4'/>
<id>urn:sha1:f06ddb53096b4cddad2c530125a78a3c2a1d28a4</id>
<content type='text'>
Need rc5 for udl fix to add udl cleanups on top.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm: vkms: check status of alloc_ordered_workqueue</title>
<updated>2019-03-25T08:33:42Z</updated>
<author>
<name>Kangjie Lu</name>
</author>
<published>2019-03-09T04:36:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=208c6e8cff1b96eca401adbd544ac00133df9e90'/>
<id>urn:sha1:208c6e8cff1b96eca401adbd544ac00133df9e90</id>
<content type='text'>
alloc_ordered_workqueue may fail and return NULL.
The fix returns ENOMEM when it fails to avoid potential NULL
pointer dereference.

Signed-off-by: Kangjie Lu &lt;kjlu@umn.edu&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190309043628.6078-1-kjlu@umn.edu
</content>
</entry>
<entry>
<title>drm/vkms: fix use-after-free when drm_gem_handle_create() fails</title>
<updated>2019-03-18T07:45:57Z</updated>
<author>
<name>Eric Biggers</name>
</author>
<published>2019-02-26T22:08:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36b6c9ed45afe89045973e8dee1b004dd5372d40'/>
<id>urn:sha1:36b6c9ed45afe89045973e8dee1b004dd5372d40</id>
<content type='text'>
If drm_gem_handle_create() fails in vkms_gem_create(), then the
vkms_gem_object is freed twice: once when the reference is dropped by
drm_gem_object_put_unlocked(), and again by the extra calls to
drm_gem_object_release() and kfree().

Fix it by skipping the second release and free.

This bug was originally found in the vgem driver by syzkaller using
fault injection, but I noticed it's also present in the vkms driver.

Fixes: 559e50fd34d1 ("drm/vkms: Add dumb operations")
Cc: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Cc: Haneen Mohammed &lt;hamohammed.sa@gmail.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Signed-off-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190226220858.214438-1-ebiggers@kernel.org
Signed-off-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
</content>
</entry>
<entry>
<title>Merge v5.0-rc7 into drm-next</title>
<updated>2019-02-18T03:27:15Z</updated>
<author>
<name>Dave Airlie</name>
</author>
<published>2019-02-18T03:27:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c06de56121e3ac0f0f1f4a081c041654ffcacd62'/>
<id>urn:sha1:c06de56121e3ac0f0f1f4a081c041654ffcacd62</id>
<content type='text'>
Backmerging for nouveau and imx that needed some fixes for next pulls.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/vkms: Fix license inconsistent</title>
<updated>2019-02-10T12:23:06Z</updated>
<author>
<name>Rodrigo Siqueira</name>
</author>
<published>2019-02-06T14:01:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fd56e0260a22c0cfaf9adb94a2427b76e239dd0'/>
<id>urn:sha1:7fd56e0260a22c0cfaf9adb94a2427b76e239dd0</id>
<content type='text'>
Fixes license inconsistent related to the VKMS driver and remove the
redundant boilerplate comment.

Fixes: 854502fa0a38 ("drm/vkms: Add basic CRTC initialization")

Cc: stable@vger.kernel.org
Signed-off-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190206140116.7qvy2lpwbcd7wds6@smtp.gmail.com
</content>
</entry>
<entry>
<title>drm/vkms: WARN when hrtimer_forward_now fails</title>
<updated>2019-02-10T11:51:11Z</updated>
<author>
<name>Shayenne Moura</name>
</author>
<published>2019-02-06T20:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09ef09b4ab95dc405ad4171ec2cd8a4ff5227108'/>
<id>urn:sha1:09ef09b4ab95dc405ad4171ec2cd8a4ff5227108</id>
<content type='text'>
Add a warn to verify the hrtimer_forward_now return and changes
ret_overrun from int to u64 to match the return value provided by
hrtimer_forward_now.

Signed-off-by: Shayenne Moura &lt;shayenneluzmoura@gmail.com&gt;
Signed-off-by: Rodrigo Siqueira &lt;rodrigosiqueiramelo@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190206200813.d5w7gjpepoeeadiy@smtp.gmail.com
</content>
</entry>
</feed>
