From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84EDD88C4C for ; Wed, 24 Nov 2021 07:15:31 +0000 (UTC) Date: Tue, 23 Nov 2021 23:04:08 -0800 Message-ID: <87k0gyrq53.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211123091203.6076-1-zbigniew.kempczynski@intel.com> References: <20211123091203.6076-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] tests/api_intel_bb: Use alignment only when kernel support it 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 List-ID: On Tue, 23 Nov 2021 01:12:03 -0800, Zbigniew Kempczy=F1ski wrote: > > Test uses intel-bb api so we're responsible to pass valid alignment > or 0 when it is not supported by the kernel. Add appropriate check > to avoid failing on such kernels. Reviewed-by: Ashutosh Dixit > Signed-off-by: Zbigniew Kempczy=F1ski > Cc: Petri Latvala > Cc: Ashutosh Dixit > --- > tests/i915/api_intel_bb.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c > index 82943a341..5c996f644 100644 > --- a/tests/i915/api_intel_bb.c > +++ b/tests/i915/api_intel_bb.c > @@ -469,6 +469,7 @@ static void object_reloc(struct buf_ops *bops, enum o= bj_cache_ops cache_op) > uint64_t flags =3D 0; > uint64_t shift =3D cache_op =3D=3D PURGE_CACHE ? 0x2000 : 0x0; > bool purge_cache =3D cache_op =3D=3D PURGE_CACHE ? true : false; > + uint64_t alignment =3D gem_allows_obj_alignment(i915) ? 0x2000 : 0x0; > > ibb =3D intel_bb_create_with_relocs(i915, PAGE_SIZE); > if (debug_bb) > @@ -490,7 +491,7 @@ static void object_reloc(struct buf_ops *bops, enum o= bj_cache_ops cache_op) > igt_assert(poff_h2 =3D=3D INTEL_BUF_INVALID_ADDRESS); > > intel_bb_add_object(ibb, h1, PAGE_SIZE, poff_h1, 0, true); > - intel_bb_add_object(ibb, h2, PAGE_SIZE, poff_h2, 0x2000, true); > + intel_bb_add_object(ibb, h2, PAGE_SIZE, poff_h2, alignment, true); > > /* > * Objects were added to bb, we expect initial addresses are zeroed > @@ -516,7 +517,7 @@ static void object_reloc(struct buf_ops *bops, enum o= bj_cache_ops cache_op) > > if (purge_cache) { > intel_bb_add_object(ibb, h1, PAGE_SIZE, poff2_h1, 0, true); > - intel_bb_add_object(ibb, h2, PAGE_SIZE, poff2_h2 + shift, 0x2000, true= ); > + intel_bb_add_object(ibb, h2, PAGE_SIZE, poff2_h2 + shift, alignment, t= rue); > } > > poff_bb =3D intel_bb_get_object_offset(ibb, ibb->handle); > -- > 2.26.0 >