From patchwork Sun Jun 30 09:37:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Gray X-Patchwork-Id: 2804341 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 A2B87BF4A1 for ; Sun, 30 Jun 2013 09:38:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C710020107 for ; Sun, 30 Jun 2013 09:37:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DE47E200E9 for ; Sun, 30 Jun 2013 09:37:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB373E5CD6 for ; Sun, 30 Jun 2013 02:37:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from lechuck.jsg.id.au (jsg.id.au [210.15.216.215]) by gabe.freedesktop.org (Postfix) with ESMTP id 21978E5BF7 for ; Sun, 30 Jun 2013 02:37:47 -0700 (PDT) Received: from carla.jsg.id.au (root@carla.jsg.id.au [192.168.1.42]) by lechuck.jsg.id.au (8.14.6/8.14.6) with ESMTP id r5U9bjrl011520 for ; Sun, 30 Jun 2013 19:37:45 +1000 (EST) Received: from carla.jsg.id.au (jsg@localhost.jsg.id.au [127.0.0.1]) by carla.jsg.id.au (8.14.6/8.14.3) with ESMTP id r5U9bjBh009590 for ; Sun, 30 Jun 2013 19:37:45 +1000 (EST) Received: (from jsg@localhost) by carla.jsg.id.au (8.14.6/8.14.3/Submit) id r5U9bjn3020272 for intel-gfx@lists.freedesktop.org; Sun, 30 Jun 2013 19:37:45 +1000 (EST) Date: Sun, 30 Jun 2013 19:37:45 +1000 From: Jonathan Gray To: intel-gfx@lists.freedesktop.org Message-ID: <20130630093745.GA10668@mail.netspace.net.au> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [Intel-gfx] [PATCH xf86-video-intel] intel: replace direct ioctl use with drm{Set, Drop}Master 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: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.2 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 Use drmSetMaster/drmDropMaster instead of calling the ioctls directly. Fixes compilation on OpenBSD where these ioctls aren't defined. Signed-off-by: Jonathan Gray --- src/intel_device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git src/intel_device.c src/intel_device.c index 5c49db0..1b2f33c 100644 --- src/intel_device.c +++ src/intel_device.c @@ -202,7 +202,7 @@ int intel_get_master(ScrnInfoPtr scrn) int retry = 2000; do { - ret = ioctl(dev->fd, DRM_IOCTL_SET_MASTER); + ret = drmSetMaster(dev->fd); if (ret == 0) break; usleep(1000); @@ -222,8 +222,8 @@ int intel_put_master(ScrnInfoPtr scrn) ret = 0; assert(dev->master_count); if (--dev->master_count == 0) { - assert(ioctl(dev->fd, DRM_IOCTL_SET_MASTER) == 0); - ret = ioctl(dev->fd, DRM_IOCTL_DROP_MASTER); + assert(drmSetMaster(dev->fd) == 0); + ret = drmDropMaster(dev->fd); } return ret;