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 97DE2C3065A for ; Fri, 28 Jun 2024 20:44:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1497A10ED52; Fri, 28 Jun 2024 20:44:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Kup9o86W"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDDFE10E0BB for ; Fri, 28 Jun 2024 20:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719607436; x=1751143436; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=C/I4YVXzlAWLgyYTBj/0t0uvqGURHISlGuvj1Ibmhuo=; b=Kup9o86WrGTsFM4eI4v9xqszKq/PFUdZl28dkPiWyE3m+iHs2WEyFaIN G8paKmTC+3OYMRW6X2T6aC3V5xDjB4FOHDyqmdnL48VamnVNM8ne4G2tB ufa2c79peryCnkeX+8l1TJDXnqLAgShaRuw6IsJhzWEYVqjfbue78v34z tf2HMOTkP3QQjMW9iy3MOgYmsRWJFq7nrAh2Kd+O8Y5Hj5mhO0ioJ9TSJ OWr4fUMvXDJC1pTfvJK6+v1XiM8eZAZrV8R89j2CFkho2MxMnFQFGi/S7 hnMfOfgxxcZBpmdLXLDSn62X903xCIivIrR6x/1ss5wgWYMBd3YPEN4pD A==; X-CSE-ConnectionGUID: hXlADibdSLe+8IijFxkZpQ== X-CSE-MsgGUID: 4MVYWjhaSl+bXvGh5+KlHA== X-IronPort-AV: E=McAfee;i="6700,10204,11117"; a="27427489" X-IronPort-AV: E=Sophos;i="6.09,170,1716274800"; d="scan'208";a="27427489" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2024 13:43:55 -0700 X-CSE-ConnectionGUID: 4ctGZxC8QTCH3fnBqddSUw== X-CSE-MsgGUID: PrmL6S3ATOGIYFacf6G51g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,170,1716274800"; d="scan'208";a="49465206" Received: from orsosgc001.jf.intel.com ([10.165.21.138]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2024 13:43:55 -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: Fri, 28 Jun 2024 13:43:41 -0700 Message-ID: <20240628204348.2142940-10-ashutosh.dixit@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240628204348.2142940-1-ashutosh.dixit@intel.com> References: <20240628204348.2142940-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