From patchwork Wed Apr 8 12:55:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonas Lahtinen X-Patchwork-Id: 6179181 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 F2CF7BF4A6 for ; Wed, 8 Apr 2015 12:55:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28081202A1 for ; Wed, 8 Apr 2015 12:55:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 272A42027D for ; Wed, 8 Apr 2015 12:55:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E9876E060; Wed, 8 Apr 2015 05:55:53 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id D1E3B6E060 for ; Wed, 8 Apr 2015 05:55:51 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 08 Apr 2015 05:55:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,544,1422950400"; d="scan'208";a="692160047" Received: from unknown (HELO [10.252.26.85]) ([10.252.26.85]) by fmsmga001.fm.intel.com with ESMTP; 08 Apr 2015 05:55:44 -0700 Message-ID: <1428497741.7407.11.camel@jlahtine-mobl1> From: Joonas Lahtinen To: intel-gfx@lists.freedesktop.org Date: Wed, 08 Apr 2015 15:55:41 +0300 In-Reply-To: <20150408110048.GH12214@nuc-i3427.alporthouse.com> References: <20150408110048.GH12214@nuc-i3427.alporthouse.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v3 1/2] tests/gem_mmap_gtt: clarify BO domain setting functions 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=-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 Add suffix and complementary function for CPU domain. v2: - Change function signatures to be consistent with the rest Signed-off-by: Joonas Lahtinen --- tests/gem_mmap_gtt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c index 55c66a2..115e398 100644 --- a/tests/gem_mmap_gtt.c +++ b/tests/gem_mmap_gtt.c @@ -43,11 +43,18 @@ static int OBJECT_SIZE = 16*1024*1024; -static void set_domain(int fd, uint32_t handle) +static void +set_domain_gtt(int fd, uint32_t handle) { gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); } +static void +set_domain_cpu(int fd, uint32_t handle) +{ + gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); +} + static void * mmap_bo(int fd, uint32_t handle) { @@ -245,7 +252,7 @@ test_write_gtt(int fd) /* prefault object into gtt */ dst_gtt = mmap_bo(fd, dst); - set_domain(fd, dst); + set_domain_gtt(fd, dst); memset(dst_gtt, 0, OBJECT_SIZE); munmap(dst_gtt, OBJECT_SIZE);