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 89B7BCCD185 for ; Fri, 10 Oct 2025 21:31:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D56510EC8C; Fri, 10 Oct 2025 21:31:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="exJ7eHxz"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1FC3C10EC9D for ; Fri, 10 Oct 2025 21:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1760131864; x=1791667864; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=1uVND3afnd5sIj82Q7nEqkZiBDwyJxbBOE8HFFbPamY=; b=exJ7eHxzOJCDdPB4SPC4kag+YrnyHi4zIT8k3eeNekeTMs7Noe3gQj4r QdM5EJtOM7eG+5Xve1mpj6/BhxAG6IBWCq9TFkNT2lQfzoFkuOtwjzt07 9B+NHXXq6tqcfdx6U3gKVN7moAVwXnqFzWaaLwGfERdwRZ396SXQEKahj 6eYAm/NskSS48Cloln93cuhVlZSnYP+0qSbwgjpo89ks3gjkqADszYpfD urd9680ZR3n2v6zHn1cP6jca5K7fdnv2+oj3kQ/oxJ3GeYkxZ3QHJEKmF 7twrGGhWkk6VGgpt+PzN9rer8wMa8dR74vM2pMw8hjX5d8juRINjVVc3s w==; X-CSE-ConnectionGUID: JXSItQkoRAuvY1i3OaMlEw== X-CSE-MsgGUID: q5pknIO5SY2xKwW4EnISwA== X-IronPort-AV: E=McAfee;i="6800,10657,11578"; a="62254993" X-IronPort-AV: E=Sophos;i="6.19,220,1754982000"; d="scan'208";a="62254993" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2025 14:31:03 -0700 X-CSE-ConnectionGUID: PEctxxsxRPSFW/490x3gDA== X-CSE-MsgGUID: obslsY+DQ22biXsD5/Tncg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,220,1754982000"; d="scan'208";a="186196138" Received: from tbonifie-mobl1.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.179.111]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2025 14:31:03 -0700 Date: Fri, 10 Oct 2025 14:31:03 -0700 Message-ID: <87bjmewijs.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa Cc: Subject: Re: [PATCH i-g-t 03/18] tests/intel/xe_oa: Rename nth_oa_unit to oa_unit_by_id In-Reply-To: References: <20251008211806.625154-1-ashutosh.dixit@intel.com> <20251008211806.625154-4-ashutosh.dixit@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/30.2 (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 Wed, 08 Oct 2025 14:56:30 -0700, Umesh Nerlige Ramappa wrote: > > On Wed, Oct 08, 2025 at 02:17:50PM -0700, Ashutosh Dixit wrote: > > Rename nth_oa_unit to oa_unit_by_id. We will introduce oa_unit_by_type soon > > and oa_unit_by_id fits that naming scheme. > > > > Signed-off-by: Ashutosh Dixit > > nit: s/n/id/ in function params Fixed in v2. Thanks! > > Reviewed-by: Umesh Nerlige Ramappa > > > --- > > tests/intel/xe_oa.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c > > index a028823e51..65e03b1010 100644 > > --- a/tests/intel/xe_oa.c > > +++ b/tests/intel/xe_oa.c > > @@ -493,7 +493,7 @@ static struct drm_xe_engine_class_instance *oa_unit_engine(int fd, int n) > > return hwe; > > } > > > > -static struct drm_xe_oa_unit *nth_oa_unit(int fd, int n) > > +static struct drm_xe_oa_unit *oa_unit_by_id(int fd, int n) > > { > > struct drm_xe_query_oa_units *qoa = xe_oa_units(fd); > > struct drm_xe_oa_unit *oau; > > @@ -502,7 +502,7 @@ static struct drm_xe_oa_unit *nth_oa_unit(int fd, int n) > > poau = (u8 *)&qoa->oa_units[0]; > > for (int i = 0; i < qoa->num_oa_units; i++) { > > oau = (struct drm_xe_oa_unit *)poau; > > - if (i == n) > > + if (oau->oa_unit_id == n) > > return oau; > > poau += sizeof(*oau) + oau->num_engines * sizeof(oau->eci[0]); > > } > > @@ -4348,7 +4348,7 @@ test_oa_unit_concurrent_oa_buffer_read(void) > > struct drm_xe_engine_class_instance *hwe = oa_unit_engine(drm_fd, child); > > > > /* No OAM support yet */ > > - if (nth_oa_unit(drm_fd, child)->oa_unit_type != DRM_XE_OA_UNIT_TYPE_OAG) > > + if (oa_unit_by_id(drm_fd, child)->oa_unit_type != DRM_XE_OA_UNIT_TYPE_OAG) > > exit(0); > > > > test_blocking(40 * 1000 * 1000, false, 5 * 1000 * 1000, hwe); > > @@ -5027,7 +5027,7 @@ igt_main_args("b:t", long_options, help_str, opt_handler, NULL) > > /* See xe_query_oa_units_new() */ > > igt_require(xe_dev->oa_units); > > igt_require(xe_dev->oa_units->num_oa_units); > > - oau = nth_oa_unit(drm_fd, 0); > > + oau = oa_unit_by_id(drm_fd, 0); > > > > devid = intel_get_drm_devid(drm_fd); > > sysfs = igt_sysfs_open(drm_fd); > > -- > > 2.48.1 > >