From patchwork Tue Apr 25 22:32:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 9699915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 266B1601D3 for ; Tue, 25 Apr 2017 22:33:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20E1A284EE for ; Tue, 25 Apr 2017 22:33:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15C1B2857F; Tue, 25 Apr 2017 22:33:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D0D0F284EE for ; Tue, 25 Apr 2017 22:33:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78FF06E600; Tue, 25 Apr 2017 22:33:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E86F6E0F4 for ; Tue, 25 Apr 2017 22:33:08 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 25 Apr 2017 15:33:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,251,1488873600"; d="scan'208";a="93786951" Received: from ezarza-mobl5.amr.corp.intel.com (HELO delly.amr.corp.intel.com) ([10.254.68.206]) by fmsmga005.fm.intel.com with ESMTP; 25 Apr 2017 15:33:08 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Tue, 25 Apr 2017 15:32:47 -0700 Message-Id: <20170425223301.23733-16-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170425223301.23733-1-lionel.g.landwerlin@intel.com> References: <20170425223301.23733-1-lionel.g.landwerlin@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 15/29] igt/perf: don't assume constant of 40 EUs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Bragg Signed-off-by: Robert Bragg Reviewed-by: Lionel Landwerlin --- tests/perf.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/perf.c b/tests/perf.c index 62bfd80f..9a8c54fc 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -239,6 +239,7 @@ static bool gen8_undefined_a_counters[45]; static int drm_fd = -1; static uint32_t devid; static int card = -1; +static int n_eus; static uint64_t test_metric_set_id = UINT64_MAX; static uint64_t gt_min_freq_mhz_saved = 0; @@ -506,7 +507,20 @@ init_sys_info(void) test_oa_format = I915_OA_FORMAT_A45_B8_C8; undefined_a_counters = hsw_undefined_a_counters; read_report_ticks = hsw_read_report_ticks; + + if (intel_gt(devid) == 0) + n_eus = 10; + else if (intel_gt(devid) == 1) + n_eus = 20; + else if (intel_gt(devid) == 2) + n_eus = 40; + else { + igt_assert(!"reached"); + return false; + } } else { + drm_i915_getparam_t gp; + test_set_name = "TestOa"; test_oa_format = I915_OA_FORMAT_A32u40_A4u32_B8_C8; undefined_a_counters = gen8_undefined_a_counters; @@ -537,6 +551,10 @@ init_sys_info(void) timestamp_frequency = 19200000; } else return false; + + gp.param = I915_PARAM_EU_TOTAL; + gp.value = &n_eus; + do_ioctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp); } igt_debug("%s metric set UUID = %s\n", @@ -1077,11 +1095,11 @@ test_oa_formats(void) igt_debug("clock delta = %"PRIu32"\n", clock_delta); /* The maximum rate for any HSW counter = - * clock_delta * 40 EUs + * clock_delta * N EUs * * Sanity check that no counters exceed this delta. */ - max_delta = clock_delta * 40; + max_delta = clock_delta * n_eus; for (int j = 0; j < oa_formats[i].n_a; j++) { int a_id = oa_formats[i].first_a + j;