From patchwork Tue Nov 25 16:26:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5380671 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 505D6C11AC for ; Tue, 25 Nov 2014 16:26:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93219201C0 for ; Tue, 25 Nov 2014 16:26:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EE4B7200DE for ; Tue, 25 Nov 2014 16:26:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 874F96E95C; Tue, 25 Nov 2014 08:26:40 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by gabe.freedesktop.org (Postfix) with ESMTP id 27DF16E960 for ; Tue, 25 Nov 2014 08:26:39 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id r20so2029334wiv.14 for ; Tue, 25 Nov 2014 08:26:38 -0800 (PST) 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=0+OU7D7P8I7v+ad6hCad5p/I1GM8PQnWRPU445BKBys=; b=g3gYffHKFp7+FPSnxhf5Ih+fG/hy3SRJ1iTZTBaSChpcOj550sDazVCKDU9Ct2r1/W ptIorpw6It7Rgvthq9O906HQJoUqSgc/IlmJGpISaL7VcwHAdHzRkjn3J7G8+plkSf3U EyJFvlMF/PCB9hX/q6liiL5CB15yIDNRrCck3JN2v5R9/an+ibfkVgHGHmfrbOEosuJc P99p8h+POUQKC7cwcgc2hhsImjT2lbLxGpLBjl7EbPEh2xji5mV1LN+3ZOX0Sz5xZc6E u2CL76QjOjBxiD25bpWNENPE+G4fpEUDSIBRgGl6VNZ4XysyGw9SLAM0TlaDW52IfhGC wwwg== X-Gm-Message-State: ALoCoQkB+0lOH5s3T3UNNxnwNVIZ+3pc4lyX/CiDyFIszrwYinMJHK4bwfHbHpZeutuDokbzHdYq X-Received: by 10.180.90.16 with SMTP id bs16mr29692042wib.4.1416932798323; Tue, 25 Nov 2014 08:26:38 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id jp3sm17123297wid.9.2014.11.25.08.26.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Nov 2014 08:26:37 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Tue, 25 Nov 2014 16:26:25 +0000 Message-Id: <1416932786-8000-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1416932786-8000-1-git-send-email-thomas.wood@intel.com> References: <1416932786-8000-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/3] tests: use subtests in gem_tiled_swapping 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 --- tests/gem_tiled_swapping.c | 64 ++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c index 69d1cfa..11bb245 100644 --- a/tests/gem_tiled_swapping.c +++ b/tests/gem_tiled_swapping.c @@ -143,42 +143,46 @@ static void thread_fini(struct thread *t) free(t->idx_arr); } -igt_simple_main +igt_main { struct thread *threads; int fd, n, count, num_threads; - current_tiling_mode = I915_TILING_X; - - intel_purge_vm_caches(); - - fd = drm_open_any(); - /* need slightly more than available memory */ - count = intel_get_total_ram_mb() + intel_get_total_swap_mb() / 4; - bo_handles = calloc(count, sizeof(uint32_t)); - igt_assert(bo_handles); - - num_threads = gem_available_fences(fd); - threads = calloc(num_threads, sizeof(struct thread)); - igt_assert(threads); - - igt_log(IGT_LOG_INFO, - "Using %d 1MiB objects (available RAM: %ld/%ld, swap: %ld)\n", - count, - (long)intel_get_avail_ram_mb(), - (long)intel_get_total_ram_mb(), - (long)intel_get_total_swap_mb()); - intel_require_memory(count, 1024*1024, CHECK_RAM | CHECK_SWAP); - - for (n = 0; n < count; n++) { - bo_handles[n] = create_bo_and_fill(fd); - /* Not enough mmap address space possible. */ - igt_require(bo_handles[n]); + igt_fixture { + current_tiling_mode = I915_TILING_X; + + intel_purge_vm_caches(); + + fd = drm_open_any(); + /* need slightly more than available memory */ + count = intel_get_total_ram_mb() + intel_get_total_swap_mb() / 4; + bo_handles = calloc(count, sizeof(uint32_t)); + igt_assert(bo_handles); + + num_threads = gem_available_fences(fd); + threads = calloc(num_threads, sizeof(struct thread)); + igt_assert(threads); + + igt_log(IGT_LOG_INFO, + "Using %d 1MiB objects (available RAM: %ld/%ld, swap: %ld)\n", + count, + (long)intel_get_avail_ram_mb(), + (long)intel_get_total_ram_mb(), + (long)intel_get_total_swap_mb()); + intel_require_memory(count, 1024*1024, CHECK_RAM | CHECK_SWAP); + + for (n = 0; n < count; n++) { + bo_handles[n] = create_bo_and_fill(fd); + /* Not enough mmap address space possible. */ + igt_require(bo_handles[n]); + } } - thread_init(&threads[0], fd, count); - thread_run(&threads[0]); - thread_fini(&threads[0]); + igt_subtest("non-threaded") { + thread_init(&threads[0], fd, count); + thread_run(&threads[0]); + thread_fini(&threads[0]); + } /* Once more with threads */ igt_subtest("threaded") {