diff options
author | Matthew Auld <matthew.auld@intel.com> | 2021-07-30 09:53:41 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2021-08-06 12:08:46 +0200 |
commit | 40c235c7092bdc6c7578a96d69df8072b0b583cc (patch) | |
tree | 9add8745e7fef62186bebfd5a061bb09500ce80e | |
parent | a41cfeb02bd498aaa0fefccd23864c3680961270 (diff) |
lib/i915/gem_mman: add fixed mode to gem_mmap__cpu
On discrete we only support the new fixed mode.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
-rw-r--r-- | lib/i915/gem_mman.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c index 563a7ccf..c134e973 100644 --- a/lib/i915/gem_mman.c +++ b/lib/i915/gem_mman.c @@ -436,7 +436,13 @@ void *gem_mmap__device_coherent(int fd, uint32_t handle, uint64_t offset, */ void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot) { - return __gem_mmap(fd, handle, offset, size, prot, 0); + void *ptr; + + ptr = __gem_mmap(fd, handle, offset, size, prot, 0); + if (!ptr) + ptr = __gem_mmap_offset__fixed(fd, handle, offset, size, prot); + + return ptr; } /** |