From patchwork Mon Oct 2 23:00:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniele Ceraolo Spurio X-Patchwork-Id: 9981309 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 7D90C60375 for ; Mon, 2 Oct 2017 23:00:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F7B028A0D for ; Mon, 2 Oct 2017 23:00:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6480528A0A; Mon, 2 Oct 2017 23:00:43 +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 0801B28A02 for ; Mon, 2 Oct 2017 23:00:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7ECEF6E07E; Mon, 2 Oct 2017 23:00:42 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id A17C06E38E for ; Mon, 2 Oct 2017 23:00:41 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2017 16:00:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,471,1500966000"; d="scan'208"; a="1020845606" Received: from relo-linux-1.fm.intel.com ([10.1.27.112]) by orsmga003.jf.intel.com with ESMTP; 02 Oct 2017 16:00:33 -0700 From: Daniele Ceraolo Spurio To: intel-gfx@lists.freedesktop.org Date: Mon, 2 Oct 2017 16:00:13 -0700 Message-Id: <1506985218-28880-2-git-send-email-daniele.ceraolospurio@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506985218-28880-1-git-send-email-daniele.ceraolospurio@intel.com> References: <1506985218-28880-1-git-send-email-daniele.ceraolospurio@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC i-g-t 1/6] tests/gem_pread: drop stolen memory related subtests 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-Virus-Scanned: ClamAV using ClamSMTP The feature was never merged and there has been no progress in the last year. The subtests are currently skipping on all platforms by checking a field in the get_aperture ioctl structure that doesn't exist in the kernel version of the struct. Signed-off-by: Daniele Ceraolo Spurio --- tests/gem_pread.c | 95 ------------------------------------------------------- 1 file changed, 95 deletions(-) diff --git a/tests/gem_pread.c b/tests/gem_pread.c index f4cf472..39a46ed 100644 --- a/tests/gem_pread.c +++ b/tests/gem_pread.c @@ -40,10 +40,6 @@ #include "drm.h" #define OBJECT_SIZE 16384 -#define LARGE_OBJECT_SIZE 1024 * 1024 -#define KGRN "\x1B[32m" -#define KRED "\x1B[31m" -#define KNRM "\x1B[0m" static void do_gem_read(int fd, uint32_t handle, void *buf, int len, int loops) { @@ -79,8 +75,6 @@ static const char *bytes_per_sec(char *buf, double v) uint32_t *src, dst; -uint32_t *dst_user, src_stolen, large_stolen; -uint32_t *stolen_pf_user, *stolen_nopf_user; int fd, count; int main(int argc, char **argv) @@ -113,8 +107,6 @@ int main(int argc, char **argv) dst = gem_create(fd, object_size); src = malloc(object_size); - src_stolen = gem_create_stolen(fd, object_size); - dst_user = malloc(object_size); } igt_subtest("basic") { @@ -151,96 +143,9 @@ int main(int argc, char **argv) } } - igt_subtest("stolen-normal") { - gem_require_stolen_support(fd); - for (count = 1; count <= 1<<17; count <<= 1) { - struct timeval start, end; - - gettimeofday(&start, NULL); - do_gem_read(fd, src_stolen, dst_user, object_size, count); - gettimeofday(&end, NULL); - usecs = elapsed(&start, &end, count); - bps = bytes_per_sec(buf, object_size/usecs*1e6); - igt_info("Time to pread %d bytes x %6d: %7.3fµs, %s\n", - object_size, count, usecs, bps); - fflush(stdout); - } - } - for (c = cache; c->level != -1; c++) { - igt_subtest_f("stolen-%s", c->name) { - gem_require_stolen_support(fd); - gem_set_caching(fd, src_stolen, c->level); - - for (count = 1; count <= 1<<17; count <<= 1) { - struct timeval start, end; - - gettimeofday(&start, NULL); - do_gem_read(fd, src_stolen, dst_user, - object_size, count); - gettimeofday(&end, NULL); - usecs = elapsed(&start, &end, count); - bps = bytes_per_sec(buf, object_size/usecs*1e6); - igt_info("Time to stolen-%s pread %d bytes x %6d: %7.3fµs, %s\n", - c->name, object_size, count, usecs, bps); - fflush(stdout); - } - } - } - - /* List the time taken in pread operation for stolen objects, with - * and without the overhead of page fault handling on accessing the - * user space buffer - */ - igt_subtest("pagefault-pread") { - gem_require_stolen_support(fd); - large_stolen = gem_create_stolen(fd, LARGE_OBJECT_SIZE); - stolen_nopf_user = (uint32_t *) mmap(NULL, LARGE_OBJECT_SIZE, - PROT_WRITE, - MAP_ANONYMOUS|MAP_PRIVATE, - -1, 0); - igt_assert(stolen_nopf_user); - - for (count = 1; count <= 10; count ++) { - struct timeval start, end; - double t_elapsed = 0; - - gettimeofday(&start, NULL); - do_gem_read(fd, large_stolen, stolen_nopf_user, - LARGE_OBJECT_SIZE, 1); - gettimeofday(&end, NULL); - t_elapsed = elapsed(&start, &end, count); - bps = bytes_per_sec(buf, object_size/t_elapsed*1e6); - igt_info("Pagefault-N - Time to pread %d bytes: %7.3fµs, %s\n", - LARGE_OBJECT_SIZE, t_elapsed, bps); - - stolen_pf_user = (uint32_t *) mmap(NULL, LARGE_OBJECT_SIZE, - PROT_WRITE, - MAP_ANONYMOUS|MAP_PRIVATE, - -1, 0); - igt_assert(stolen_pf_user); - - gettimeofday(&start, NULL); - do_gem_read(fd, large_stolen, stolen_pf_user, - LARGE_OBJECT_SIZE, 1); - gettimeofday(&end, NULL); - usecs = elapsed(&start, &end, count); - bps = bytes_per_sec(buf, object_size/usecs*1e6); - igt_info("Pagefault-Y - Time to pread %d bytes: %7.3fµs, %s%s%s\n", - LARGE_OBJECT_SIZE, usecs, - t_elapsed < usecs ? KGRN : KRED, bps, KNRM); - fflush(stdout); - munmap(stolen_pf_user, LARGE_OBJECT_SIZE); - } - munmap(stolen_nopf_user, LARGE_OBJECT_SIZE); - gem_close(fd, large_stolen); - } - - igt_fixture { free(src); gem_close(fd, dst); - free(dst_user); - gem_close(fd, src_stolen); close(fd); }