From patchwork Wed Apr 8 10:50:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonas Lahtinen X-Patchwork-Id: 6178131 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 72D42BF4A6 for ; Wed, 8 Apr 2015 10:51:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B674D20373 for ; Wed, 8 Apr 2015 10:51:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A1E702034F for ; Wed, 8 Apr 2015 10:51:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EDD06E24B; Wed, 8 Apr 2015 03:51:03 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id BA97F6E24B for ; Wed, 8 Apr 2015 03:51:01 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 08 Apr 2015 03:51:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,544,1422950400"; d="scan'208";a="676980659" Received: from jlahtine-mobl1.ger.corp.intel.com (HELO [10.252.20.219]) ([10.252.20.219]) by orsmga001.jf.intel.com with ESMTP; 08 Apr 2015 03:50:59 -0700 Message-ID: <1428490258.7407.9.camel@jlahtine-mobl1> From: Joonas Lahtinen To: intel-gfx@lists.freedesktop.org Date: Wed, 08 Apr 2015 13:50:58 +0300 In-Reply-To: <20150407140810.GF12214@nuc-i3427.alporthouse.com> References: <20150407140810.GF12214@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 v2 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. Signed-off-by: Joonas Lahtinen --- tests/gem_mmap_gtt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c index 55c66a2..d2803d7 100644 --- a/tests/gem_mmap_gtt.c +++ b/tests/gem_mmap_gtt.c @@ -43,11 +43,16 @@ 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 +250,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);