diff options
author | Matthew Auld <matthew.auld@intel.com> | 2021-07-30 09:53:40 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2021-08-06 12:08:46 +0200 |
commit | a41cfeb02bd498aaa0fefccd23864c3680961270 (patch) | |
tree | 28cd2834f07a3bea94d8d8b6941b3a25c2daba2c /lib/i915 | |
parent | 7adaea57530bc8bd58663aa585d23a4eced4eb6f (diff) |
lib/i915/gem_mman: add fixed mode to gem_mmap_offset__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>
Diffstat (limited to 'lib/i915')
-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 c432bb16..563a7ccf 100644 --- a/lib/i915/gem_mman.c +++ b/lib/i915/gem_mman.c @@ -474,8 +474,14 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns void *__gem_mmap_offset__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot) { - return __gem_mmap_offset(fd, handle, offset, size, prot, + void *ptr; + + ptr = __gem_mmap_offset(fd, handle, offset, size, prot, I915_MMAP_OFFSET_WB); + if (!ptr) + ptr = __gem_mmap_offset__fixed(fd, handle, offset, size, prot); + + return ptr; } /** |