From patchwork Wed Jun 24 10:20:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 6666701 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7462BC05AC for ; Wed, 24 Jun 2015 10:20:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97F84206DF for ; Wed, 24 Jun 2015 10:20:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AFF2E20605 for ; Wed, 24 Jun 2015 10:20:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D95D6E90A; Wed, 24 Jun 2015 03:20:43 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B14B6E90A for ; Wed, 24 Jun 2015 03:20:41 -0700 (PDT) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from nuc-i3427.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 41446649-1500048 for multiple; Wed, 24 Jun 2015 11:21:19 +0100 Received: by nuc-i3427.alporthouse.com (sSMTP sendmail emulation); Wed, 24 Jun 2015 11:20:37 +0100 Date: Wed, 24 Jun 2015 11:20:37 +0100 From: Chris Wilson To: Michel Thierry Message-ID: <20150624102037.GH12403@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Michel Thierry , intel-gfx@lists.freedesktop.org References: <1435062089-19877-1-git-send-email-michel.thierry@intel.com> <1435062089-19877-3-git-send-email-michel.thierry@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1435062089-19877-3-git-send-email-michel.thierry@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH igt 1/2] lib: Update intel_require_memory to handle +4GB cases 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 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 On Tue, Jun 23, 2015 at 01:21:28PM +0100, Michel Thierry wrote: > Changed size from u32 to u64 to support +4GB. > 48-bit PPGTT test cases may need extra memory available. > > Signed-off-by: Michel Thierry > --- > lib/igt_aux.h | 2 +- > lib/intel_os.c | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/lib/igt_aux.h b/lib/igt_aux.h > index b2dc267..922ae5b 100644 > --- a/lib/igt_aux.h > +++ b/lib/igt_aux.h > @@ -86,7 +86,7 @@ uint64_t intel_get_avail_ram_mb(void); > uint64_t intel_get_total_ram_mb(void); > uint64_t intel_get_total_swap_mb(void); > > -void intel_require_memory(uint32_t count, uint32_t size, unsigned mode); > +void intel_require_memory(uint32_t count, uint64_t size, unsigned mode); > #define CHECK_RAM 0x1 > #define CHECK_SWAP 0x2 > > diff --git a/lib/intel_os.c b/lib/intel_os.c > index 3321a8d..2650788 100644 > --- a/lib/intel_os.c > +++ b/lib/intel_os.c > @@ -215,7 +215,7 @@ intel_get_total_swap_mb(void) > * assumption that any test that needs to check for memory requirements is a > * thrashing test unsuitable for slow simulated systems. > */ > -void intel_require_memory(uint32_t count, uint32_t size, unsigned mode) > +void intel_require_memory(uint32_t count, uint64_t size, unsigned mode) > { > /* rough estimate of how many bytes the kernel requires to track each object */ > #define KERNEL_BO_OVERHEAD 512 > @@ -225,8 +225,8 @@ void intel_require_memory(uint32_t count, uint32_t size, unsigned mode) > required *= size + KERNEL_BO_OVERHEAD; > required = ALIGN(required, 4096); > > - igt_debug("Checking %u surfaces of size %u bytes (total %llu) against %s%s\n", > - count, size, (long long)required, > + igt_debug("Checking %u surfaces of size %llu bytes (total %llu) against %s%s\n", I think this is probably a good time to start putting thousand separators into the output "%'llu" (hoping that we have gcc everywhere). This would also need -Chris diff --git a/lib/igt_core.c b/lib/igt_core.c index 1367863..8ac1f33 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -55,6 +55,7 @@ #include #include #include +#include #include "drmtest.h" #include "intel_chipset.h" @@ -523,6 +524,9 @@ static int common_init(int *argc, char **argv, int ret = 0; char *env = getenv("IGT_LOG_LEVEL"); + if (isatty(STDOUT_FILENO)) + setlocale(LC_ALL, ""); + if (env) { if (strcmp(env, "debug") == 0) igt_log_level = IGT_LOG_DEBUG;