From patchwork Wed Feb 13 16:29:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2137801 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id DD2EDDFE75 for ; Wed, 13 Feb 2013 16:47:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1ED2E67E2 for ; Wed, 13 Feb 2013 08:47:02 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 32F1CE6778 for ; Wed, 13 Feb 2013 08:29:10 -0800 (PST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 13 Feb 2013 08:29:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,658,1355126400"; d="scan'208";a="256452950" Received: from unknown (HELO dyon.amr.corp.intel.com) ([10.255.12.243]) by azsmga001.ch.intel.com with ESMTP; 13 Feb 2013 08:29:08 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Wed, 13 Feb 2013 16:29:01 +0000 Message-Id: <1360772942-4144-2-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <1360772942-4144-1-git-send-email-damien.lespiau@intel.com> References: <1360772942-4144-1-git-send-email-damien.lespiau@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] =?utf-8?q?=5BPATCH_1/2=5D_lib=3A_Add_a_way_to_specify?= =?utf-8?q?_values_for_=22quick=22_runs?= X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org In some environments, we don't really want to loop 100000 times or allocate 152352621 buffers because it makes the tests too long to run. This adds a way to specify "quick" values to reduce the time taken by certain tests. Signed-off-by: Damien Lespiau --- lib/drmtest.c | 22 +++++++++++++++++++++- lib/drmtest.h | 3 +++ 2 files changed, 24 insertions(+), 1 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 8518bde..117fb31 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1,5 +1,5 @@ /* - * Copyright © 2007, 2011 Intel Corporation + * Copyright © 2007, 2011, 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -37,6 +37,7 @@ #include #include #include +#include #include "drmtest.h" #include "i915_drm.h" @@ -573,6 +574,25 @@ bool drmtest_only_list_subtests(void) return list_subtests; } +bool drmtest_run_quick(void) +{ + static int run_quick = -1; + + if (run_quick == -1) { + char *igt_quick; + + igt_quick = getenv("IGT_QUICK"); + if (!igt_quick) { + run_quick = 0; + goto out; + } + + run_quick = atoi(igt_quick); + } +out: + return run_quick; +} + /* other helpers */ void drmtest_exchange_int(void *array, unsigned i, unsigned j) { diff --git a/lib/drmtest.h b/lib/drmtest.h index 2000b70..78732a0 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -88,6 +88,9 @@ void drmtest_subtest_init(int argc, char **argv); bool drmtest_run_subtest(const char *subtest_name); bool drmtest_only_list_subtests(void); +bool drmtest_run_quick(void); +#define SLOW_QUICK(slow,quick) (drmtest_run_quick() ? (quick) : (slow)) + /* helpers based upon the libdrm buffer manager */ void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr); void drmtest_trash_aperture(void);