John Stultz
1d317c1ca2
kselftests: dmabuf-heaps: Add extra checking that allocated buffers are zeroed
...
Add a check to validate that buffers allocated from the heaps
are properly zeroed before being given to userland.
It is done by allocating a number of buffers, and filling them
with a nonzero pattern, then closing and reallocating more
buffers and checking that they are all properly zeroed.
This is helpful to validate any cached buffers are zeroed
before being given back out.
Cc: Shuah Khan <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Laura Abbott <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Suren Baghdasaryan <[email protected] >
Cc: Sandeep Patil <[email protected] >
Cc: Daniel Mentz <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Shuah Khan <[email protected] >
2021-02-08 16:25:53 -07:00
John Stultz
06fc1aaea9
kselftests: dmabuf-heaps: Cleanup test output
...
Cleanup the test output so it is a bit easier to read
Cc: Shuah Khan <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Laura Abbott <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Suren Baghdasaryan <[email protected] >
Cc: Sandeep Patil <[email protected] >
Cc: Daniel Mentz <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Shuah Khan <[email protected] >
2021-02-08 16:25:47 -07:00
John Stultz
1b50e10ee6
kselftests: dmabuf-heaps: Softly fail if don't find a vgem device
...
While testing against a vgem device is helpful for testing importing
they aren't always configured in, so don't make it a fatal failure.
Cc: Shuah Khan <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Laura Abbott <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Suren Baghdasaryan <[email protected] >
Cc: Sandeep Patil <[email protected] >
Cc: Daniel Mentz <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Shuah Khan <[email protected] >
2021-02-08 16:25:39 -07:00
John Stultz
50c65a8342
kselftests: dmabuf-heaps: Add clearer checks on DMABUF_BEGIN/END_SYNC
...
Add logic to check the dmabuf sync calls succeed.
Cc: Shuah Khan <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Laura Abbott <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Suren Baghdasaryan <[email protected] >
Cc: Sandeep Patil <[email protected] >
Cc: Daniel Mentz <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Shuah Khan <[email protected] >
2021-02-08 16:25:25 -07:00
John Stultz
64ba3d591c
kselftests: dmabuf-heaps: Fix Makefile's inclusion of the kernel's usr/include dir
...
Copied in from somewhere else, the makefile was including
the kerne's usr/include dir, which caused the asm/ioctl.h file
to be used.
Unfortunately, that file has different values for _IOC_SIZEBITS
and _IOC_WRITE than include/uapi/asm-generic/ioctl.h which then
causes the _IOCW macros to give the wrong ioctl numbers,
specifically for DMA_BUF_IOCTL_SYNC.
This patch simply removes the extra include from the Makefile
Cc: Shuah Khan <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Laura Abbott <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Suren Baghdasaryan <[email protected] >
Cc: Sandeep Patil <[email protected] >
Cc: Daniel Mentz <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Fixes: a8779927fd ("kselftests: Add dma-heap test")
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Shuah Khan <[email protected] >
2021-02-08 16:25:15 -07:00
John Stultz
4bb9d46d47
kselftests: dmabuf-heaps: Fix confused return value on expected error testing
...
When I added the expected error testing, I forgot I need to set
the return to zero when we successfully see an error.
Without this change we only end up testing a single heap
before the test quits.
Cc: Shuah Khan <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Laura Abbott <[email protected] >
Cc: "Andrew F. Davis" <[email protected] >
Cc: [email protected]
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Shuah Khan <[email protected] >
2020-05-08 09:40:58 -06:00
Andrew F. Davis
b3b4346544
dma-buf: heaps: Use _IOCTL_ for userspace IOCTL identifier
...
This is more consistent with the DMA and DRM frameworks convention. This
patch is only a name change, no logic is changed.
Signed-off-by: Andrew F. Davis <[email protected] >
Acked-by: John Stultz <[email protected] >
Signed-off-by: Sumit Semwal <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-12-17 21:37:40 +05:30
John Stultz
a8779927fd
kselftests: Add dma-heap test
...
Add very trivial allocation and import test for dma-heaps,
utilizing the vgem driver as a test importer.
A good chunk of this code taken from:
tools/testing/selftests/android/ion/ionmap_test.c
Originally by Laura Abbott <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Liam Mark <[email protected] >
Cc: Pratik Patel <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Vincent Donnefort <[email protected] >
Cc: Sudipto Paul <[email protected] >
Cc: Andrew F. Davis <[email protected] >
Cc: Christoph Hellwig <[email protected] >
Cc: Chenbo Feng <[email protected] >
Cc: Alistair Strachan <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Sandeep Patil <[email protected] >
Cc: Hillf Danton <[email protected] >
Cc: Dave Airlie <[email protected] >
Cc: [email protected]
Reviewed-by: Benjamin Gaignard <[email protected] >
Reviewed-by: Brian Starkey <[email protected] >
Acked-by: Sandeep Patil <[email protected] >
Acked-by: Laura Abbott <[email protected] >
Tested-by: Ayan Kumar Halder <[email protected] >
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Sumit Semwal <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-12-11 11:13:38 +05:30
Sean Paul
a262ef0436
Revert "kselftests: Add dma-heap test"
...
This reverts commit ab87cc9754 .
This patchset doesn't meet the UAPI requirements set out in [1] for the DRM
subsystem. Once the userspace component is reviewed and ready for merge
we can try again.
[1]- https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
Fixes: ab87cc9754 ("kselftests: Add dma-heap test")
Cc: Benjamin Gaignard <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Liam Mark <[email protected] >
Cc: Pratik Patel <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Vincent Donnefort <[email protected] >
Cc: Sudipto Paul <[email protected] >
Cc: Andrew F. Davis <[email protected] >
Cc: Christoph Hellwig <[email protected] >
Cc: Chenbo Feng <[email protected] >
Cc: Alistair Strachan <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Hillf Danton <[email protected] >
Cc: [email protected]
Cc: Brian Starkey <[email protected] >
Cc: Laura Abbott <[email protected] >
Cc: John Stultz <[email protected] >
Cc: Sean Paul <[email protected] >
Acked-by: David Airlie <[email protected] >
Signed-off-by: Sean Paul <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-10-30 16:40:13 -04:00
John Stultz
ab87cc9754
kselftests: Add dma-heap test
...
Add very trivial allocation and import test for dma-heaps,
utilizing the vgem driver as a test importer.
A good chunk of this code taken from:
tools/testing/selftests/android/ion/ionmap_test.c
Originally by Laura Abbott <[email protected] >
Cc: Benjamin Gaignard <[email protected] >
Cc: Sumit Semwal <[email protected] >
Cc: Liam Mark <[email protected] >
Cc: Pratik Patel <[email protected] >
Cc: Brian Starkey <[email protected] >
Cc: Vincent Donnefort <[email protected] >
Cc: Sudipto Paul <[email protected] >
Cc: Andrew F. Davis <[email protected] >
Cc: Christoph Hellwig <[email protected] >
Cc: Chenbo Feng <[email protected] >
Cc: Alistair Strachan <[email protected] >
Cc: Hridya Valsaraju <[email protected] >
Cc: Hillf Danton <[email protected] >
Cc: [email protected]
Reviewed-by: Benjamin Gaignard <[email protected] >
Reviewed-by: Brian Starkey <[email protected] >
Acked-by: Laura Abbott <[email protected] >
Tested-by: Ayan Kumar Halder <[email protected] >
Signed-off-by: John Stultz <[email protected] >
Signed-off-by: Sumit Semwal <[email protected] >
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-10-25 17:01:50 +05:30