Skip to content

Commit 1b50e10

Browse files
johnstultz-workshuahkh
authored andcommitted
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>
1 parent 50c65a8 commit 1b50e10

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,14 @@ static int test_alloc_and_import(char *heap_name)
184184
if (importer_fd < 0) {
185185
ret = importer_fd;
186186
printf("Failed to open vgem\n");
187-
goto out;
188-
}
189-
190-
ret = import_vgem_fd(importer_fd, dmabuf_fd, &handle);
191-
if (ret < 0) {
192-
printf("Failed to import buffer\n");
193-
goto out;
187+
} else {
188+
ret = import_vgem_fd(importer_fd, dmabuf_fd, &handle);
189+
if (ret < 0) {
190+
printf("Failed to import buffer\n");
191+
goto out;
192+
}
193+
printf("import passed\n");
194194
}
195-
printf("import passed\n");
196195

197196
ret = dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_START);
198197
if (ret < 0) {

0 commit comments

Comments
 (0)