projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nir: Add options to nir_lower_compute_system_values to control compute ID base lowering
[mesa.git]
/
src
/
intel
/
vulkan
/
anv_gem_stubs.c
diff --git
a/src/intel/vulkan/anv_gem_stubs.c
b/src/intel/vulkan/anv_gem_stubs.c
index 8cc3ad1f22edf2b553b69752f421a743d05f5366..d6636d3ccd85e99996f5fcf920105592578df841 100644
(file)
--- a/
src/intel/vulkan/anv_gem_stubs.c
+++ b/
src/intel/vulkan/anv_gem_stubs.c
@@
-21,32
+21,21
@@
* IN THE SOFTWARE.
*/
* IN THE SOFTWARE.
*/
-#include <linux/memfd.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+#include "util/anon_file.h"
#include "anv_private.h"
#include "anv_private.h"
-#ifndef HAVE_MEMFD_CREATE
-static inline int
-memfd_create(const char *name, unsigned int flags)
-{
- return syscall(SYS_memfd_create, name, flags);
-}
-#endif
-
uint32_t
anv_gem_create(struct anv_device *device, uint64_t size)
{
uint32_t
anv_gem_create(struct anv_device *device, uint64_t size)
{
- int fd =
memfd_create("fake bo", MFD_CLOEXEC
);
+ int fd =
os_create_anonymous_file(size, "fake bo"
);
if (fd == -1)
return 0;
assert(fd != 0);
if (fd == -1)
return 0;
assert(fd != 0);
- if (ftruncate(fd, size) == -1)
- return 0;
-
return fd;
}
return fd;
}
@@
-71,7
+60,7
@@
anv_gem_mmap(struct anv_device *device, uint32_t gem_handle,
* this map is no longer valid. Pair this with anv_gem_mmap().
*/
void
* this map is no longer valid. Pair this with anv_gem_mmap().
*/
void
-anv_gem_munmap(void *p, uint64_t size)
+anv_gem_munmap(
struct anv_device *device,
void *p, uint64_t size)
{
munmap(p, size);
}
{
munmap(p, size);
}
@@
-79,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)
{
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
}
int
@@
-108,6
+103,12
@@
anv_gem_set_tiling(struct anv_device *device,
return 0;
}
return 0;
}
+int
+anv_gem_get_tiling(struct anv_device *device, uint32_t gem_handle)
+{
+ return 0;
+}
+
int
anv_gem_set_caching(struct anv_device *device, uint32_t gem_handle,
uint32_t caching)
int
anv_gem_set_caching(struct anv_device *device, uint32_t gem_handle,
uint32_t caching)
@@
-164,12
+165,6
@@
anv_gem_has_context_priority(int fd)
unreachable("Unused");
}
unreachable("Unused");
}
-int
-anv_gem_get_aperture(int fd, uint64_t *size)
-{
- unreachable("Unused");
-}
-
int
anv_gem_gpu_get_reset_stats(struct anv_device *device,
uint32_t *active, uint32_t *pending)
int
anv_gem_gpu_get_reset_stats(struct anv_device *device,
uint32_t *active, uint32_t *pending)
@@
-253,8
+248,7
@@
anv_gem_syncobj_wait(struct anv_device *device,
}
int
}
int
-anv_gem_reg_read(struct anv_device *device,
- uint32_t offset, uint64_t *result)
+anv_gem_reg_read(int fd, uint32_t offset, uint64_t *result)
{
unreachable("Unused");
}
{
unreachable("Unused");
}