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 5A261C02182 for ; Tue, 21 Jan 2025 17:11:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18A5B10E60D; Tue, 21 Jan 2025 17:11:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="eGDNPzbc"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05CB910E61B for ; Tue, 21 Jan 2025 17:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737479464; x=1769015464; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=kSdFszBBWc7nMqZDx0+oJuBNKSWJgAN6btNpd7EN58E=; b=eGDNPzbccE7xFhpee/E+t7Ru4zXOQPUBLaq1LiCCpUzebX7DQo4HNCrZ Ji2ZTmjwIDzeiTUYamylOca0yh3rs00aS3ezSDdD0caKU7dggI3SMfxtL 4ruz/J3VqaTO0VF0nnwhopUFv0PPpZkkpwsyh4qF51WP2A69q7yAPUnJg YK0EhXVsLZF/nzsJZZ+OHXfBIDhX1aU/Lt5eFwbN7FAKf3TzJNCPtaETs 6Eh7ycHy+ouPUqdv3OMPlxAPslHPTsxhst2uWONEYRr+1jvgNEX14wyXs A993aEGJUOgugH5xWtf/ZzcGeIfYPSXJ9m58lqL0SP0vIEnqLuHprS7n4 A==; X-CSE-ConnectionGUID: ClidUf2gRaKppuiqPYzO8w== X-CSE-MsgGUID: 4zXcjdRZRdG3dLZi+MpB5w== X-IronPort-AV: E=McAfee;i="6700,10204,11322"; a="25501378" X-IronPort-AV: E=Sophos;i="6.13,222,1732608000"; d="scan'208";a="25501378" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2025 09:11:04 -0800 X-CSE-ConnectionGUID: HTleRaDzT7yOk0+lavri8A== X-CSE-MsgGUID: 0JOqTJdcQwexA0GWQHxviQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,222,1732608000"; d="scan'208";a="111847946" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.142]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2025 09:11:03 -0800 Date: Tue, 21 Jan 2025 09:11:03 -0800 Message-ID: <85frlcks7s.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Sai Teja Pottumuttu Cc: Subject: Re: [PATCH i-g-t v3 1/1] tests/intel/xe_oa: Extend non-zero-reason test In-Reply-To: <20250121115935.1654625-2-sai.teja.pottumuttu@intel.com> References: <20250121115935.1654625-1-sai.teja.pottumuttu@intel.com> <20250121115935.1654625-2-sai.teja.pottumuttu@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/28.2 (x86_64-redhat-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: 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" On Tue, 21 Jan 2025 03:59:35 -0800, Sai Teja Pottumuttu wrote: > > Extend non-zero-reason test to use/test configurable OA buffer size > property if the capability is available. > > v2 (Ashutosh): > - Define and use __for_one_hwe_in_oag_w_arg > - Introduce and use 'oau' variable at igt_main scope for parsing > capabilities > > v3: > - Limit the tests only to 16MB to make it faster (Ashutosh) Reviewed-by: Ashutosh Dixit > > Signed-off-by: Ashutosh Dixit > Signed-off-by: Sai Teja Pottumuttu > --- > tests/intel/xe_oa.c | 25 +++++++++++++++++++------ > 1 file changed, 19 insertions(+), 6 deletions(-) > > diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c > index df7fa3229..0242fd594 100644 > --- a/tests/intel/xe_oa.c > +++ b/tests/intel/xe_oa.c > @@ -2504,7 +2504,7 @@ again_1: > * Description: Test reason field is non-zero. Can also check OA buffer wraparound issues > */ > static void > -test_non_zero_reason(const struct drm_xe_engine_class_instance *hwe) > +test_non_zero_reason(const struct drm_xe_engine_class_instance *hwe, size_t oa_buffer_size) > { > /* ~20 micro second period */ > int oa_exponent = max_oa_exponent_for_period_lte(20000); > @@ -2522,6 +2522,7 @@ test_non_zero_reason(const struct drm_xe_engine_class_instance *hwe) > DRM_XE_OA_PROPERTY_OA_FORMAT, __ff(fmt), > DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT, oa_exponent, > DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE, hwe->engine_instance, > + DRM_XE_OA_PROPERTY_OA_BUFFER_SIZE, oa_buffer_size, > }; > struct intel_xe_oa_open_prop param = { > .num_properties = ARRAY_SIZE(properties) / 2, > @@ -2541,6 +2542,9 @@ test_non_zero_reason(const struct drm_xe_engine_class_instance *hwe) > load_helper_init(); > load_helper_run(HIGH); > > + if (!oa_buffer_size) > + param.num_properties = param.num_properties - 1; > + > stream_fd = __perf_open(drm_fd, ¶m, true /* prevent_pm */); > set_fd_flags(stream_fd, O_CLOEXEC); > > @@ -4779,6 +4783,11 @@ static const char *xe_engine_class_name(uint32_t engine_class) > igt_dynamic_f("%s-%d", xe_engine_class_name(hwe->engine_class), \ > hwe->engine_instance) > > +#define __for_one_hwe_in_oag_w_arg(hwe, str) \ > + if ((hwe = oa_unit_engine(drm_fd, 0))) \ > + igt_dynamic_f("%s-%d-%s", xe_engine_class_name(hwe->engine_class), \ > + hwe->engine_instance, str) > + > #define __for_one_render_engine_0(hwe) \ > xe_for_each_engine(drm_fd, hwe) \ > if (hwe->engine_class == DRM_XE_ENGINE_CLASS_RENDER) \ > @@ -4813,6 +4822,7 @@ igt_main > { NULL }, > }; > struct drm_xe_engine_class_instance *hwe = NULL; > + struct drm_xe_oa_unit *oau; > struct xe_device *xe_dev; > > igt_fixture { > @@ -4842,6 +4852,7 @@ igt_main > > /* See xe_query_oa_units_new() */ > igt_require(xe_dev->oa_units); > + oau = nth_oa_unit(drm_fd, 0); > > devid = intel_get_drm_devid(drm_fd); > sysfs = igt_sysfs_open(drm_fd); > @@ -4884,8 +4895,13 @@ igt_main > test_buffer_fill(hwe); > > igt_subtest_with_dynamic("non-zero-reason") { > - __for_one_hwe_in_oag(hwe) > - test_non_zero_reason(hwe); > + if (oau->capabilities & DRM_XE_OA_CAPS_OA_BUFFER_SIZE) { > + __for_one_hwe_in_oag_w_arg(hwe, "16M") > + test_non_zero_reason(hwe, SZ_16M); > + } else { > + __for_one_hwe_in_oag_w_arg(hwe, "default") > + test_non_zero_reason(hwe, 0); > + } > } > > igt_subtest("disabled-read-error") > @@ -5016,9 +5032,6 @@ igt_main > > igt_subtest_group { > igt_fixture { > - struct drm_xe_query_oa_units *qoa = xe_oa_units(drm_fd); > - struct drm_xe_oa_unit *oau = (struct drm_xe_oa_unit *)&qoa->oa_units[0]; > - > igt_require(oau->capabilities & DRM_XE_OA_CAPS_SYNCS); > } > > -- > 2.34.1 >