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 1DF02C2BA1A for ; Thu, 20 Jun 2024 20:01:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 787A310E190; Thu, 20 Jun 2024 20:01:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="V6H4WKUu"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 245C610E889 for ; Thu, 20 Jun 2024 20:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718913660; x=1750449660; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=eOnPgt76OpEFMcBn+YYXvOz0R0XAsh8AGUqhO/ZAO5A=; b=V6H4WKUuteHwDEIdZkP7NUPEOtvaedyBuYweOwjnEP4Oo9u9zdW0vgoU zssAveWedIvXA3xT/o5MkHU8YFl0oTgVf7PabJk9QfaeelwhN+yhXxHYd HunVpstssoQUvCstFYt21w6+4/CznpKeg/OtKJCCc9GIgr5brfisNLU7E +TxjyywBC1ylq2Oz78jpGh+1JJCvvqup2YDnrsD0AE6QBdsa1UGlR6o9v 8Pyg8yA6hZ2L4eaUln2h2ICKOe2JQQIZ3sYfdHPGlvN7y+ny+xbmOEig2 QdEPiyTynZdq2VvQy3HSA1uvrwvhKoMN7GKLv/CzbcxaDzno8yh58KGBT A==; X-CSE-ConnectionGUID: VLxRHni/R4mP75zqVjwcRQ== X-CSE-MsgGUID: +PKiQuz8Trmpo3C47Ryq/w== X-IronPort-AV: E=McAfee;i="6700,10204,11109"; a="41329326" X-IronPort-AV: E=Sophos;i="6.08,252,1712646000"; d="scan'208";a="41329326" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2024 13:00:59 -0700 X-CSE-ConnectionGUID: Jv06fUC7TJCJKFlkAsg3Yg== X-CSE-MsgGUID: CN3NNSJJSYqawL3xkdCTOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,252,1712646000"; d="scan'208";a="42459846" Received: from orsosgc001.jf.intel.com ([10.165.21.138]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2024 13:00:59 -0700 From: Ashutosh Dixit To: igt-dev@lists.freedesktop.org Subject: [PATCH i-g-t 09/28] tests/intel/xe_query: Add OA units query test Date: Thu, 20 Jun 2024 13:00:34 -0700 Message-ID: <20240620200054.3550653-10-ashutosh.dixit@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240620200054.3550653-1-ashutosh.dixit@intel.com> References: <20240620200054.3550653-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 --- 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