From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id C647910E787 for ; Tue, 22 Feb 2022 21:33:51 +0000 (UTC) Date: Tue, 22 Feb 2022 13:33:50 -0800 Message-ID: <871qzu7fi9.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= In-Reply-To: <20220221084123.22684-1-zbigniew.kempczynski@intel.com> References: <20220221084123.22684-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] lib/intel_batchbuffer: Use safe alignment in fast-copy raw List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Mon, 21 Feb 2022 00:41:23 -0800, Zbigniew Kempczy=F1ski wrote: > > diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c > index e5666cd4f..23055855b 100644 > --- a/lib/intel_batchbuffer.c > +++ b/lib/intel_batchbuffer.c > @@ -990,13 +990,14 @@ void igt_blitter_fast_copy__raw(int fd, > uint32_t dword0, dword1; > uint32_t src_pitch, dst_pitch; > uint64_t batch_offset, src_offset, dst_offset; > + uint64_t align =3D gem_detect_safe_alignment(fd); > int i =3D 0; > > batch_handle =3D gem_create(fd, 4096); > if (ahnd) { > - src_offset =3D get_offset(ahnd, src_handle, src_size, 0); > - dst_offset =3D get_offset(ahnd, dst_handle, dst_size, 0); > - batch_offset =3D get_offset(ahnd, batch_handle, 4096, 0); > + src_offset =3D get_offset(ahnd, src_handle, src_size, align); > + dst_offset =3D get_offset(ahnd, dst_handle, dst_size, align); > + batch_offset =3D get_offset(ahnd, batch_handle, 4096, align); Is it possible to modify the allocator so that say '0' (or alternatively -1ULL) denotes the "default" alignment? And the default alignment will the safe_alignment which can be stored as part of the allocator itself? This will avoid having to pass this safe_alignment in a large number of IGT's. If some IGT's want to override the default alignment they can always do so. Thoughts?