From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B08F6E08C for ; Sat, 7 Aug 2021 00:39:42 +0000 (UTC) Date: Fri, 06 Aug 2021 17:37:25 -0700 Message-ID: <87fsvmum2i.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20210806134145.24634-38-zbigniew.kempczynski@intel.com> References: <20210806134145.24634-1-zbigniew.kempczynski@intel.com> <20210806134145.24634-38-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 v4 37/56] tests/gem_tiled_fence_blits: Adopt to use allocator 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 Fri, 06 Aug 2021 06:41:26 -0700, Zbigniew Kempczy=F1ski wrote: > > For newer gens we're not able to rely on relocations. Adopt to use > offsets acquired from the allocator. Reviewed-by: Ashutosh Dixit Just a question below. > @@ -198,7 +209,23 @@ static void run_test(int fd, int count) > reloc[0].target_handle =3D obj[0].handle =3D bo[dst]; > reloc[1].target_handle =3D obj[1].handle =3D bo[src]; > > + if (ahnd) { > + obj[0].offset =3D get_offset(ahnd, obj[0].handle, > + sizeof(linear), 0); > + obj[1].offset =3D get_offset(ahnd, obj[1].handle, > + sizeof(linear), 0); > + obj[2].offset =3D get_offset(ahnd, obj[2].handle, > + 4096, 0); > + update_batch(fd, obj[2].handle, reloc, > + obj[0].offset, obj[1].offset); > + } > + > gem_execbuf(fd, &eb); > + if (ahnd) { > + gem_close(fd, obj[2].handle); > + obj[2].handle =3D gem_create(fd, 4096); Is it necessary to update these offsets above, rather than just fix the offsets at the beginning of the function? Also to recreate obj[2]? What we have above is fine but just wondering the reason for it. Thanks.