summaryrefslogtreecommitdiff
path: root/tests/prime_self_import.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-07 18:36:31 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-07 18:36:31 +0200
commit00280fa82acbca4cf2fac6ac27efb56d86bfcbe1 (patch)
treee6a0dbe27d7a1a9f2e8c1181a5d0b085fa88f847 /tests/prime_self_import.c
parent8e11ab41923d0d45740c0530a8158edd354cf510 (diff)
tests/prime_self_import: Fixup previuos test
... not a great display of my prowess here. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/prime_self_import.c')
-rw-r--r--tests/prime_self_import.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 59b550d2..e1acdd35 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -147,25 +147,27 @@ static void test_with_one_bo_two_files(void)
{
int fd1, fd2;
uint32_t handle_import, handle_open, handle_orig, flink_name;
- int dma_buf_fd;
+ int dma_buf_fd1, dma_buf_fd2;
fd1 = drm_open_any();
fd2 = drm_open_any();
handle_orig = gem_create(fd1, BO_SIZE);
+ dma_buf_fd1 = prime_handle_to_fd(fd1, handle_orig);
flink_name = gem_flink(fd1, handle_orig);
handle_open = gem_open(fd2, flink_name);
- dma_buf_fd = prime_handle_to_fd(fd2, handle_open);
- handle_import = prime_fd_to_handle(fd1, dma_buf_fd);
+ dma_buf_fd2 = prime_handle_to_fd(fd2, handle_open);
+ handle_import = prime_fd_to_handle(fd2, dma_buf_fd2);
/* dma-buf selfimporting an flink bo should give the same handle */
assert(handle_import == handle_open);
close(fd1);
close(fd2);
- close(dma_buf_fd);
+ close(dma_buf_fd1);
+ close(dma_buf_fd2);
}
static void test_with_one_bo(void)