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 8E3FCC61CE7 for ; Fri, 6 Jun 2025 16:05:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2318410EAEC; Fri, 6 Jun 2025 16:05:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="b3NZXFZL"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id A8F7610EAEC for ; Fri, 6 Jun 2025 16:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1749225919; x=1780761919; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=n6wChvFrYx4QrJS4GXuIGITZgYUFagVCqZ7Zyyeonjw=; b=b3NZXFZL+L4ftyhCLtdjMZCFYLo+8Eqnc1iZpeEyv9x7Rg7sA1FGrtfn VLDiBkI0khkL3A+/a44yviTf6VoZU0PgFTOMQ3eGGL58yXFW5ilVHFzAh O+dxLE8hEKaPWVfJrmyN7TOQP17aBsbqNTRk85wwmbUNxr4V2k2Yq2cDr 8NqzQauihKfE2UcFV4jsQ2l1lxopen8yp8fFLW9c654DwvODN3/lRSIxb e4l6OVPtZsViFWrjGzkeXNBpTR0z+30Gg6tyi5qNmuUXVSpo4PY+17J5K CGTRtkDMYXuQdfQvjBLV6wQTV6K2p9vWMggvCgEXkDVLL/Gp73I/2rgF+ Q==; X-CSE-ConnectionGUID: I4PNnEy1QhO+UgOxhMjlEg== X-CSE-MsgGUID: T36/ieQTRQK0RRGgjg+i3w== X-IronPort-AV: E=McAfee;i="6800,10657,11456"; a="62002757" X-IronPort-AV: E=Sophos;i="6.16,215,1744095600"; d="scan'208";a="62002757" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2025 09:05:18 -0700 X-CSE-ConnectionGUID: S/0fZNW5T5GtXuXrqxfw7w== X-CSE-MsgGUID: +fLsAIhhS2muhOu+agf8UA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,215,1744095600"; d="scan'208";a="146815065" Received: from kcgill-mobl.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.48.241]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2025 09:05:18 -0700 Date: Fri, 06 Jun 2025 09:05:17 -0700 Message-ID: <87y0u4ua82.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa Cc: Subject: Re: [PATCH 2/5] drm/xe/oa: Print hwe to OA unit mapping In-Reply-To: References: <20250603202133.2713863-1-ashutosh.dixit@intel.com> <20250603202133.2713863-3-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/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: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Wed, 04 Jun 2025 16:49:11 -0700, Umesh Nerlige Ramappa wrote: > > On Tue, Jun 03, 2025 at 01:21:30PM -0700, Ashutosh Dixit wrote: > > Print hwe to OA unit mapping to dmesg, to help debug for current and new > > platforms. > > > > Signed-off-by: Ashutosh Dixit > > --- > > drivers/gpu/drm/xe/xe_oa.c | 27 +++++++++++++++++++++++++++ > > 1 file changed, 27 insertions(+) > > > > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c > > index 0de0d5a18df74..94faa4ed2012f 100644 > > --- a/drivers/gpu/drm/xe/xe_oa.c > > +++ b/drivers/gpu/drm/xe/xe_oa.c > > @@ -2603,6 +2603,31 @@ static int xe_oa_init_gt(struct xe_gt *gt) > > return 0; > > } > > > > +static void xe_oa_print_oa_units(struct xe_oa *oa) > > +{ > > + enum xe_hw_engine_id hwe_id; > > + struct xe_hw_engine *hwe; > > + struct xe_oa_unit *u; > > + struct xe_gt *gt; > > + int gt_id, i, n; > > + char buf[256]; > > + > > + for_each_gt(gt, oa->xe, gt_id) { > > + for (i = 0; i < gt->oa.num_oa_units; i++) { > > + u = >->oa.oa_unit[i]; > > + buf[0] = '\0'; > > + n = 0; > > + > > + for_each_hw_engine(hwe, gt, hwe_id) > > + if (xe_oa_unit_id(hwe) == u->oa_unit_id) > > + n += scnprintf(buf + n, sizeof(buf) - n, "%s ", hwe->name); > > + > > + xe_gt_dbg(gt, "oa_unit %d, type %d, Engines: %s\n", > > + u->oa_unit_id, u->type, buf); > > + } > > + } > > +} > > + > > nit: I would at least move one of the inner for loops outside to a separate > helper. Separated out the first inner loop into xe_oa_print_gt_oa_units(). > > otherwise, LGTM > > Reviewed-by: Umesh Nerlige Ramappa Thanks. -- Ashutosh > > > static int xe_oa_init_oa_units(struct xe_oa *oa) > > { > > struct xe_gt *gt; > > @@ -2619,6 +2644,8 @@ static int xe_oa_init_oa_units(struct xe_oa *oa) > > return ret; > > } > > > > + xe_oa_print_oa_units(oa); > > + > > return 0; > > } > > > > -- > > 2.48.1 > >