From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6591B10E13E for ; Tue, 1 Feb 2022 22:02:33 +0000 (UTC) Date: Tue, 01 Feb 2022 13:53:14 -0800 Message-ID: <87bkzq45kl.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20220131164804.26165-1-zbigniew.kempczynski@intel.com> References: <20220131164804.26165-1-zbigniew.kempczynski@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] i915/api_intel_bb: Correct size for munmap 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 List-ID: On Mon, 31 Jan 2022 08:48:04 -0800, Zbigniew Kempczy=F1ski wrote: > > If we don't release the entirety of the mmap we create, it still holds a > reference to the fd/object. > > Signed-off-by: Chris Wilson > Cc: Zbigniew Kempczy=F1ski > --- > tests/i915/api_intel_bb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c > index 5c996f644..130fb9014 100644 > --- a/tests/i915/api_intel_bb.c > +++ b/tests/i915/api_intel_bb.c > @@ -1169,7 +1169,7 @@ static void delta_check(struct buf_ops *bops) > ptr =3D gem_mmap__device_coherent(i915, buf->handle, 0, > intel_buf_size(buf), PROT_READ); > val =3D ptr[0x2000 / sizeof(uint32_t)]; > - gem_munmap(ptr, ibb->size); > + gem_munmap(ptr, intel_buf_bo_size(buf)); For making it easier, maybe we should also change to intel_buf_bo_size() in the mmap (similar to the munmap). Or have intel_buf_size() in the munmap too? Basically the same in both map and unmap. With that, this is: Reviewed-by: Ashutosh Dixit