From patchwork Tue Dec 10 09:36:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oscar.mateo@intel.com X-Patchwork-Id: 3316911 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 04096C0D4A for ; Tue, 10 Dec 2013 09:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCA2A2021C for ; Tue, 10 Dec 2013 09:42:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B74D120173 for ; Tue, 10 Dec 2013 09:42:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CB94FB1C1; Tue, 10 Dec 2013 01:42:14 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FFCBFB1C1 for ; Tue, 10 Dec 2013 01:42:12 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 Dec 2013 01:42:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,864,1378882800"; d="scan'208";a="447553299" Received: from omateolo-haswell.isw.intel.com ([10.102.226.173]) by fmsmga002.fm.intel.com with ESMTP; 10 Dec 2013 01:42:10 -0800 From: oscar.mateo@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Dec 2013 09:36:21 +0000 Message-Id: <1386668183-19514-1-git-send-email-oscar.mateo@intel.com> X-Mailer: git-send-email 1.7.9.5 Cc: benjamin.widawsky@intel.com Subject: [Intel-gfx] [PATCH 1/3] lib/drmtest: Add a new test helper to check for Full PPGTT usage X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.4 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 From: Oscar Mateo Signed-off-by: Oscar Mateo --- lib/drmtest.c | 14 ++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 15 insertions(+) diff --git a/lib/drmtest.c b/lib/drmtest.c index f2624a1..c2483ee 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -87,6 +87,20 @@ is_intel(int fd) return IS_INTEL(devid); } +bool gem_uses_full_ppgtt(int fd) +{ + struct drm_i915_getparam gp; + int val; + + gp.param = 28; /* HAS_FULL_PPGTT */ + gp.value = &val; + + if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp))) + return 0; + + return val; +} + bool gem_uses_aliasing_ppgtt(int fd) { struct drm_i915_getparam gp; diff --git a/lib/drmtest.h b/lib/drmtest.h index 20e2620..61769e2 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -91,6 +91,7 @@ void gem_sw_finish(int fd, uint32_t handle); bool gem_bo_busy(int fd, uint32_t handle); /* feature test helpers */ +bool gem_uses_full_ppgtt(int fd); bool gem_uses_aliasing_ppgtt(int fd); int gem_available_fences(int fd);