[PATCH] dma-buf: Update docs for SYNC ioctl

2016-03-29 Thread Tiago Vignatti
On 03/29/2016 06:47 AM, David Herrmann wrote: > Hi > > On Mon, Mar 28, 2016 at 9:42 PM, Tiago Vignatti > wrote: >> Do we have an agreement here after all? David? I need to know whether this >> fixup is okay to go cause I'll need to submit to Chrome OS then. >

[PATCH] dma-buf: Update docs for SYNC ioctl

2016-03-28 Thread Tiago Vignatti
On 03/23/2016 12:42 PM, Chris Wilson wrote: > On Wed, Mar 23, 2016 at 04:32:59PM +0100, David Herrmann wrote: >> Hi >> >> On Wed, Mar 23, 2016 at 12:56 PM, Chris Wilson >> wrote: >>> On Wed, Mar 23, 2016 at 12:30:42PM +0100, David Herrmann wrote: My question was rather about why we do this?

[PATCH] dma-buf: Update docs for SYNC ioctl

2016-03-21 Thread Tiago Vignatti
On 03/21/2016 04:51 AM, Daniel Vetter wrote: > 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 > Cc: Tiago Vignatti > Cc: Stéphane Marchesin >

[PATCH] dma-buf,drm,ion: Propagate error code from dma_buf_start_cpu_access()

2016-03-21 Thread Tiago Vignatti
Testcase: igt/gem_concurrent_blit/*dmabuf*interruptible > Testcase: igt/prime_mmap_coherency/ioctl-errors > Signed-off-by: Chris Wilson > Cc: Tiago Vignatti > Cc: Stéphane Marchesin > Cc: David Herrmann > Cc: Sumit Semwal > Cc: Daniel Vetter > CC: linux-media at vger.

[PATCH v3] prime_mmap_coherency: Add return error tests for prime sync ioctl

2016-03-18 Thread Tiago Vignatti
On 03/18/2016 03:11 PM, Daniel Vetter wrote: > On Fri, Mar 18, 2016 at 03:08:56PM -0300, Tiago Vignatti wrote: >> This patch adds ioctl-errors subtest to be used for exercising prime sync >> ioctl >> errors. >> >> The subtest constantly interrupts via signals a f

[PATCH v3] prime_mmap_coherency: Add return error tests for prime sync ioctl

2016-03-18 Thread Tiago Vignatti
-by: Tiago Vignatti --- tests/prime_mmap_coherency.c | 89 1 file changed, 89 insertions(+) diff --git a/tests/prime_mmap_coherency.c b/tests/prime_mmap_coherency.c index 180d8a4..d2b2a4f 100644 --- a/tests/prime_mmap_coherency.c +++ b/tests

[PATCH v2] prime_mmap_coherency: Add return error tests for prime sync ioctl

2016-03-17 Thread Tiago Vignatti
that in case of failure (e.g. in a case where the ioctl wouldn't try again in a return error) this test does not reliably catch the problem with 100% of accuracy. v2: fix prime sync direction when reading mmap'ed file. Cc: Chris Wilson Signed-off-by: Tiago Vignatti --- tests/prime_mmap_coherency.c | 87

[PATCH] prime_mmap_coherency: Add return error tests for prime sync ioctl

2016-03-17 Thread Tiago Vignatti
On 03/17/2016 06:01 PM, Chris Wilson wrote: > On Thu, Mar 17, 2016 at 03:18:03PM -0300, Tiago Vignatti wrote: >> This patch adds ioctl-errors subtest to be used for exercising prime sync >> ioctl >> errors. >> >> The subtest constantly interrupts via signals a f

[PATCH] prime_mmap_coherency: Add return error tests for prime sync ioctl

2016-03-17 Thread Tiago Vignatti
that in case of failure (e.g. in a case where the ioctl wouldn't try again in a return error) this test does not reliably catch the problem with 100% of accuracy. Cc: Chris Wilson Signed-off-by: Tiago Vignatti --- Chris, your unpolished dma-buf patch for adding return error into the ioctl calls lgtm. Let

[PATCH v9] dma-buf: Add ioctls to allow userspace to flush

2016-03-14 Thread Tiago Vignatti
On 03/05/2016 06:34 AM, Daniel Vetter wrote: > On Mon, Feb 29, 2016 at 03:02:09PM +, Chris Wilson wrote: >> On Mon, Feb 29, 2016 at 03:54:19PM +0100, Daniel Vetter wrote: >>> On Thu, Feb 25, 2016 at 06:01:22PM +, Chris Wilson wrote: >>>> On Thu, Feb 11, 2

[PATCH v9] dma-buf: Add ioctls to allow userspace to flush

2016-02-11 Thread Tiago Vignatti
älä Cc: David Herrmann Cc: Sumit Semwal Reviewed-by: Stéphane Marchesin Signed-off-by: Daniel Vetter Signed-off-by: Tiago Vignatti --- I left SYNC_START and SYNC_END exclusive, just how the logic was before. If we see an useful use case, maybe like the way David said, to store two fr

[PATCH v7 3/5] dma-buf: Add ioctls to allow userspace to flush

2016-02-11 Thread Tiago Vignatti
Thanks for reviewing, David. Please take a look in my comments in-line. On 02/09/2016 07:26 AM, David Herrmann wrote: > > On Tue, Dec 22, 2015 at 10:36 PM, Tiago Vignatti > wrote: >> From: Daniel Vetter >> >> The userspace might need some sort of cache coherency m

Direct userspace dma-buf mmap (v7)

2016-02-05 Thread Tiago Vignatti
On 02/04/2016 06:55 PM, Stéphane Marchesin wrote: > On Tue, Dec 22, 2015 at 1:36 PM, Tiago Vignatti > wrote: >> Hey back, >> >> Thank you Daniel, Chris, Alex and Thomas for reviewing the last series. I >> think I addressed most of the comments now in version 7, incl

[PATCH igt v7 6/6] tests: Add prime_mmap_coherency for cache coherency tests

2015-12-22 Thread Tiago Vignatti
respectively. Signed-off-by: Tiago Vignatti --- tests/Makefile.sources | 1 + tests/prime_mmap_coherency.c | 246 +++ 2 files changed, 247 insertions(+) create mode 100644 tests/prime_mmap_coherency.c diff --git a/tests/Makefile.sources b/tests

[PATCH igt v7 5/6] tests: Add kms_mmap_write_crc for cache coherency tests

2015-12-22 Thread Tiago Vignatti
nd provide options to disable sync. v4: use library's prime_sync_{start,end} instead. v7: use CPU hog instead and use testing rounds to catch the sync problems. Signed-off-by: Tiago Vignatti --- tests/Makefile.sources | 1 + tests/kms_mmap_write_c

[PATCH igt v7 4/6] lib: Add prime_sync_start and prime_sync_end helpers

2015-12-22 Thread Tiago Vignatti
This patch adds dma-buf mmap synchronization ioctls that can be used by tests for cache coherency management e.g. when CPU and GPU domains are being accessed through dma-buf at the same time. v7: add sync invalid flags test. Signed-off-by: Tiago Vignatti --- lib/ioctl_wrappers.c | 26

[PATCH igt v7 3/6] prime_mmap: Add basic tests to write in a bo using CPU

2015-12-22 Thread Tiago Vignatti
ing to use it as well, so make it public and available in the lib. v2: adds prime_handle_to_fd_with_mmap for skipping test in older kernels and test for invalid flags. Signed-off-by: Tiago Vignatti --- lib/ioctl_wrappers.c | 25 +++ lib/ioctl_wrappers.h | 4

[PATCH igt v7 2/6] prime_mmap: Add new test for calling mmap() on dma-buf fds

2015-12-22 Thread Tiago Vignatti
ne. v4 (Tiago): use synchronized userptr for testing. Add test for buffer overlapping. Signed-off-by: Rob Bradford Signed-off-by: Tiago Vignatti --- tests/Makefile.sources | 1 + tests/prime_mmap.c | 417 + 2 files changed, 418 insertions(+) creat

[PATCH igt v7 1/6] lib: Add gem_userptr and __gem_userptr helpers

2015-12-22 Thread Tiago Vignatti
in the caller; bring gem_userptr_sync back to gem_userptr_blits; added gtkdoc. Signed-off-by: Tiago Vignatti --- benchmarks/gem_userptr_benchmark.c | 55 +++- lib/ioctl_wrappers.c | 41 +++ lib/ioctl_wrappers.h | 13 + tests

[PATCH v7 5/5] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-12-22 Thread Tiago Vignatti
ved the WARN_ON. Reviewed-by: Chris Wilson Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index 8c9e

[PATCH v7 4/5] drm/i915: Implement end_cpu_access

2015-12-22 Thread Tiago Vignatti
to spit out when it ever happens. v2: disable interruption to make sure errors are reported. v3: update to the new end_cpu_access API. v7: use .write = false cause it doesn't need to know whether it's write. Reviewed-by: Chris Wilson Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915

[PATCH v7 3/5] dma-buf: Add ioctls to allow userspace to flush

2015-12-22 Thread Tiago Vignatti
mentation about the recommendation on using sync ioctls. v7 (Tiago): Alex' nit on flags definition and being even more wording in the doc about sync usage. Cc: Sumit Semwal Signed-off-by: Daniel Vetter Signed-off-by: Tiago Vignatti --- Documentation/dma-buf-sharing.txt | 21 ++- dr

[PATCH v7 2/5] dma-buf: Remove range-based flush

2015-12-22 Thread Tiago Vignatti
can use the upcoming dma-buf sync ioctl for such. Cc: Sumit Semwal Cc: Daniel Vetter Signed-off-by: Tiago Vignatti --- Documentation/dma-buf-sharing.txt | 19 --- drivers/dma-buf/dma-buf.c | 13 - drivers/gpu/drm/i915/i915_gem_dmabuf.c| 2

[PATCH v7 1/5] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-12-22 Thread Tiago Vignatti
ed-off-by: Tiago Vignatti --- drivers/gpu/drm/drm_prime.c | 10 +++--- include/uapi/drm/drm.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 27aa718..df6cdc7 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/d

Direct userspace dma-buf mmap (v7)

2015-12-22 Thread Tiago Vignatti
Hey back, Thank you Daniel, Chris, Alex and Thomas for reviewing the last series. I think I addressed most of the comments now in version 7, including: - being even more wording in the doc about sync usage. - pass .write = false always in i915 end_cpu_access. - add sync invalid flags test

[PATCH v6 3/5] dma-buf: Add ioctls to allow userspace to flush

2015-12-18 Thread Tiago Vignatti
On 12/17/2015 07:58 PM, Thomas Hellstrom wrote: > On 12/16/2015 11:25 PM, Tiago Vignatti wrote: >> From: Daniel Vetter >> >> The userspace might need some sort of cache coherency management e.g. when >> CPU >> and GPU domains are being accessed through dma-buf a

[PATCH v6 4/5] drm/i915: Implement end_cpu_access

2015-12-18 Thread Tiago Vignatti
On 12/18/2015 05:02 PM, Tiago Vignatti wrote: > On 12/17/2015 06:01 AM, Chris Wilson wrote: >> On Wed, Dec 16, 2015 at 08:25:36PM -0200, Tiago Vignatti wrote: >>> This function is meant to be used with dma-buf mmap, when finishing >>> the CPU >>> access of the

[PATCH v6 4/5] drm/i915: Implement end_cpu_access

2015-12-18 Thread Tiago Vignatti
On 12/17/2015 06:01 AM, Chris Wilson wrote: > On Wed, Dec 16, 2015 at 08:25:36PM -0200, Tiago Vignatti wrote: >> This function is meant to be used with dma-buf mmap, when finishing the CPU >> access of the mapped pointer. >> >> +static void i915_gem_end_cpu_access(st

[PATCH v6 3/5] dma-buf: Add ioctls to allow userspace to flush

2015-12-18 Thread Tiago Vignatti
On 12/17/2015 04:19 PM, Alex Deucher wrote: > On Wed, Dec 16, 2015 at 5:25 PM, Tiago Vignatti > wrote: >> From: Daniel Vetter >> >> The userspace might need some sort of cache coherency management e.g. when >> CPU >> and GPU domains are being acces

[PATCH igt v6 6/6] tests: Add prime_mmap_coherency for cache coherency tests

2015-12-16 Thread Tiago Vignatti
respectively. Signed-off-by: Tiago Vignatti --- tests/Makefile.sources | 1 + tests/prime_mmap_coherency.c | 246 +++ 2 files changed, 247 insertions(+) create mode 100644 tests/prime_mmap_coherency.c diff --git a/tests/Makefile.sources b/tests

[PATCH igt v6 5/6] tests: Add kms_mmap_write_crc for cache coherency tests

2015-12-16 Thread Tiago Vignatti
d. Signed-off-by: Tiago Vignatti --- tests/Makefile.sources | 1 + tests/kms_mmap_write_crc.c | 281 + 2 files changed, 282 insertions(+) create mode 100644 tests/kms_mmap_write_crc.c diff --git a/tests/Makefile.sources b/tests/Makefile.sources ind

[PATCH igt v6 4/6] lib: Add prime_sync_start and prime_sync_end helpers

2015-12-16 Thread Tiago Vignatti
This patch adds dma-buf mmap synchronization ioctls that can be used by tests for cache coherency management e.g. when CPU and GPU domains are being accessed through dma-buf at the same time. Signed-off-by: Tiago Vignatti --- lib/ioctl_wrappers.c | 26 ++ lib

[PATCH igt v6 3/6] prime_mmap: Add basic tests to write in a bo using CPU

2015-12-16 Thread Tiago Vignatti
ing to use it as well, so make it public and available in the lib. v2: adds prime_handle_to_fd_with_mmap for skipping test in older kernels and test for invalid flags. Signed-off-by: Tiago Vignatti --- lib/ioctl_wrappers.c | 25 +++ lib/ioctl_wrappers.h | 4

[PATCH igt v6 2/6] prime_mmap: Add new test for calling mmap() on dma-buf fds

2015-12-16 Thread Tiago Vignatti
ne. v4 (Tiago): use synchronized userptr for testing. Add test for buffer overlapping. Signed-off-by: Rob Bradford Signed-off-by: Tiago Vignatti --- tests/Makefile.sources | 1 + tests/prime_mmap.c | 417 + 2 files changed, 418 insertions(+) creat

[PATCH igt v6 1/6] lib: Add gem_userptr and __gem_userptr helpers

2015-12-16 Thread Tiago Vignatti
in the caller; bring gem_userptr_sync back to gem_userptr_blits; added gtkdoc. Signed-off-by: Tiago Vignatti --- benchmarks/gem_userptr_benchmark.c | 55 +++- lib/ioctl_wrappers.c | 41 +++ lib/ioctl_wrappers.h | 13 + tests

[PATCH v6 5/5] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-12-16 Thread Tiago Vignatti
ved the WARN_ON. Reviewed-by: Chris Wilson Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index 9dba

[PATCH v6 4/5] drm/i915: Implement end_cpu_access

2015-12-16 Thread Tiago Vignatti
to spit out when it ever happens. v2: disable interruption to make sure errors are reported. v3: update to the new end_cpu_access API. Reviewed-by: Chris Wilson Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 22 ++ 1 file changed, 22 insertions

[PATCH v6 3/5] dma-buf: Add ioctls to allow userspace to flush

2015-12-16 Thread Tiago Vignatti
mentation about the recommendation on using sync ioctls. Cc: Sumit Semwal Signed-off-by: Daniel Vetter Signed-off-by: Tiago Vignatti --- Documentation/dma-buf-sharing.txt | 22 +++- drivers/dma-buf/dma-buf.c | 43 +++ include/uapi/linux/

[PATCH v6 2/5] dma-buf: Remove range-based flush

2015-12-16 Thread Tiago Vignatti
can use the upcoming dma-buf sync ioctl for such. Cc: Sumit Semwal Cc: Daniel Vetter Signed-off-by: Tiago Vignatti --- Documentation/dma-buf-sharing.txt | 19 --- drivers/dma-buf/dma-buf.c | 13 - drivers/gpu/drm/i915/i915_gem_dmabuf.c| 2

[PATCH v6 1/5] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-12-16 Thread Tiago Vignatti
ed-off-by: Tiago Vignatti --- drivers/gpu/drm/drm_prime.c | 10 +++--- include/uapi/drm/drm.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 27aa718..df6cdc7 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/d

Direct userspace dma-buf mmap (v6)

2015-12-16 Thread Tiago Vignatti
ommits/dma-buf-mmap-v6 Tiago Daniel Thompson (1): drm: prime: Honour O_RDWR during prime-handle-to-fd Daniel Vetter (1): dma-buf: Add ioctls to allow userspace to flush Tiago Vignatti (3): dma-buf: Remove range-based flush drm/i915: Implement end_cpu_access drm/i915: Use CPU mapping for

[PATCH 3/6] dma-buf: Add ioctls to allow userspace to flush

2015-08-27 Thread Tiago Vignatti
On 08/27/2015 05:03 AM, Chris Wilson wrote: > On Wed, Aug 26, 2015 at 08:29:15PM -0300, Tiago Vignatti wrote: >> +#ifndef _DMA_BUF_UAPI_H_ >> +#define _DMA_BUF_UAPI_H_ >> + >> +enum dma_buf_sync_flags { >> +DMA_BUF_SYNC_READ = (1 << 0

[PATCH 3/6] dma-buf: Add ioctls to allow userspace to flush

2015-08-27 Thread Tiago Vignatti
On 08/27/2015 09:06 AM, Hwang, Dongseong wrote: > On Thu, Aug 27, 2015 at 2:29 AM, Tiago Vignatti >> +#define DMA_BUF_BASE 'b' > > 'b' is occupied by vme and qat driver; > https://github.com/torvalds/linux/blob/master/Documentation/ioctl/ioctl-number.txt#L201 I belie

[PATCH 1/6] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-08-27 Thread Tiago Vignatti
On 08/27/2015 01:36 PM, Emil Velikov wrote: > Hi all, > > On 27 August 2015 at 00:29, Tiago Vignatti > wrote: >> From: Daniel Thompson >> >> Currently DRM_IOCTL_PRIME_HANDLE_TO_FD rejects all flags except >> (DRM|O)_CLOEXEC making it difficult (maybe

[PATCH 6/6] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-08-26 Thread Tiago Vignatti
ved the WARN_ON. Reviewed-by: Chris Wilson Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index 9dba

[PATCH 5/6] drm/i915: Implement end_cpu_access

2015-08-26 Thread Tiago Vignatti
to spit out when it ever happens. v2: disable interruption to make sure errors are reported. v3: update to the new end_cpu_access API. Reviewed-by: Chris Wilson Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 22 ++ 1 file changed, 22 insertions

[PATCH 4/6] dma-buf: DRAFT: Make SYNC mandatory when userspace mmap

2015-08-26 Thread Tiago Vignatti
This is my (failed) attempt to make the SYNC_* mandatory. I've tried to revoke write access to the mapped region until begin_cpu_access is called. The tasklet schedule order seems alright but the whole logic is not working and I guess it's something related to the fs trick I'm trying to do with

[PATCH 3/6] dma-buf: Add ioctls to allow userspace to flush

2015-08-26 Thread Tiago Vignatti
n/end dma-buf functions. Check for overflows in start/length. v4 (Tiago): use 2d regions for sync. v5 (Tiago): forget about 2d regions (v4); use _IOW in DMA_BUF_IOCTL_SYNC and remove range information from struct dma_buf_sync. Cc: Sumit Semwal Signed-off-by: Daniel Vetter Signed-off-by: Tiago

[PATCH 2/6] dma-buf: Remove range-based flush

2015-08-26 Thread Tiago Vignatti
can use the upcoming dma-buf sync ioctl for such. Cc: Sumit Semwal Cc: Daniel Vetter Signed-off-by: Tiago Vignatti --- Documentation/dma-buf-sharing.txt | 19 --- drivers/dma-buf/dma-buf.c | 13 - drivers/gpu/drm/i915/i915_gem_dmabuf.c| 2

[PATCH 1/6] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-08-26 Thread Tiago Vignatti
ed-off-by: Tiago Vignatti --- drivers/gpu/drm/drm_prime.c | 10 +++--- include/uapi/drm/drm.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 27aa718..df6cdc7 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/d

[PATCH v5] mmap on the dma-buf directly

2015-08-26 Thread Tiago Vignatti
on the latter now. PTAL. Tiago Daniel Thompson (1): drm: prime: Honour O_RDWR during prime-handle-to-fd Daniel Vetter (1): dma-buf: Add ioctls to allow userspace to flush Tiago Vignatti (4): dma-buf: Remove range-based flush dma-buf: DRAFT: Make SYNC mandatory when userspace mmap drm

[PATCH v4] dma-buf: Add ioctls to allow userspace to flush

2015-08-26 Thread Tiago Vignatti
On 08/26/2015 11:51 AM, Daniel Vetter wrote: > On Wed, Aug 26, 2015 at 11:32:30AM -0300, Tiago Vignatti wrote: >> On 08/26/2015 09:58 AM, Daniel Vetter wrote: >>> The other is that right now there's no user nor implementation in sight >>> which actually does range-based

[PATCH v4] dma-buf: Add ioctls to allow userspace to flush

2015-08-26 Thread Tiago Vignatti
On 08/26/2015 09:58 AM, Daniel Vetter wrote: > The other is that right now there's no user nor implementation in sight > which actually does range-based flush optimizations, so I'm pretty much > expecting we'll get it wrong. Maybe instead we should go one step further > and remove the range from

[PATCH v4] dma-buf: Add ioctls to allow userspace to flush

2015-08-25 Thread Tiago Vignatti
sync. Cc: Sumit Semwal Signed-off-by: Daniel Vetter Signed-off-by: Tiago Vignatti --- I'm unable to test the 2d sync properly, because begin/end access in i915 don't track mapped range for nothing. Documentation/dma-buf-sharing.txt | 13 ++ drivers/dma-buf/dma-buf.c

about mmap dma-buf and sync

2015-08-25 Thread Tiago Vignatti
On 08/25/2015 06:30 AM, Thomas Hellstrom wrote: > On 08/25/2015 11:02 AM, Daniel Vetter wrote: >> I really feel like any kind of multi-range flush interface is feature >> bloat, and if we do it then we should only do it later on when there's a >> clear need for it. > > IMO all the use-cases so far

about mmap dma-buf and sync

2015-08-24 Thread Tiago Vignatti
On 08/24/2015 03:01 PM, Tiago Vignatti wrote: > yup, I think so. So IIUC the main changes needed for the drivers > implement 2D sync lies in the dma_buf_sync_2d structure only. I.e. > there's nothing really to be changed in the common code, right? Do we have any special requirements

about mmap dma-buf and sync

2015-08-24 Thread Tiago Vignatti
On 08/24/2015 02:42 PM, Thomas Hellstrom wrote: > On 08/24/2015 07:12 PM, Daniel Stone wrote: >> Hi, >> >> On 24 August 2015 at 18:10, Thomas Hellstrom >> wrote: >>> On 08/24/2015 07:04 PM, Daniel Stone wrote: On 24 August 2015 at 17:56, Thomas Hellstrom wrote: > On 08/24/2015

about mmap dma-buf and sync

2015-08-21 Thread Tiago Vignatti
Hi back! On 08/20/2015 03:48 AM, Thomas Hellstrom wrote: > Hi, Tiago! Something that the Chrome OS folks told me today is whether we could change the sync API to use a syscall for that instead. Reason for that is to eventually fit this in nicely in their sandbox architecture requirements, so

[PATCH] staging/android: Update ION TODO per LPC discussion

2015-08-21 Thread Tiago Vignatti
of ioctl that probably should go. > > Cc: Laura Abbott > Cc: sumit.semwal at linaro.org > Cc: laurent.pinchart at ideasonboard.com > Cc: ghackmann at google.com > Cc: robdclark at gmail.com > Cc: david.brown at arm.com > Cc: romlem at google.com > Cc: Tiago Vignatti > Signe

[PATCH 1/7] prime_mmap: Add new test for calling mmap() on dma-buf fds

2015-08-14 Thread Tiago Vignatti
Hi Daniel, On 08/13/2015 04:04 AM, Daniel Vetter wrote: > On Wed, Aug 12, 2015 at 08:29:14PM -0300, Tiago Vignatti wrote: >> +/* Map too big */ >> +handle = gem_create(fd, BO_SIZE); >> +fill_bo(handle, BO_SIZE); >> +dma_buf_fd = prime_handle_to_fd(fd,

[PATCH 3/7] prime_mmap: Add basic tests to write in a bo using CPU

2015-08-13 Thread Tiago Vignatti
On 08/13/2015 04:01 AM, Daniel Vetter wrote: > On Wed, Aug 12, 2015 at 08:29:16PM -0300, Tiago Vignatti wrote: >> This patch adds test_correct_cpu_write, which maps the texture buffer >> through a >> prime fd and then writes directly to it using the CPU. It stresses the d

[PATCH v4] mmap on the dma-buf directly

2015-08-13 Thread Tiago Vignatti
On 08/13/2015 08:09 AM, Thomas Hellstrom wrote: > Tiago, > > I take it, this is intended to be a generic interface used mostly for 2D > rendering. yup. "generic" is an important point that I've actually forgot to mention in the description, which is probably the whole motivation for bringing

[PATCH 7/7] tests/kms_mmap_write_crc: Demonstrate the need for end_cpu_access

2015-08-12 Thread Tiago Vignatti
It requires i915 changes to add end_cpu_access(). Signed-off-by: Tiago Vignatti --- tests/kms_mmap_write_crc.c | 63 -- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/tests/kms_mmap_write_crc.c b/tests/kms_mmap_write_crc.c index

[PATCH 6/7] tests: Add kms_mmap_write_crc for cache coherency tests

2015-08-12 Thread Tiago Vignatti
Signed-off-by: Tiago Vignatti --- tests/.gitignore | 1 + tests/Makefile.sources | 1 + tests/kms_mmap_write_crc.c | 236 + 3 files changed, 238 insertions(+) create mode 100644 tests/kms_mmap_write_crc.c diff --git a/tests/.gitigno

[PATCH 5/7] prime_mmap: Test for userptr mmap

2015-08-12 Thread Tiago Vignatti
A userptr doesn't have the obj->base.filp, but can be exported via dma-buf, so make sure it fails when mmaping. Signed-off-by: Tiago Vignatti --- In machine, export the handle to fd is actually returning error and falling before the actual test happens. Same issue happens in gem_userptr_blit

[PATCH 4/7] lib: Add gem_userptr helpers

2015-08-12 Thread Tiago Vignatti
This patch moves userptr definitions and helpers implementation that were locally in gem_userptr_benchmark and gem_userptr_blits to the library, so other tests can make use of them as well. There's no functional changes. Signed-off-by: Tiago Vignatti --- benchmarks/gem_userptr_benchmark.c | 45

[PATCH 3/7] prime_mmap: Add basic tests to write in a bo using CPU

2015-08-12 Thread Tiago Vignatti
in the GPU process ("priviledged process"). This requires kernel modifications (Daniel Thompson's "drm: prime: Honour O_RDWR during prime-handle-to-fd"). Signed-off-by: Tiago Vignatti --- lib/ioctl_wrappers.c | 5 +++- tests/prime_mmap.c | 65 +++

[PATCH 2/7] prime_mmap: Fix a few misc stuff

2015-08-12 Thread Tiago Vignatti
- Remove pattern_check(), which was walking through a useless iterator - Remove superfluous PROT_WRITE from gem_mmap, in test_correct() - Add binary file to .gitignore Signed-off-by: Tiago Vignatti --- tests/.gitignore | 1 + tests/prime_mmap.c | 37 - 2

[PATCH 1/7] prime_mmap: Add new test for calling mmap() on dma-buf fds

2015-08-12 Thread Tiago Vignatti
unting checks for buffer reference counting - test_dup chats that dup()ing the fd works - test_errors checks the error return values for failures - test_aperture_limit tests multiple buffer creation at the gtt aperture limit Signed-off-by: Rob Bradford Signed-off-by: Tiago Vignatti ---

[PATCH 4/4] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-08-12 Thread Tiago Vignatti
ved the WARN_ON. Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index 8447ba4..ecd00d6 100644 --- a/drivers/

[PATCH 3/4] drm/i915: Implement end_cpu_access

2015-08-12 Thread Tiago Vignatti
Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index e9c2bfd..8447ba4 100644 --- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c

[PATCH 2/4] dma-buf: Add ioctls to allow userspace to flush

2015-08-12 Thread Tiago Vignatti
n/end dma-buf functions. Check for overflows in start/length. Cc: Sumit Semwal Signed-off-by: Daniel Vetter Signed-off-by: Tiago Vignatti --- Documentation/dma-buf-sharing.txt | 12 ++ drivers/dma-buf/dma-buf.c | 50 +++ include/uapi/linux/

[PATCH 1/4] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-08-12 Thread Tiago Vignatti
relax the restriction and permit read/write access. This is safe because the flags are seldom touched by drm; mostly they are passed verbatim to dma_buf calls. v3 (Tiago): removed unused flags variable from drm_prime_handle_to_fd_ioctl. Signed-off-by: Daniel Thompson Signed-off-by: Tiago Vignatti --- d

[PATCH v4] mmap on the dma-buf directly

2015-08-12 Thread Tiago Vignatti
w userspace to flush Tiago Vignatti (2): drm/i915: Implement end_cpu_access drm/i915: Use CPU mapping for userspace dma-buf mmap() Documentation/dma-buf-sharing.txt | 12 drivers/dma-buf/dma-buf.c | 50 ++ drivers/gpu/drm/drm_pri

[PATCH i-g-t 5/5] tests/kms_mmap_write_crc: Demonstrate the need for end_cpu_access

2015-08-11 Thread Tiago Vignatti
It requires i915 changes to add end_cpu_access(). Signed-off-by: Tiago Vignatti --- tests/kms_mmap_write_crc.c | 63 -- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/tests/kms_mmap_write_crc.c b/tests/kms_mmap_write_crc.c index

[PATCH i-g-t 4/5] tests: Add kms_mmap_write_crc for cache coherency tests

2015-08-11 Thread Tiago Vignatti
Signed-off-by: Tiago Vignatti --- tests/.gitignore | 1 + tests/Makefile.sources | 1 + tests/kms_mmap_write_crc.c | 236 + 3 files changed, 238 insertions(+) create mode 100644 tests/kms_mmap_write_crc.c diff --git a/tests/.gitigno

[PATCH i-g-t 3/5] prime_mmap: Add basic tests to write in a bo using CPU

2015-08-11 Thread Tiago Vignatti
in the GPU process ("priviledged process"). This requires kernel modifications (Daniel Thompson's "drm: prime: Honour O_RDWR during prime-handle-to-fd"). Signed-off-by: Tiago Vignatti --- lib/ioctl_wrappers.c | 5 +++- tests/prime_mmap.c | 65 +++

[PATCH i-g-t 2/5] prime_mmap: Fix a few misc stuff

2015-08-11 Thread Tiago Vignatti
- Remove pattern_check(), which was walking through a useless iterator - Remove superfluous PROT_WRITE from gem_mmap, in test_correct() - Add binary file to .gitignore Signed-off-by: Tiago Vignatti --- tests/.gitignore | 1 + tests/prime_mmap.c | 37 - 2

[PATCH i-g-t 1/5] prime_mmap: Add new test for calling mmap() on dma-buf fds

2015-08-11 Thread Tiago Vignatti
unting checks for buffer reference counting - test_dup chats that dup()ing the fd works - test_errors checks the error return values for failures - test_aperture_limit tests multiple buffer creation at the gtt aperture limit Signed-off-by: Rob Bradford Signed-off-by: Tiago Vignatti ---

[PATCH 4/4] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-08-11 Thread Tiago Vignatti
Userspace is the one in charge of flush CPU by wrapping mmap with begin{,end}_cpu_access. v2: Remove LLC check cause we have dma-buf sync providers now. Also, fix return before transferring ownership when mmap fails. v3: Fix return values. Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915

[PATCH 3/4] drm/i915: Implement end_cpu_access

2015-08-11 Thread Tiago Vignatti
Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index e9c2bfd..8447ba4 100644 --- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c

[PATCH 2/4] dma-buf: Add ioctls to allow userspace to flush

2015-08-11 Thread Tiago Vignatti
ternal users - vmap and kmap interfaces are much different ... We might need to add a mapping enum to the begin/end dma-buf functions. v2 (Tiago): Fix header file type names (u64 -> __u64) Signed-off-by: Daniel Vetter Signed-off-by: Tiago Vignatti --- drivers/dma-buf/dma-buf.

[PATCH 1/4] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-08-11 Thread Tiago Vignatti
relax the restriction and permit read/write access. This is safe because the flags are seldom touched by drm; mostly they are passed verbatim to dma_buf calls. v3 (Tiago): removed unused flags variable from drm_prime_handle_to_fd_ioctl. Signed-off-by: Daniel Thompson Signed-off-by: Tiago Vignatti --- d

[PATCH v3] mmap on the dma-buf directly

2015-08-11 Thread Tiago Vignatti
ing igt, and sending the tests for review now. Please take a look. Tiago Daniel Thompson (1): drm: prime: Honour O_RDWR during prime-handle-to-fd Daniel Vetter (1): dma-buf: Add ioctls to allow userspace to flush Tiago Vignatti (2): drm/i915: Implement end_cpu_access drm/i915: Use CPU m

[PATCH 3/3] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-08-05 Thread Tiago Vignatti
Userspace is the one in charge of flush CPU by wrapping mmap with begin{,end}_cpu_access. v2: Remove LLC check cause we have dma-buf sync providers now. Also, fix return before transferring ownership when mmap fails. Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 18

[PATCH 2/3] dma-buf: Add ioctls to allow userspace to flush

2015-08-05 Thread Tiago Vignatti
ternal users - vmap and kmap interfaces are much different ... We might need to add a mapping enum to the begin/end dma-buf functions. v2 (Tiago): Fix header file type names (u64 -> __u64) Signed-off-by: Daniel Vetter Signed-off-by: Tiago Vignatti --- drivers/dma-buf/dma-buf.

[PATCH 1/3] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-08-05 Thread Tiago Vignatti
relax the restriction and permit read/write access. This is safe because the flags are seldom touched by drm; mostly they are passed verbatim to dma_buf calls. v3 (Tiago): removed unused flags variable from drm_prime_handle_to_fd_ioctl. Signed-off-by: Daniel Thompson Signed-off-by: Tiago Vignatti --- d

[PATCH v2 0/3] mmap on the dma-buf directly

2015-08-05 Thread Tiago Vignatti
w userspace to flush Tiago Vignatti (1): drm/i915: Use CPU mapping for userspace dma-buf mmap() drivers/dma-buf/dma-buf.c | 47 ++ drivers/gpu/drm/drm_prime.c| 10 +++- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 18 - in

[Intel-gfx] [PATCH 1/2] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-08-05 Thread Tiago Vignatti
On 08/05/2015 04:08 AM, Daniel Vetter wrote: > On Tue, Aug 04, 2015 at 06:30:25PM -0300, Tiago Vignatti wrote: > Nah they don't have to be equal since the problem isn't that nothing goes > out to memory where the display can see it, but usually only parts of it. > I.e. you need to chan

[Intel-gfx] [PATCH 1/2] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-08-04 Thread Tiago Vignatti
b274f1a3f6889c78cb72d0673ca2 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti <tiago.vigna...@intel.com> Date: Tue, 4 Aug 2015 13:38:09 -0300 Subject: [PATCH] tests: Add prime_crc for cache coherency This program can be used to detect when the writes don't land in scanout, due cache incoheren

[PATCH 2/2] drm: prime: Honour O_RDWR during prime-handle-to-fd

2015-07-31 Thread Tiago Vignatti
relax the restriction and permit read/write access. This is safe because the flags are seldom touched by drm; mostly they are passed verbatim to dma_buf calls. v3 (Tiago): removed unused flags variable from drm_prime_handle_to_fd_ioctl. Signed-off-by: Daniel Thompson Signed-off-by: Tiago Vignatti --- d

[PATCH 1/2] drm/i915: Use CPU mapping for userspace dma-buf mmap()

2015-07-31 Thread Tiago Vignatti
up dma-buf ioctls to allow userspace flush, controlling manually the synchronization via begin{,end}_cpu_access. Signed-off-by: Tiago Vignatti --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gp

[PATCH 0/2] mmap on the dma-buf directly

2015-07-31 Thread Tiago Vignatti
ub.com/tiagovignatti/intel-gpu-tools/commits/prime_mmap Thank you, Tiago Daniel Thompson (1): drm: prime: Honour O_RDWR during prime-handle-to-fd Tiago Vignatti (1): drm/i915: Use CPU mapping for userspace dma-buf mmap() drivers/gpu/drm/drm_prime.c| 10 +++---

[PATCH resent twice 2/3] vgaarb: use MIT license

2010-05-24 Thread Tiago Vignatti
Signed-off-by: Tiago Vignatti Cc: Henry Zhao --- Jesse and Dave, that was send two times already and no one said anything. Please, pull it. Oracle's Henry Zhao is already employing it in Solaris and, after all authors agreed, we haven't changed yet the license. drivers/gpu/vga/vgaarb.c | 26

[PATCH 1/3] vgaarb: convert pr_devel() to pr_debug()

2010-05-24 Thread Tiago Vignatti
We want to be able to use CONFIG_DYNAMIC_DEBUG in arbiter code, switch the few existing pr_devel() calls to pr_debug(). Also, add one more debug information regarding decoding count. Signed-off-by: Tiago Vignatti --- drivers/gpu/vga/vgaarb.c | 35 ++- 1 files

[PATCH 1/3] vgaarb: convert pr_devel() to pr_debug()

2010-05-24 Thread Tiago Vignatti
We want to be able to use CONFIG_DYNAMIC_DEBUG in arbiter code, switch the few existing pr_devel() calls to pr_debug(). Also, add one more debug information regarding decoding count. Signed-off-by: Tiago Vignatti tiago.vigna...@nokia.com --- drivers/gpu/vga/vgaarb.c | 35

[PATCH resent twice 2/3] vgaarb: use MIT license

2010-05-24 Thread Tiago Vignatti
Signed-off-by: Tiago Vignatti tiago.vigna...@nokia.com Cc: Henry Zhao henry.z...@sun.com --- Jesse and Dave, that was send two times already and no one said anything. Please, pull it. Oracle's Henry Zhao is already employing it in Solaris and, after all authors agreed, we haven't changed yet