From patchwork Fri Sep 6 19:00:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2854941 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B75C99F3DC for ; Fri, 6 Sep 2013 19:11:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60F5520318 for ; Fri, 6 Sep 2013 19:11:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5A18420292 for ; Fri, 6 Sep 2013 19:11:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4882FE7684 for ; Fri, 6 Sep 2013 12:11:01 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id B41A3E736C for ; Fri, 6 Sep 2013 12:00:16 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 06 Sep 2013 12:00:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,856,1371106800"; d="scan'208";a="397820693" Received: from unknown (HELO strange.amr.corp.intel.com) ([10.255.14.105]) by fmsmga002.fm.intel.com with ESMTP; 06 Sep 2013 12:00:12 -0700 From: Damien Lespiau To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 3/3] drm: Introduce a drmSetCap() wrapper Date: Fri, 6 Sep 2013 20:00:05 +0100 Message-Id: <1378494005-1024-4-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378494005-1024-1-git-send-email-damien.lespiau@intel.com> References: <1378494005-1024-1-git-send-email-damien.lespiau@intel.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.6 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 That wraps around the new DRM_SET_CAP ioctl. Signed-off-by: Damien Lespiau --- xf86drm.c | 7 +++++++ xf86drm.h | 1 + 2 files changed, 8 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index 4791a05..dac6a52 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -823,6 +823,13 @@ int drmGetCap(int fd, uint64_t capability, uint64_t *value) return 0; } +int drmSetCap(int fd, uint64_t capability, uint64_t value) +{ + struct drm_set_cap cap = { capability, value }; + + return drmIoctl(fd, DRM_IOCTL_SET_CAP, &cap); +} + /** * Free the bus ID information. * diff --git a/xf86drm.h b/xf86drm.h index 5ecb284..053be08 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -609,6 +609,7 @@ extern int drmUpdateDrawableInfo(int fd, drm_drawable_t handle, unsigned int num, void *data); extern int drmCtlInstHandler(int fd, int irq); extern int drmCtlUninstHandler(int fd); +extern int drmSetCap(int fd, uint64_t capability, uint64_t value); /* General user-level programmer's API: authenticated client and/or X */ extern int drmMap(int fd,