summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/dmabuf-heaps
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2021-01-29 06:05:12 +0300
committerShuah Khan <skhan@linuxfoundation.org>2021-02-09 02:25:39 +0300
commit1b50e10ee6997c795382570eac94ccc874611d61 (patch)
tree9f4ea31517c1bb2eeef3236ef4e06e04a4338c96 /tools/testing/selftests/dmabuf-heaps
parent50c65a8342941d30dd5874993052a91c9a52591b (diff)
downloadlinux-1b50e10ee6997c795382570eac94ccc874611d61.tar.xz
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 <shuah@kernel.org> Cc: Brian Starkey <brian.starkey@arm.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Laura Abbott <labbott@kernel.org> Cc: Hridya Valsaraju <hridya@google.com> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Sandeep Patil <sspatil@google.com> Cc: Daniel Mentz <danielmentz@google.com> Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-kselftest@vger.kernel.org Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/dmabuf-heaps')
-rw-r--r--tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
index 46f6759a8acc..8cedd539c7fb 100644
--- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
+++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
@@ -184,15 +184,14 @@ static int test_alloc_and_import(char *heap_name)
if (importer_fd < 0) {
ret = importer_fd;
printf("Failed to open vgem\n");
- goto out;
- }
-
- ret = import_vgem_fd(importer_fd, dmabuf_fd, &handle);
- if (ret < 0) {
- printf("Failed to import buffer\n");
- goto out;
+ } else {
+ ret = import_vgem_fd(importer_fd, dmabuf_fd, &handle);
+ if (ret < 0) {
+ printf("Failed to import buffer\n");
+ goto out;
+ }
+ printf("import passed\n");
}
- printf("import passed\n");
ret = dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_START);
if (ret < 0) {