From patchwork Sat Dec 16 23:27:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bas Nieuwenhuizen X-Patchwork-Id: 10117575 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 3D84B6019C for ; Sat, 16 Dec 2017 23:27:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26211292D2 for ; Sat, 16 Dec 2017 23:27:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19F1B292D5; Sat, 16 Dec 2017 23:27:58 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 08C55292D2 for ; Sat, 16 Dec 2017 23:27:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A804089F0A; Sat, 16 Dec 2017 23:27:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by gabe.freedesktop.org (Postfix) with ESMTPS id 347D989E65 for ; Sat, 16 Dec 2017 23:27:53 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5756F20A8C; Sat, 16 Dec 2017 18:27:52 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Sat, 16 Dec 2017 18:27:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= basnieuwenhuizen.nl; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=IDn4iLCIHkPNPeqNf DOJyxfCh/q2njdXx+WIRZZopkM=; b=FcGb4762q790XCs23ABL07OL1agyQu60b TCo/e6539eKYoCcA1t1MMkI5UA89qs6OAnpBmcjk+6fdJMU7QmEQjxFF9nWrs16r /gZKfw8aouupcNehY7ZqkiP2y8uOwBV348LNecdQTE0Fia/WL+TjmGTmCvU6Yu2x BCeRsKYPiqrEG+qwHv8He9kTGuIAXqMFF01+KdWa7rgdaKWgWX++ICI0f8TXdY3p gpF8+c2NmnafJn/GuZO13SEVKCWy1/t2OsVn9KtrkRQjecmSdBdD5EGQBdXbYsmb btmKVDzzQKQSRC+0pCrVKpEf5w7lLAdIvPCsglTpUaJJJNYLQPhTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=IDn4iLCIHkPNPeqNf DOJyxfCh/q2njdXx+WIRZZopkM=; b=ndISp5x6rYKvrXLNPsT7K5N5Y6KPRPheJ 8tSNgx2NuAumJn8aakgO8Bnrm+dk0vQ+PPkLz+IJoQZvDpKivZtskYOycoAfDVnq t7QoQgWmZbZxVDDPfjQB1aQcw3xrmThfMnUWGoFTtjirBnOCf4H7L+YT6+cIF471 una+sTqLZCxfnKMOmlEd98/zsjw2LStMvhe1jXRHRCnJIC9wIWTFykz27vA8X7vv 8Y0nxZyAG0IGkYmCsL08X5KQcSHFjMvaCRDi0ezZ+QrPBgb6p4oaAPYOJzfbv8sc R84aqEl5cKt340AnWdCTjgzCza/GFlz7XoT9WUZVSzQ8iAw7fqKhg== X-ME-Sender: Received: from localhost.localdomain (unknown [31.10.155.124]) by mail.messagingengine.com (Postfix) with ESMTPA id A9A522459A; Sat, 16 Dec 2017 18:27:51 -0500 (EST) From: Bas Nieuwenhuizen To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/2] drm: Add drmSyncobjReset & drmSyncobjSignal wrappers. Date: Sun, 17 Dec 2017 00:27:09 +0100 Message-Id: <20171216232710.16417-1-bas@basnieuwenhuizen.nl> X-Mailer: git-send-email 2.15.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP anv already uses the ioctls but does not use libdrm, so these were not wrapped yet. --- xf86drm.c | 26 ++++++++++++++++++++++++++ xf86drm.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index c44621c1..deb76e4b 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -4247,3 +4247,29 @@ int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles, *first_signaled = args.first_signaled; return ret; } + +int drmSyncobjReset(int fd, const uint32_t *handles, uint32_t handle_count) +{ + struct drm_syncobj_array args; + int ret; + + memclear(args); + args.handles = (uintptr_t)handles; + args.count_handles = handle_count; + + ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_RESET, &args); + return ret; +} + +int drmSyncobjSignal(int fd, const uint32_t *handles, uint32_t handle_count) +{ + struct drm_syncobj_array args; + int ret; + + memclear(args); + args.handles = (uintptr_t)handles; + args.count_handles = handle_count; + + ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_SIGNAL, &args); + return ret; +} diff --git a/xf86drm.h b/xf86drm.h index ea650eff..0dbf4941 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -863,6 +863,8 @@ extern int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd); extern int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles, int64_t timeout_nsec, unsigned flags, uint32_t *first_signaled); +extern int drmSyncobjReset(int fd, const uint32_t *handles, uint32_t handle_count); +extern int drmSyncobjSignal(int fd, const uint32_t *handles, uint32_t handle_count); #if defined(__cplusplus) }