From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 28 Jul 2021 16:07:37 -0700 Message-ID: <87eebi3ume.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20210728103041.1669985-4-matthew.auld@intel.com> References: <20210728103041.1669985-1-matthew.auld@intel.com> <20210728103041.1669985-4-matthew.auld@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Subject: Re: [igt-dev] [PATCH i-g-t v2 04/11] lib/i915/gem_mman: add fixed mode to gem_mmap__cpu List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Matthew Auld Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org List-ID: On Wed, 28 Jul 2021 03:30:34 -0700, Matthew Auld wrote: > > diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c > index 337d28fb..6f5e6d72 100644 > --- a/lib/i915/gem_mman.c > +++ b/lib/i915/gem_mman.c > @@ -434,7 +434,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; What about __gem_mmap__wc? Also shouldn't we just fix the __gem_mmap_offset fallback in __gem_mmap and that will take care of both __gem_mmap__cpu and __gem_mmap__wc? (I think it will actually also fix __gem_mmap__device_coherent and __gem_mmap__cpu_coherent but maybe we can still have those patches in this series especially if they save a couple of system calls). _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev