From patchwork Tue Sep 30 16:21:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5004191 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1F96BEEA6 for ; Tue, 30 Sep 2014 16:21:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D24ED2012F for ; Tue, 30 Sep 2014 16:21:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9D62520145 for ; Tue, 30 Sep 2014 16:21:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 258002A152; Tue, 30 Sep 2014 09:21:17 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 8EBCA2A152 for ; Tue, 30 Sep 2014 09:21:15 -0700 (PDT) Received: by mail-wg0-f42.google.com with SMTP id z12so4840374wgg.13 for ; Tue, 30 Sep 2014 09:21:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=1XZcOtR92EnLilyDYB3R8ycc9I/XMCom8CNhWFgNhU0=; b=XYS6uUFVGnY4zAQrYeEfpcHFUk4wRSRGjVsmp7+WRTqyvs2NT3dwf4VwD0hM9t84He ZLCDZhBTHFPNbLj2QdNdLrkdijq7C3hAT7OeJG9+ScEyacMcnPYqLdbw517/awYkLqxA ZJanjsQUh/kjWaI3gjjN2QcY9gm7Oba0GVYHk1gHXJCxmYIWSAOlAx/L0U3C5mS7G/9t kMAXXVFKI/qS8171urOip8EejnjqXLzB/wdInufCTGLCLaercnAC2A1a7f4ZFgU7rDrf U7n4XHduEGlaz4zw5GfMzS6MP4JPBkvkOKyTVZHwh2WdPO7LMhlZ2EGIeYEeA5t1ZyrG +XbA== X-Gm-Message-State: ALoCoQlTiCQLxuMjrJjm29hDmw6Ghz19gzwLgigh/uxho14f1F8oCSgE+yI6fIgn3tSyr1o5Cy7j X-Received: by 10.194.172.201 with SMTP id be9mr46145854wjc.62.1412094074793; Tue, 30 Sep 2014 09:21:14 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id h5sm19736188wje.8.2014.09.30.09.21.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Sep 2014 09:21:13 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Tue, 30 Sep 2014 17:21:10 +0100 Message-Id: <1412094070-24355-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <20140929163927.GZ4109@phenom.ffwll.local> References: <20140929163927.GZ4109@phenom.ffwll.local> Subject: [Intel-gfx] [PATCH i-g-t] lib: add a function to indicate activity X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Thomas Wood --- lib/igt_aux.c | 15 +++++++++++++++ lib/igt_aux.h | 1 + tests/kms_cursor_crc.c | 3 ++- tests/kms_fence_pin_leak.c | 4 ++-- tests/kms_flip.c | 2 +- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/igt_aux.c b/lib/igt_aux.c index c0ea0e2..7c07b7d 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -246,6 +246,21 @@ void igt_progress(const char *header, uint64_t i, uint64_t total) (long long unsigned)i * 100 / total); } +/** + * igt_print_activity: + * + * Print a '.' to indicate activity. This is printed without a newline and + * only if output is to a terminal. + */ +void igt_print_activity(void) +{ + if (!isatty(STDOUT_FILENO)) + return; + + igt_info("."); + fflush(stdout); +} + /* mappable aperture trasher helper */ drm_intel_bo **trash_bos; int num_trash_bos; diff --git a/lib/igt_aux.h b/lib/igt_aux.h index d958abe..d74bb8c 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -41,6 +41,7 @@ void igt_permute_array(void *array, unsigned size, unsigned i, unsigned j)); void igt_progress(const char *header, uint64_t i, uint64_t total); +void igt_print_activity(void); bool igt_check_boolean_env_var(const char *env_var, bool default_value); bool igt_aub_dump_enabled(void); diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index c348d7a..c6f0fe4 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -32,6 +32,7 @@ #include "igt_debugfs.h" #include "igt_kms.h" #include "intel_chipset.h" +#include "igt_aux.h" #ifndef DRM_CAP_CURSOR_WIDTH #define DRM_CAP_CURSOR_WIDTH 0x8 @@ -105,7 +106,7 @@ static void do_single_test(data_t *data, int x, int y) igt_plane_t *cursor; cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb); - igt_info("."); fflush(stdout); + igt_print_activity(); /* Hardware test */ igt_paint_test_pattern(cr, data->screenw, data->screenh); diff --git a/tests/kms_fence_pin_leak.c b/tests/kms_fence_pin_leak.c index 69f36b8..fe2a038 100644 --- a/tests/kms_fence_pin_leak.c +++ b/tests/kms_fence_pin_leak.c @@ -33,6 +33,7 @@ #include "igt_kms.h" #include "ioctl_wrappers.h" #include "intel_chipset.h" +#include "igt_aux.h" typedef struct { int drm_fd; @@ -173,8 +174,7 @@ static bool run_single_test(data_t *data, enum pipe pipe, igt_output_t *output) igt_plane_set_fb(primary, &fb[!(i&1)]); igt_display_commit(display); - igt_info("."); - fflush(stdout); + igt_print_activity(); } igt_plane_set_fb(primary, NULL); diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 3d3aa9b..adf5a28 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -885,7 +885,7 @@ static unsigned int run_test_step(struct test_output *o) join_vblank_wait_thread(); } - igt_info("."); fflush(stdout); + igt_print_activity(); if (do_flip && (o->flags & TEST_HANG)) { hang = hang_gpu(drm_fd);