From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DED0CD37B1 for ; Tue, 3 Sep 2024 20:52:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3718610E147; Tue, 3 Sep 2024 20:52:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="eCuf0mLm"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3239C10E147 for ; Tue, 3 Sep 2024 20:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725396776; x=1756932776; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=HYh6LQXl2BD4JQIT5yUdxDEXrbFG1O4j+pxfdZ8AZMo=; b=eCuf0mLma00mt0RnsdhOiRNutw+UudbTiICHiHMgWpQi/+WqX7dOYcQd FH79XrRouwsAdkAjK68Wn6OvCk2e+pN9JxhFEpOk4ay6aE3f7GZ2yBQac U/lFaS+1TULOX2yT3f9oMk8r7Fawq9AXHlG+OzDWL0cCIvkwwb8XEN9ju Vy/7x4dmJ8mE8zYAE9Nx4jGQexe7h5HU4TpvzxC5EynIyjq9E/7Q3Msnt W5vvLm18qO+eVXxOosNCviqIzRz3qUBJeoPDw10b0BdeOswxAGoAxNv0r EUXRiVF0HFwe4RZ2X2TlLIkFRPKZm1ESAGN3Llz6DeHGWfIDa3eRPh0jJ A==; X-CSE-ConnectionGUID: erYN2d1DQfCmKs9rvgJawA== X-CSE-MsgGUID: ivoT7AaVSC+2ZbWOd8ljDw== X-IronPort-AV: E=McAfee;i="6700,10204,11184"; a="13353434" X-IronPort-AV: E=Sophos;i="6.10,199,1719903600"; d="scan'208";a="13353434" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2024 13:52:56 -0700 X-CSE-ConnectionGUID: IG5vQe8mTLq6vTh5CkWyXQ== X-CSE-MsgGUID: Pbb0xykbT5imwsGU8w8GlA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,199,1719903600"; d="scan'208";a="64688972" Received: from jtuanzol-mobl2.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.125.129.72]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2024 13:52:57 -0700 Date: Tue, 03 Sep 2024 13:50:32 -0700 Message-ID: <874j6wzckn.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Jani Nikula Cc: igt-dev@lists.freedesktop.org Subject: Re: [PATCH i-g-t 1/2] lib/xe/oa: simplify device id array initialization In-Reply-To: <20240902134907.2186238-1-jani.nikula@intel.com> References: <20240902134907.2186238-1-jani.nikula@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On Mon, 02 Sep 2024 06:49:06 -0700, Jani Nikula wrote: > > Stop abusing INTEL_VGA_DEVICE when we can simply define our own macro > for initializing uint16_t arrays. Reviewed-by: Ashutosh Dixit > > Signed-off-by: Jani Nikula > --- > lib/xe/xe_oa.c | 23 +++++++++-------------- > 1 file changed, 9 insertions(+), 14 deletions(-) > > diff --git a/lib/xe/xe_oa.c b/lib/xe/xe_oa.c > index 4764ed1fcfb8..1bc2eeb0a11a 100644 > --- a/lib/xe/xe_oa.c > +++ b/lib/xe/xe_oa.c > @@ -112,16 +112,15 @@ unsupported_xe_oa_platform(struct intel_xe_perf *perf) > return NULL; > } > > +#define DEVID(_id) (_id) > + > static bool > is_acm_gt1(const struct intel_xe_perf_devinfo *devinfo) > { > -#undef INTEL_VGA_DEVICE > -#define INTEL_VGA_DEVICE(_id, _info) _id > static const uint32_t devids[] = { > - XE_DG2_G11_IDS(INTEL_VGA_DEVICE, NULL), > - XE_ATS_M75_IDS(INTEL_VGA_DEVICE, NULL), > + XE_DG2_G11_IDS(DEVID), > + XE_ATS_M75_IDS(DEVID), > }; > -#undef INTEL_VGA_DEVICE > for (uint32_t i = 0; i < ARRAY_SIZE(devids); i++) { > if (devids[i] == devinfo->devid) > return true; > @@ -133,12 +132,9 @@ is_acm_gt1(const struct intel_xe_perf_devinfo *devinfo) > static bool > is_acm_gt2(const struct intel_xe_perf_devinfo *devinfo) > { > -#undef INTEL_VGA_DEVICE > -#define INTEL_VGA_DEVICE(_id, _info) _id > static const uint32_t devids[] = { > - XE_DG2_G12_IDS(INTEL_VGA_DEVICE, NULL), > + XE_DG2_G12_IDS(DEVID), > }; > -#undef INTEL_VGA_DEVICE > for (uint32_t i = 0; i < ARRAY_SIZE(devids); i++) { > if (devids[i] == devinfo->devid) > return true; > @@ -150,13 +146,10 @@ is_acm_gt2(const struct intel_xe_perf_devinfo *devinfo) > static bool > is_acm_gt3(const struct intel_xe_perf_devinfo *devinfo) > { > -#undef INTEL_VGA_DEVICE > -#define INTEL_VGA_DEVICE(_id, _info) _id > static const uint32_t devids[] = { > - XE_DG2_G10_IDS(INTEL_VGA_DEVICE, NULL), > - XE_ATS_M150_IDS(INTEL_VGA_DEVICE, NULL), > + XE_DG2_G10_IDS(DEVID), > + XE_ATS_M150_IDS(DEVID), > }; > -#undef INTEL_VGA_DEVICE > for (uint32_t i = 0; i < ARRAY_SIZE(devids); i++) { > if (devids[i] == devinfo->devid) > return true; > @@ -165,6 +158,8 @@ is_acm_gt3(const struct intel_xe_perf_devinfo *devinfo) > return false; > } > > +#undef DEVID > + > struct intel_xe_perf * > intel_xe_perf_for_devinfo(uint32_t device_id, > uint32_t revision, > -- > 2.39.2 >