From patchwork Tue Nov 20 04:30:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher James Halse Rogers X-Patchwork-Id: 10689851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 742215A4 for ; Tue, 20 Nov 2018 04:30:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AE882A155 for ; Tue, 20 Nov 2018 04:30:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EE822A158; Tue, 20 Nov 2018 04:30:24 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 43C162A155 for ; Tue, 20 Nov 2018 04:30:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 715A96E2EF; Tue, 20 Nov 2018 04:30:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.cooperteam.net (mail.cooperteam.net [45.248.50.188]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41C156E2EF for ; Tue, 20 Nov 2018 04:30:19 +0000 (UTC) Received: from Extravaganza.lan (unknown [192.168.1.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: chris) by mail.cooperteam.net (Postfix) with ESMTPSA id A718C2CCB3; Tue, 20 Nov 2018 15:30:13 +1100 (AEDT) From: Christopher James Halse Rogers To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] xf86drm: Make drmNodeIsDRM() public. Date: Tue, 20 Nov 2018 15:30:08 +1100 Message-Id: <20181120043008.3576-1-christopher.halse.rogers@canonical.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christopher James Halse Rogers Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP I have wanted this code in Mir, so it's plausibly useful elsewhere, particularly if the DRM device major number is going to become dynamic. Signed-off-by: Christopher James Halse Rogers --- xf86drm.c | 2 +- xf86drm.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 10df682b..f32cb1bb 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2767,7 +2767,7 @@ drm_public char *drmGetDeviceNameFromFd(int fd) return strdup(name); } -static bool drmNodeIsDRM(int maj, int min) +drm_public bool drmNodeIsDRM(int maj, int min) { #ifdef __linux__ char path[64]; diff --git a/xf86drm.h b/xf86drm.h index 7773d71a..6dc92180 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #if defined(__cplusplus) @@ -783,6 +784,8 @@ extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); extern char *drmGetPrimaryDeviceNameFromFd(int fd); extern char *drmGetRenderDeviceNameFromFd(int fd); +extern bool drmNodeIsDRM(int major, int minor); + #define DRM_BUS_PCI 0 #define DRM_BUS_USB 1 #define DRM_BUS_PLATFORM 2