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 9EA42113C54 for ; Sat, 5 Mar 2022 06:30:44 +0000 (UTC) Date: Fri, 04 Mar 2022 22:30:42 -0800 Message-ID: <87o82kzzal.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Anshuman Gupta In-Reply-To: <20220303140636.26652-2-anshuman.gupta@intel.com> References: <20220303140636.26652-1-anshuman.gupta@intel.com> <20220303140636.26652-2-anshuman.gupta@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 1/2] i915/gem_eio: Exercise object creation while wedged List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, chris.p.wilson@intel.com, Chris Wilson Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Thu, 03 Mar 2022 06:06:35 -0800, Anshuman Gupta wrote: > > diff --git a/lib/i915/gem_memory_topology.h b/lib/i915/gem_memory_topolog= y.h > new file mode 100644 > index 000000000..8daec8b5b > --- /dev/null > +++ b/lib/i915/gem_memory_topology.h > @@ -0,0 +1,45 @@ > +/* > + * Copyright =C2=A9 2021 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. > + */ Can we please replace these headers with SPDX headers (note SPDX headers for .c and .h files are different but we have plenty in the code). > + > +#ifndef GEM_MEMORY_TOPOLOGY_H > +#define GEM_MEMORY_TOPOLOGY_H > + > +#include > + > +#include "i915_drm.h" > + > +struct gem_memory_region { > + struct gem_memory_region *next; > + char *name; > + > + struct drm_i915_gem_memory_class_instance ci; > + uint64_t size; > +}; > + > +struct gem_memory_region *__gem_get_memory_regions(int i915); > +struct gem_memory_region * > +__gem_next_memory_region(struct gem_memory_region *r); > + > +#define for_each_memory_region(r__, fd__) for (struct gem_memory_region = *r__ =3D __gem_get_memory_regions(fd__); r__; r__ =3D __gem_next_memory_reg= ion(r__)) Let me ask about this too on the mailing list. We already have equivalent functionality using get_memory_region_set()/for_each_combination(), the macros introduced here are actually simpler. But any objection to introducing these since we already have equivalent functionality?