From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D34A6E520 for ; Tue, 30 Nov 2021 23:18:39 +0000 (UTC) Date: Tue, 30 Nov 2021 15:18:37 -0800 Message-ID: <87a6hlz0z6.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211128070823.1396652-2-priyanka.dandamudi@intel.com> References: <20211128070823.1396652-1-priyanka.dandamudi@intel.com> <20211128070823.1396652-2-priyanka.dandamudi@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib: Refactor common store code into helper function List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: priyanka.dandamudi@intel.com Cc: igt-dev@lists.freedesktop.org List-ID: On Sat, 27 Nov 2021 23:08:22 -0800, wrote: > > From: John Harrison > > A lot of tests use almost identical code for creating a batch buffer > which does a single write to memory. This patch collects three such > instances into a common helper function. Here we are submitting just a single instance so maybe change the commit message to something like: "A lot of tests use almost identical code for creating a batch buffer which does a single write to memory. Create a common helper function for doing this. It is possible that other uses for store dword are all subtly different enough to make it not so trivial to try to use the helper. This patch proves the concept, if people like it enough then it can be extended". @Zbigniew: Another issue is that igt_store_word() lacks softpin (no-relocation) support (dGfx doesn't have relocations). Do you think we can add the no-reloc support after we merge? (In CI, DG1 which doesn't have relocations is only in BAT, not in shards, so the tests which use this function will not break after we merge). Thanks. > diff --git a/lib/igt_store.c b/lib/igt_store.c > new file mode 100644 > index 00000000..dc4d466a > --- /dev/null > +++ b/lib/igt_store.c > @@ -0,0 +1,103 @@ > +/* > + * Copyright =A9 2020 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining= a > + * copy of this software and associated documentation files (the "Softwa= re"), > + * to deal in the Software without restriction, including without limita= tion > + * the rights to use, copy, modify, merge, publish, distribute, sublicen= se, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the = next > + * paragraph) shall be included in all copies or substantial portions of= the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE= SS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI= TY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SH= ALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR = OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI= NG > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER D= EALINGS > + * IN THE SOFTWARE. > + * > + */ Please use the SPDX header here. See e.g. intel_ctx.c. > diff --git a/lib/igt_store.h b/lib/igt_store.h > new file mode 100644 > index 00000000..709d87e3 > --- /dev/null > +++ b/lib/igt_store.h > @@ -0,0 +1,30 @@ > +/* > + * Copyright =A9 2020 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining= a > + * copy of this software and associated documentation files (the "Softwa= re"), > + * to deal in the Software without restriction, including without limita= tion > + * the rights to use, copy, modify, merge, publish, distribute, sublicen= se, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the = next > + * paragraph) shall be included in all copies or substantial portions of= the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE= SS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI= TY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SH= ALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR = OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI= NG > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER D= EALINGS > + * IN THE SOFTWARE. > + * > + */ Here too, please use the SPDX header. See intel_ctx.h (.c and .h SPDX header is different). Please make these changes and resubmit. We can handle the no-reloc case later if Zbigniew agrees. Thanks.