From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0745A6E98C for ; Wed, 4 Aug 2021 00:18:34 +0000 (UTC) Date: Tue, 03 Aug 2021 17:18:32 -0700 Message-ID: <87eebakqp3.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <87k0l2kztn.wl-ashutosh.dixit@intel.com> References: <20210726200026.4815-1-zbigniew.kempczynski@intel.com> <20210726200026.4815-3-zbigniew.kempczynski@intel.com> <87k0l2kztn.wl-ashutosh.dixit@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t v3 02/52] lib/intel_allocator: Add few helper functions for common use List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= Cc: igt-dev@lists.freedesktop.org, Petri Latvala , Chris Wilson List-ID: On Tue, 03 Aug 2021 14:01:24 -0700, Dixit, Ashutosh wrote: > > On Mon, 26 Jul 2021 12:59:36 -0700, Zbigniew Kempczy=F1ski wrote: > > > > +static inline uint64_t get_simple_ahnd(int fd, uint32_t ctx) > > +{ > > + bool do_relocs =3D gem_has_relocations(fd); > > + > > + return do_relocs ? 0 : intel_allocator_open(fd, ctx, INTEL_ALLOCATOR_= SIMPLE); > > Should this function be e.g. > > return intel_allocator_open(fd, 0, do_relocs ? > INTEL_ALLOCATOR_RELOC : INTEL_ALLOCATOR_S= IMPLE); > > Similarly for others. The patch is fine but there was the above code (which I wrote) in gem_linear_blits.c, hence I was wondering. > +static inline uint64_t get_offset(uint64_t ahnd, uint32_t handle, > + uint64_t size, uint64_t alignment) > +{ > + if (!ahnd) > + return 0; > + > + return intel_allocator_alloc(ahnd, handle, size, alignment); > +} > + > +static inline bool put_offset(uint64_t ahnd, uint32_t handle) > +{ > + if (!ahnd) > + return 0; > + > + return intel_allocator_free(ahnd, handle); > +} > + Also for the function names are too generic with potential for namespace conflicts, probably ahnd_get_offset/ahnd_put_offset? In any case, this is: Reviewed-by: Ashutosh Dixit