diff mbox series

[i-g-t,v2,02/11] lib/i915/gem_mman: add fixed mode to mmap__device_coherent

Message ID 20210728103041.1669985-2-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show
Series [i-g-t,v2,01/11] lib/i915/gem_mman: add FIXED mmap mode | expand

Commit Message

Matthew Auld July 28, 2021, 10:30 a.m. UTC
On discrete we need to fallback to this 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>
---
 lib/i915/gem_mman.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Dixit, Ashutosh July 28, 2021, 10:23 p.m. UTC | #1
On Wed, 28 Jul 2021 03:30:32 -0700, Matthew Auld wrote:
>
> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> index e2514f0c..222e8896 100644
> --- a/lib/i915/gem_mman.c
> +++ b/lib/i915/gem_mman.c
> @@ -383,9 +383,10 @@ void *__gem_mmap__device_coherent(int fd, uint32_t handle, uint64_t offset,
>				      I915_MMAP_OFFSET_WC);
>	if (!ptr)
>		ptr = __gem_mmap__wc(fd, handle, offset, size, prot);
> -
>	if (!ptr)
>		ptr = __gem_mmap__gtt(fd, handle, size, prot);
> +	if (!ptr)
> +		ptr = __gem_mmap_offset__fixed(fd, handle, offset, size, prot);

Wondering if we really want 4 system calls for discrete. Maybe we can move
this up to 2nd place right after __gem_mmap_offset?
diff mbox series

Patch

diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index e2514f0c..222e8896 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -383,9 +383,10 @@  void *__gem_mmap__device_coherent(int fd, uint32_t handle, uint64_t offset,
 				      I915_MMAP_OFFSET_WC);
 	if (!ptr)
 		ptr = __gem_mmap__wc(fd, handle, offset, size, prot);
-
 	if (!ptr)
 		ptr = __gem_mmap__gtt(fd, handle, size, prot);
+	if (!ptr)
+		ptr = __gem_mmap_offset__fixed(fd, handle, offset, size, prot);
 
 	return ptr;
 }