summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-09-25 16:26:52 +0300
committerLionel Landwerlin <[email protected]>2019-09-25 22:02:51 +0300
commitda2d67fc3b04128f3dad08c1002b260841312420 (patch)
treed3fb647c25ddf142af4e6bf14fcafae5c407a11a /src
parent2d8f77db839cb3a83f0b1575a028d5aa4258c322 (diff)
anv: gem-stubs: return a valid fd got anv_gem_userptr()
Fixes invalid close(-1) in the unit tests. Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_gem_stubs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_gem_stubs.c b/src/intel/vulkan/anv_gem_stubs.c
index 2c27ce26f37..bc9d7e066ba 100644
--- a/src/intel/vulkan/anv_gem_stubs.c
+++ b/src/intel/vulkan/anv_gem_stubs.c
@@ -68,7 +68,13 @@ anv_gem_munmap(void *p, uint64_t size)
uint32_t
anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
{
- return -1;
+ int fd = os_create_anonymous_file(size, "fake bo");
+ if (fd == -1)
+ return 0;
+
+ assert(fd != 0);
+
+ return fd;
}
int