<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/drm_fops.c, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-12-08T01:04:26Z</updated>
<entry>
<title>Back merge tag 'v4.4-rc4' into drm-next</title>
<updated>2015-12-08T01:04:26Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2015-12-08T01:04:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e876b41ab074561d65f213bf5e0fc68cf5bc7380'/>
<id>urn:sha1:e876b41ab074561d65f213bf5e0fc68cf5bc7380</id>
<content type='text'>
We've picked up a few conflicts and it would be nice
to resolve them before we move onwards.
</content>
</entry>
<entry>
<title>drm: Fix an unwanted master inheritance v2</title>
<updated>2015-12-04T02:28:14Z</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2015-12-02T17:24:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0af2e538c80f3e47f1d6ddf120a153ad909e8ad'/>
<id>urn:sha1:a0af2e538c80f3e47f1d6ddf120a153ad909e8ad</id>
<content type='text'>
A client calling drmSetMaster() using a file descriptor that was opened
when another client was master would inherit the latter client's master
object and all its authenticated clients.

This is unwanted behaviour, and when this happens, instead allocate a
brand new master object for the client calling drmSetMaster().

Fixes a BUG() throw in vmw_master_set().

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm: Serialise multiple event readers</title>
<updated>2015-11-26T14:21:27Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2015-11-25T14:39:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9b2c0b7fb4ce79566d830d03ce7aa11cccc39f97'/>
<id>urn:sha1:9b2c0b7fb4ce79566d830d03ce7aa11cccc39f97</id>
<content type='text'>
The previous patch reintroduced a race condition whereby a failure in
one reader may allow a second reader to see out-of-order events.
Introduce a mutex to serialise readers so that an event is completed in
its entirety before another reader may process an event. The two readers
may race against each other, but the events each retrieves are in the
correct order.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1448462343-2072-2-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm: Drop dev-&gt;event_lock spinlock around faulting copy_to_user()</title>
<updated>2015-11-26T14:21:06Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2015-11-25T14:39:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=83eb64c85b80959549c114365016276f318afeb2'/>
<id>urn:sha1:83eb64c85b80959549c114365016276f318afeb2</id>
<content type='text'>
In

commit cdd1cf799bd24ac0a4184549601ae302267301c5
Author: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Date:   Thu Dec 4 21:03:25 2014 +0000

    drm: Make drm_read() more robust against multithreaded races

I fixed the races by serialising the use of the event by extending the
dev-&gt;event_lock. However, as Thomas pointed out, the copy_to_user() may
fault (even the __copy_to_user_inatomic() variant used here) and calling
into the driver backend with the spinlock held is bad news. Therefore we
have to drop the spinlock before the copy, but that exposes us to the
old race whereby a second reader could see an out-of-order event (as the
first reader may claim the first request but fail to copy it back to
userspace and so on returning it to the event list it will be behind the
current event being copied by the second reader).

Reported-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1448462343-2072-1-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/mode: Add user blob-creation ioctl</title>
<updated>2015-05-22T14:18:28Z</updated>
<author>
<name>Daniel Stone</name>
<email>daniels@collabora.com</email>
</author>
<published>2015-05-22T12:34:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2f5d2ea479b9b2619965d43db70939589afe43a'/>
<id>urn:sha1:e2f5d2ea479b9b2619965d43db70939589afe43a</id>
<content type='text'>
Add an ioctl which allows users to create blob properties from supplied
data. Currently this only supports modes, creating a drm_display_mode from
the userspace drm_mode_modeinfo.

v2: Removed size/type checks.
    Rebased on new patches to allow error propagation from create_blob,
    as well as avoiding double-allocation.

Signed-off-by: Daniel Stone &lt;daniels@collabora.com&gt;
Reviewed-by: Maarten Lankhorst &lt;maarten.lankhorst@intel.com&gt;
Tested-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm: simplify authentication management</title>
<updated>2015-05-05T07:45:57Z</updated>
<author>
<name>David Herrmann</name>
<email>dh.herrmann@gmail.com</email>
</author>
<published>2015-05-04T19:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=32e7b94a3fa8e137aab9f2c65dff86be73245fc8'/>
<id>urn:sha1:32e7b94a3fa8e137aab9f2c65dff86be73245fc8</id>
<content type='text'>
The magic auth tokens we have are a simple map from cyclic IDs to drm_file
objects. Remove all the old bulk of code and replace it with a simple,
direct IDR.

The previous behavior is kept. Especially calling authmagic multiple times
on the same magic results in EINVAL except on the first call. The only
difference in behavior is that we never allocate IDs multiple times as
long as a client has its FD open.

v2:
 - Fix return code of GetMagic()
 - Use non-cyclic IDR allocator
 - fix off-by-one in "magic &gt; INT_MAX" sanity check

v3:
 - drop redundant "magic &gt; INT_MAX" check

Signed-off-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm: Make drm_read() more robust against multithreaded races</title>
<updated>2015-01-21T13:57:03Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2014-12-04T21:03:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdd1cf799bd24ac0a4184549601ae302267301c5'/>
<id>urn:sha1:cdd1cf799bd24ac0a4184549601ae302267301c5</id>
<content type='text'>
The current implementation of drm_read() faces a number of issues:

1. Upon an error, it consumes the event which may lead to the client
blocking.
2. Upon an error, it forgets about events already copied
3. If it fails to copy a single event with O_NONBLOCK it falls into a
infinite loop of reporting EAGAIN.
3. There is a race between multiple waiters and blocking reads of the
events list.

Here, we inline drm_dequeue_event() into drm_read() so that we can take
the spinlock around the list walking and event copying, and importantly
reorder the error handling to avoid the issues above.

Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Testcase: igt/drm_read
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm: Fix memory leak at error path of drm_read()</title>
<updated>2014-12-04T12:28:42Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2014-12-04T10:56:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0a0bde32a4668656cdffac677032a101c170c6b'/>
<id>urn:sha1:a0a0bde32a4668656cdffac677032a101c170c6b</id>
<content type='text'>
Note that the read manpages explicitly states that the read position
is undefined on error. Since EFAULT is just a userspace bug we are
therefore fine with just dropping the event on the floor.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
[danvet: Add note that just dropping the event is ok.]
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm: Implement O_NONBLOCK support on /dev/dri/cardN</title>
<updated>2014-10-08T13:07:07Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2014-10-07T13:13:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bd008e5b2953186fc0c6633a885ade95e7043800'/>
<id>urn:sha1:bd008e5b2953186fc0c6633a885ade95e7043800</id>
<content type='text'>
The implmentation is simple in the extreme: we only want to wait for
events if the device was opened in blocking mode, otherwise we grab what
is available and report an error if there was none.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Testcase: igt/kms_flip/nonblocing_read
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/core: use helper to check driver features</title>
<updated>2014-10-03T08:38:56Z</updated>
<author>
<name>Andrzej Hajda</name>
<email>a.hajda@samsung.com</email>
</author>
<published>2014-09-30T14:49:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1bcecfacde6269dc6cee9a098bc454222d441ff9'/>
<id>urn:sha1:1bcecfacde6269dc6cee9a098bc454222d441ff9</id>
<content type='text'>
The patch replaces direct access to driver_features field
by calls to helper function.

Signed-off-by: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
</feed>
