From: Jonathan Gray Subject: [PATCH] radeon: correct RADEON_GEM_WAIT_IDLE use Date: Wed, 5 Jun 2013 14:55:42 +1000 Message-ID: <20130605045542.GA27999@mail.netspace.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from lechuck.jsg.id.au (jsg.id.au [210.15.216.215]) by gabe.freedesktop.org (Postfix) with ESMTP id 999B3E5C8E for ; Tue, 4 Jun 2013 22:17:55 -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 r554th3Y017915 for ; Wed, 5 Jun 2013 14:55:43 +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 r554th3c022147 for ; Wed, 5 Jun 2013 14:55:43 +1000 (EST) Received: (from jsg@localhost) by carla.jsg.id.au (8.14.6/8.14.3/Submit) id r554tgc0016256 for dri-devel@lists.freedesktop.org; Wed, 5 Jun 2013 14:55:42 +1000 (EST) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org RADEON_GEM_WAIT_IDLE is declared DRM_IOW but libdrm uses it with drmCommandWriteRead instead of drmCommandWrite which leads to the ioctl being unmatched and returning an error on at least OpenBSD. Problem noticed by and patch from Mark Kettenis. Signed-off-by: Jonathan Gray --- radeon/radeon_bo_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git radeon/radeon_bo_gem.c radeon/radeon_bo_gem.c index fca0aaf..4ea405f 100644 --- radeon/radeon_bo_gem.c +++ radeon/radeon_bo_gem.c @@ -211,8 +211,8 @@ static int bo_wait(struct radeon_bo_int *boi) memset(&args, 0, sizeof(args)); args.handle = boi->handle; do { - ret = drmCommandWriteRead(boi->bom->fd, DRM_RADEON_GEM_WAIT_IDLE, - &args, sizeof(args)); + ret = drmCommandWrite(boi->bom->fd, DRM_RADEON_GEM_WAIT_IDLE, + &args, sizeof(args)); } while (ret == -EBUSY); return ret; } -- 1.8.2.3