From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 91E7010E31A for ; Tue, 27 Jun 2023 18:03:37 +0000 (UTC) From: Himal Prasad Ghimiray To: igt-dev@lists.freedesktop.org Date: Tue, 27 Jun 2023 23:38:03 +0530 Message-Id: <20230627180805.4189160-3-himal.prasad.ghimiray@intel.com> In-Reply-To: <20230627180805.4189160-1-himal.prasad.ghimiray@intel.com> References: <20230627180805.4189160-1-himal.prasad.ghimiray@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH v4 2/4] lib/igt_sysfs: Handling gt related sysfs uapi changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Upadhyay Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: Patch https://patchwork.freedesktop.org/series/118927/ is moving gt sysfs parent under tile folder. With the above patch path for sysfs changes: from: /sys/class/drm/cardX/device/gtN/ to : /sys/class/drm/cardX/device/tileN/gtN Adding xe_for_each_gt_under_each_tile macro to access new path. v2: - Calculate number of tiles once within iterator. (Rahul) v3: - Drop usage of local variable for tilecount. - Change order of tile and gt. (Ashutosh) Reviewed-by: Upadhyay Cc: Aravind Iddamsetty Cc: Upadhyay Cc: Janga Rahul Kumar Cc: Francois Dugast Cc: Ashutosh Dixit Cc: Matt Roper Signed-off-by: Himal Prasad Ghimiray --- lib/igt_sysfs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h index de2c9a86..e4a0451b 100644 --- a/lib/igt_sysfs.h +++ b/lib/igt_sysfs.h @@ -80,6 +80,12 @@ #define xe_for_each_tile for_each_sysfs_tile_dirfd +/* FIXME: Need to revisit if GT indexing under TILE changes from KMD */ +#define xe_for_each_gt_under_each_tile(xe__, tile__, gt__) \ + for (gt__ = 0, tile__ = 0; \ + gt__ < xe_number_gt(xe__); \ + (xe_number_gt(xe__) == igt_sysfs_get_num_tiles(xe__)) ? ++gt__, ++tile__ : ++gt__) + enum i915_attr_id { RPS_ACT_FREQ_MHZ, RPS_CUR_FREQ_MHZ, -- 2.25.1