<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/dma-buf/dma-buf.c, branch linux-4.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-04-18T04:59:35Z</updated>
<entry>
<title>dma-buf: add support for compat ioctl</title>
<updated>2017-04-18T04:59:35Z</updated>
<author>
<name>Marek Szyprowski</name>
</author>
<published>2017-02-21T13:21:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2ef9c8dd6ecd15dfa2e67a7a037bf47307c3e6bd'/>
<id>urn:sha1:2ef9c8dd6ecd15dfa2e67a7a037bf47307c3e6bd</id>
<content type='text'>
commit 888022c0473d079bff9b47fb50434b1f20f8f37f upstream.

Add compat ioctl support to dma-buf. This lets one to use DMA_BUF_IOCTL_SYNC
ioctl from 32bit application on 64bit kernel. Data structures for both 32
and 64bit modes are same, so there is no need for additional translation
layer.

Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1487683261-2655-1-git-send-email-m.szyprowski@samsung.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dma-buf: Rename struct fence to dma_fence</title>
<updated>2016-10-25T12:40:39Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-10-25T12:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f54d1867005c3323f5d8ad83eed823e84226c429'/>
<id>urn:sha1:f54d1867005c3323f5d8ad83eed823e84226c429</id>
<content type='text'>
I plan to usurp the short name of struct fence for a core kernel struct,
and so I need to rename the specialised fence/timeline for DMA
operations to make room.

A consensus was reached in
https://lists.freedesktop.org/archives/dri-devel/2016-July/113083.html
that making clear this fence applies to DMA operations was a good thing.
Since then the patch has grown a bit as usage increases, so hopefully it
remains a good thing!

(v2...: rebase, rerun spatch)
v3: Compile on msm, spotted a manual fixup that I broke.
v4: Try again for msm, sorry Daniel

coccinelle script:
@@

@@
- struct fence
+ struct dma_fence
@@

@@
- struct fence_ops
+ struct dma_fence_ops
@@

@@
- struct fence_cb
+ struct dma_fence_cb
@@

@@
- struct fence_array
+ struct dma_fence_array
@@

@@
- enum fence_flag_bits
+ enum dma_fence_flag_bits
@@

@@
(
- fence_init
+ dma_fence_init
|
- fence_release
+ dma_fence_release
|
- fence_free
+ dma_fence_free
|
- fence_get
+ dma_fence_get
|
- fence_get_rcu
+ dma_fence_get_rcu
|
- fence_put
+ dma_fence_put
|
- fence_signal
+ dma_fence_signal
|
- fence_signal_locked
+ dma_fence_signal_locked
|
- fence_default_wait
+ dma_fence_default_wait
|
- fence_add_callback
+ dma_fence_add_callback
|
- fence_remove_callback
+ dma_fence_remove_callback
|
- fence_enable_sw_signaling
+ dma_fence_enable_sw_signaling
|
- fence_is_signaled_locked
+ dma_fence_is_signaled_locked
|
- fence_is_signaled
+ dma_fence_is_signaled
|
- fence_is_later
+ dma_fence_is_later
|
- fence_later
+ dma_fence_later
|
- fence_wait_timeout
+ dma_fence_wait_timeout
|
- fence_wait_any_timeout
+ dma_fence_wait_any_timeout
|
- fence_wait
+ dma_fence_wait
|
- fence_context_alloc
+ dma_fence_context_alloc
|
- fence_array_create
+ dma_fence_array_create
|
- to_fence_array
+ to_dma_fence_array
|
- fence_is_array
+ dma_fence_is_array
|
- trace_fence_emit
+ trace_dma_fence_emit
|
- FENCE_TRACE
+ DMA_FENCE_TRACE
|
- FENCE_WARN
+ DMA_FENCE_WARN
|
- FENCE_ERR
+ DMA_FENCE_ERR
)
 (
 ...
 )

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Acked-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20161025120045.28839-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>dma-buf: Wait on the reservation object when sync'ing before CPU access</title>
<updated>2016-08-16T07:01:35Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-08-15T15:42:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae4e46b14bd7a12fb7908425846be7ceb0853bbc'/>
<id>urn:sha1:ae4e46b14bd7a12fb7908425846be7ceb0853bbc</id>
<content type='text'>
Rendering operations to the dma-buf are tracked implicitly via the
reservation_object (dmabuf-&gt;resv). This is used to allow poll() to
wait upon outstanding rendering (or just query the current status of
rendering). The dma-buf sync ioctl allows userspace to prepare the
dma-buf for CPU access, which should include waiting upon rendering.
(Some drivers may need to do more work to ensure that the dma-buf mmap
is coherent as well as complete.)

v2: Always wait upon the reservation object implicitly. We choose to do
it after the native handler in case it can do so more efficiently.

Testcase: igt/prime_vgem
Testcase: igt/gem_concurrent_blit # *vgem*
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1471275738-31994-1-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>dma-buf: Release module reference on creation failure</title>
<updated>2016-07-18T12:10:49Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-07-18T11:16:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a026df4c5fa6bae8eb03b58be720b911494e3da5'/>
<id>urn:sha1:a026df4c5fa6bae8eb03b58be720b911494e3da5</id>
<content type='text'>
If we fail to create the anon file, we need to remember to release the
module reference on the owner.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Cc: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1468840582-21469-1-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>dma-buf: remove dma_buf_debugfs_create_file()</title>
<updated>2016-06-20T16:56:37Z</updated>
<author>
<name>Mathias Krause</name>
</author>
<published>2016-06-19T12:31:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bd3e22088f41a16b4c362622c91243f9f4fd7dcb'/>
<id>urn:sha1:bd3e22088f41a16b4c362622c91243f9f4fd7dcb</id>
<content type='text'>
There is only a single user of dma_buf_debugfs_create_file() and that
one got the function pointer cast wrong. With that one fixed, there is
no need to have a wrapper for debugfs_create_file(), just call it
directly.

With no users left, we can remove dma_buf_debugfs_create_file().

While at it, simplify the error handling in dma_buf_init_debugfs()
slightly.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1466339491-12639-2-git-send-email-minipli@googlemail.com
</content>
</entry>
<entry>
<title>dma-buf: remove dma_buf directory on bufinfo file creation errors</title>
<updated>2016-06-20T16:56:36Z</updated>
<author>
<name>Mathias Krause</name>
</author>
<published>2016-06-19T12:31:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b7479990435713b00870df3c1d98ff66f6ef1ba2'/>
<id>urn:sha1:b7479990435713b00870df3c1d98ff66f6ef1ba2</id>
<content type='text'>
Change the error handling in dma_buf_init_debugfs() to remove the
"dma_buf" directory if creating the "bufinfo" file fails. No need to
have an empty debugfs directory around.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
</entry>
<entry>
<title>dma-buf: propagate errors from dma_buf_describe() on debugfs read</title>
<updated>2016-06-20T16:56:36Z</updated>
<author>
<name>Mathias Krause</name>
</author>
<published>2016-06-19T12:31:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb0b947e3bf59d263f5bc7c080ce40333b515004'/>
<id>urn:sha1:eb0b947e3bf59d263f5bc7c080ce40333b515004</id>
<content type='text'>
The callback function dma_buf_describe() returns an int not void so the
function pointer cast in dma_buf_show() is wrong. dma_buf_describe() can
also fail when acquiring the mutex gets interrupted so always returning
0 in dma_buf_show() is wrong, too.

Fix both issues by avoiding the indirection via dma_buf_show() and call
dma_buf_describe() directly. Rename it to dma_buf_debug_show() to get it
in line with the other functions.

This type mismatch was caught by the PaX RAP plugin.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Brad Spengler &lt;spender@grsecurity.net&gt;
Cc: PaX Team &lt;pageexec@freemail.hu&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
</entry>
<entry>
<title>dma-buf: use vma_pages()</title>
<updated>2016-05-31T16:47:05Z</updated>
<author>
<name>Muhammad Falak R Wani</name>
</author>
<published>2016-05-23T11:38:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b02da6f8236148009c22167cd7013d5ce04a2d37'/>
<id>urn:sha1:b02da6f8236148009c22167cd7013d5ce04a2d37</id>
<content type='text'>
Replace explicit computation of vma page count by a call to
vma_pages().
Also, include &lt;linux/mm.h&gt;

Signed-off-by: Muhammad Falak R Wani &lt;falakreyaz@gmail.com&gt;
Reviewed-by: Eric Engestrom &lt;eric.engestrom@imgtec.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
</entry>
<entry>
<title>dma-buf: Update docs for SYNC ioctl</title>
<updated>2016-03-21T08:26:45Z</updated>
<author>
<name>Daniel Vetter</name>
</author>
<published>2016-03-21T07:24:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87e332d56b2c7dc6733f690c9069f4fe75f21c9d'/>
<id>urn:sha1:87e332d56b2c7dc6733f690c9069f4fe75f21c9d</id>
<content type='text'>
Just a bit of wording polish plus mentioning that it can fail and must
be restarted.

Requested by Sumit.

v2: Fix them typos (Hans).

Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tiago Vignatti &lt;tiago.vignatti@intel.com&gt;
Cc: Stéphane Marchesin &lt;marcheu@chromium.org&gt;
Cc: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
CC: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: intel-gfx@lists.freedesktop.org
Cc: devel@driverdev.osuosl.org
Cc: Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
Acked-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
</content>
</entry>
<entry>
<title>dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access()</title>
<updated>2016-03-19T10:03:49Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-03-18T20:02:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18b862dcd57a3e23e34c8cd1e939f68548c1209a'/>
<id>urn:sha1:18b862dcd57a3e23e34c8cd1e939f68548c1209a</id>
<content type='text'>
Drivers, especially i915.ko, can fail during the initial migration of a
dma-buf for CPU access. However, the error code from the driver was not
being propagated back to ioctl and so userspace was blissfully ignorant
of the failure. Rendering corruption ensues.

Whilst fixing the ioctl to return the error code from
dma_buf_start_cpu_access(), also do the same for
dma_buf_end_cpu_access().  For most drivers, dma_buf_end_cpu_access()
cannot fail. i915.ko however, as most drivers would, wants to avoid being
uninterruptible (as would be required to guarrantee no failure when
flushing the buffer to the device). As userspace already has to handle
errors from the SYNC_IOCTL, take advantage of this to be able to restart
the syscall across signals.

This fixes a coherency issue for i915.ko as well as reducing the
uninterruptible hold upon its BKL, the struct_mutex.

Fixes commit c11e391da2a8fe973c3c2398452000bed505851e
Author: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Date:   Thu Feb 11 20:04:51 2016 -0200

    dma-buf: Add ioctls to allow userspace to flush

Testcase: igt/gem_concurrent_blit/*dmabuf*interruptible
Testcase: igt/prime_mmap_coherency/ioctl-errors
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tiago Vignatti &lt;tiago.vignatti@intel.com&gt;
Cc: Stéphane Marchesin &lt;marcheu@chromium.org&gt;
Cc: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
CC: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: intel-gfx@lists.freedesktop.org
Cc: devel@driverdev.osuosl.org
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1458331359-2634-1-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
</feed>
