From patchwork Fri Dec 8 15:21:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 10102787 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 1588060329 for ; Fri, 8 Dec 2017 15:21:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C89FE28619 for ; Fri, 8 Dec 2017 15:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD5F128D59; Fri, 8 Dec 2017 15:21:57 +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 7A0A128619 for ; Fri, 8 Dec 2017 15:21:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7A4F6E932; Fri, 8 Dec 2017 15:21:56 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 467486E92C for ; Fri, 8 Dec 2017 15:21:53 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2017 07:21:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,378,1508828400"; d="scan'208";a="157090354" Received: from delly.ld.intel.com ([10.103.238.204]) by orsmga004.jf.intel.com with ESMTP; 08 Dec 2017 07:21:52 -0800 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Dec 2017 15:21:41 +0000 Message-Id: <20171208152144.10976-5-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171208152144.10976-1-lionel.g.landwerlin@intel.com> References: <20171208152144.10976-1-lionel.g.landwerlin@intel.com> Subject: [Intel-gfx] [PATCH i-g-t v3 4/7] tests/perf: factorize max oa buffer size define 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 We use this value in several places. Signed-off-by: Lionel Landwerlin Reviewed-by: Matthew Auld --- tests/perf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/perf.c b/tests/perf.c index 08ac106a..7f988d7c 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -81,6 +81,8 @@ IGT_TEST_DESCRIPTION("Test the i915 perf metrics streaming interface"); #define PIPE_CONTROL_PPGTT_WRITE (0 << 2) #define PIPE_CONTROL_GLOBAL_GTT_WRITE (1 << 2) +#define MAX_OA_BUF_SIZE (16 * 1024 * 1024) + struct accumulator { #define MAX_RAW_OA_COUNTERS 62 enum drm_i915_oa_format format; @@ -1336,7 +1338,7 @@ read_2_oa_reports(int format_id, * to indicate that the OA unit may be over taxed if lots of reports * are being lost. */ - int max_reports = (16 * 1024 * 1024) / format_size; + int max_reports = MAX_OA_BUF_SIZE / format_size; int buf_size = sample_size * max_reports * 1.5; uint8_t *buf = malloc(buf_size); int n = 0; @@ -2654,7 +2656,7 @@ test_buffer_fill(void) int buf_size = 65536 * (256 + sizeof(struct drm_i915_perf_record_header)); uint8_t *buf = malloc(buf_size); int len; - size_t oa_buf_size = 16 * 1024 * 1024; + size_t oa_buf_size = MAX_OA_BUF_SIZE; size_t report_size = get_oa_format(test_oa_format).size; int n_full_oa_reports = oa_buf_size / report_size; uint64_t fill_duration = n_full_oa_reports * oa_period; @@ -2823,7 +2825,7 @@ test_enable_disable(void) }; int buf_size = 65536 * (256 + sizeof(struct drm_i915_perf_record_header)); uint8_t *buf = malloc(buf_size); - size_t oa_buf_size = 16 * 1024 * 1024; + size_t oa_buf_size = MAX_OA_BUF_SIZE; size_t report_size = get_oa_format(test_oa_format).size; int n_full_oa_reports = oa_buf_size / report_size; uint64_t fill_duration = n_full_oa_reports * oa_period; @@ -3518,7 +3520,7 @@ gen8_test_single_ctx_render_target_writes_a_counter(void) size_t format_size = get_oa_format(test_oa_format).size; size_t sample_size = (sizeof(struct drm_i915_perf_record_header) + format_size); - int max_reports = (16 * 1024 * 1024) / format_size; + int max_reports = MAX_OA_BUF_SIZE / format_size; int buf_size = sample_size * max_reports * 1.5; int child_ret; uint8_t *buf = malloc(buf_size);