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 1ACFDC27C4F for ; Wed, 26 Jun 2024 20:54:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6148710E1CC; Wed, 26 Jun 2024 20:54:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="WSzLuMK2"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5516410E9B5 for ; Wed, 26 Jun 2024 20:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719435291; x=1750971291; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=C/I4YVXzlAWLgyYTBj/0t0uvqGURHISlGuvj1Ibmhuo=; b=WSzLuMK2IVYTXpQGA/3qo3mNV8o2DCaPQG0gGFcoOYix4mbcJyXHHA3N pnhuQCTndu/9V2BIVT6cDoEDRk0zMRw9RYmC9o6ASRSUsDr+ugQNUZAhY apNXJpxIgczI0inAN+Gj2srJAFDLGs7TBS6xUMQ80A1QPLZaG+d54Fb5t YNQLLBxNm0SzIF1qqnzobJDmdPtWlvL70ffNtaFMmG/arXFRMukxNv0xy WfwzoYeXVqVhfdrfrtS43xEY+Ql//DiUnX6ZrvneiM+BUnu9QBjKITLJT xLLp1xdggnLfhxEkrX2qnRghnG/ovKepdaFZ/1IbRazft3cr3ZZZH1pNq w==; X-CSE-ConnectionGUID: 3xltCu5YTP6LT0SXTgrDmA== X-CSE-MsgGUID: 0wt1KL53SUmgYwln/pf1aA== X-IronPort-AV: E=McAfee;i="6700,10204,11115"; a="27670995" X-IronPort-AV: E=Sophos;i="6.08,268,1712646000"; d="scan'208";a="27670995" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 13:54:50 -0700 X-CSE-ConnectionGUID: G3I+9nt1TW2vtxZ1y8iXfQ== X-CSE-MsgGUID: WHI3Q64wSfm01Jv2VKFggA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,268,1712646000"; d="scan'208";a="44018924" Received: from orsosgc001.jf.intel.com ([10.165.21.138]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 13:54:50 -0700 From: Ashutosh Dixit To: igt-dev@lists.freedesktop.org Subject: [PATCH i-g-t 09/16] tests/intel/xe_query: Add OA units query test Date: Wed, 26 Jun 2024 13:54:36 -0700 Message-ID: <20240626205443.1560171-10-ashutosh.dixit@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240626205443.1560171-1-ashutosh.dixit@intel.com> References: <20240626205443.1560171-1-ashutosh.dixit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" Add test to exercise OA units query. Signed-off-by: Ashutosh Dixit Reviewed-by: Umesh Nerlige Ramappa --- tests/intel/xe_query.c | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tests/intel/xe_query.c b/tests/intel/xe_query.c index 5b0db4d28b..92f82f6eef 100644 --- a/tests/intel/xe_query.c +++ b/tests/intel/xe_query.c @@ -995,6 +995,58 @@ test_query_uc_fw_version_huc(int fd) test_query_uc_fw_version(fd, XE_QUERY_UC_TYPE_HUC); } +/** + * SUBTEST: query-oa-units + * Description: Display fields for OA unit query + * + * SUBTEST: multigpu-query-oa-units + * Description: Display fields for OA unit query for all GPU devices + * Sub-category: MultiGPU + */ +static void test_query_oa_units(int fd) +{ + struct drm_xe_query_oa_units *qoa; + struct drm_xe_device_query query = { + .extensions = 0, + .query = DRM_XE_DEVICE_QUERY_OA_UNITS, + .size = 0, + .data = 0, + }; + struct drm_xe_oa_unit *oau; + int i, j; + u8 *poau; + + igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0); + + qoa = malloc(query.size); + igt_assert(qoa); + + query.data = to_user_pointer(qoa); + igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0); + + igt_info("num_oa_units %d\n", qoa->num_oa_units); + + poau = (u8 *)&qoa->oa_units[0]; + for (i = 0; i < qoa->num_oa_units; i++) { + oau = (struct drm_xe_oa_unit *)poau; + + igt_info("-------------------------------\n"); + igt_info("oa_unit %d\n", i); + igt_info("-------------------------------\n"); + igt_info("oa_unit_id %d\n", oau->oa_unit_id); + igt_info("oa_unit_type %d\n", oau->oa_unit_type); + igt_info("capabilities %#llx\n", oau->capabilities); + igt_info("oa_timestamp_freq %lld\n", oau->oa_timestamp_freq); + igt_info("num_engines %lld\n", oau->num_engines); + igt_info("Engines:"); + for (j = 0; j < oau->num_engines; j++) + igt_info(" (%d, %d)", oau->eci[j].engine_class, + oau->eci[j].engine_instance); + igt_info("\n"); + poau += sizeof(*oau) + j * sizeof(oau->eci[0]); + } +} + igt_main { const struct { @@ -1011,6 +1063,7 @@ igt_main { "query-cs-cycles", test_query_engine_cycles }, { "query-uc-fw-version-guc", test_query_uc_fw_version_guc }, { "query-uc-fw-version-huc", test_query_uc_fw_version_huc }, + { "query-oa-units", test_query_oa_units }, { "query-invalid-cs-cycles", test_engine_cycles_invalid }, { "query-invalid-query", test_query_invalid_query }, { "query-invalid-size", test_query_invalid_size }, -- 2.41.0