From patchwork Wed Oct 4 10:22:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 9984145 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 38AED60237 for ; Wed, 4 Oct 2017 10:22:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 295C9287A8 for ; Wed, 4 Oct 2017 10:22:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D87D28AB0; Wed, 4 Oct 2017 10:22:27 +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 8A9BF287A8 for ; Wed, 4 Oct 2017 10:22:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7AD9C89B18; Wed, 4 Oct 2017 10:22:25 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 0222389D73 for ; Wed, 4 Oct 2017 10:22:25 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 4C30F20938; Wed, 4 Oct 2017 12:22:23 +0200 (CEST) Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 215D620920; Wed, 4 Oct 2017 12:22:23 +0200 (CEST) From: Boris Brezillon To: Eric Anholt Date: Wed, 4 Oct 2017 12:22:20 +0200 Message-Id: <20171004102221.23085-3-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171004102221.23085-1-boris.brezillon@free-electrons.com> References: <20171004102221.23085-1-boris.brezillon@free-electrons.com> Cc: Intel GFX discussion Subject: [Intel-gfx] [PATCH i-g-t v2 2/3] igt: Add igt_vc4_get_param() helper 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-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Boris Brezillon --- Changes in v2: - New patch --- lib/igt_vc4.c | 15 +++++++++++++++ lib/igt_vc4.h | 1 + 2 files changed, 16 insertions(+) diff --git a/lib/igt_vc4.c b/lib/igt_vc4.c index b75c063204ec..f98c16754c9c 100644 --- a/lib/igt_vc4.c +++ b/lib/igt_vc4.c @@ -129,6 +129,21 @@ igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot) return ptr; } +int igt_vc4_get_param(int fd, uint32_t param, uint64_t *val) +{ + struct drm_vc4_get_param arg = { + .param = param, + }; + int ret; + + ret = igt_ioctl(fd, DRM_IOCTL_VC4_GET_PARAM, &arg); + if (ret) + return ret; + + *val = arg.value; + return 0; +} + bool igt_vc4_purgeable_bo(int fd, int handle, bool purgeable) { struct drm_vc4_gem_madvise arg = { diff --git a/lib/igt_vc4.h b/lib/igt_vc4.h index 9f0fc59910f6..df65017fe397 100644 --- a/lib/igt_vc4.h +++ b/lib/igt_vc4.h @@ -27,6 +27,7 @@ uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval); int igt_vc4_create_bo(int fd, size_t size); void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot); +int igt_vc4_get_param(int fd, uint32_t param, uint64_t *val); bool igt_vc4_purgeable_bo(int fd, int handle, bool purgeable); #endif /* IGT_VC4_H */