From patchwork Tue Dec 11 22:04:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Tigeot?= X-Patchwork-Id: 10724927 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 6EEDC1869 for ; Tue, 11 Dec 2018 22:15:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C8D02B7AB for ; Tue, 11 Dec 2018 22:15:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 511A42B7AE; Tue, 11 Dec 2018 22:15:16 +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 B23C92B7AB for ; Tue, 11 Dec 2018 22:15:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8565C6E49B; Tue, 11 Dec 2018 22:15:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 629 seconds by postgrey-1.36 at gabe; Tue, 11 Dec 2018 22:15:13 UTC Received: from ivry12.wolfpond.org (ivry12.zefyris.com [IPv6:2a02:ec0:211::12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4FAD36E49B for ; Tue, 11 Dec 2018 22:15:13 +0000 (UTC) Received: from cube.wolfpond.org (localhost [127.0.0.1]) by ivry12.wolfpond.org (8.15.2/8.15.2) with ESMTP id wBBM4fGm913608; Tue, 11 Dec 2018 23:04:41 +0100 (CET) (envelope-from ftigeot@wolfpond.org) X-Authentication-Warning: ivry12.wolfpond.org: Host localhost [127.0.0.1] claimed to be cube.wolfpond.org From: =?utf-8?q?Fran=C3=A7ois_Tigeot?= To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] libdrm: Fix drmNodeIsDRM() on DragonFly Date: Tue, 11 Dec 2018 23:04:01 +0100 Message-Id: <20181211220401.58775-1-ftigeot@wolfpond.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.2 (ivry12.wolfpond.org [127.0.0.1]); Tue, 11 Dec 2018 23:04:41 +0100 (CET) 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: =?utf-8?q?Fran=C3=A7ois_Tigeot?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP * There is no way to check if a device name is really a drm device by looking it up in a virtual filesystem like on Linux * The major device number is also dynamically allocated from a pool, comparing it to a constant makes no sense * In the absence of better ideas, just assume the device name really points to a drm device and always return true Signed-off-by: François Tigeot Acked-by: Eric Engestrom --- xf86drm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index 71ad54ba..0085bf17 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2778,6 +2778,8 @@ static bool drmNodeIsDRM(int maj, int min) snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/drm", maj, min); return stat(path, &sbuf) == 0; +#elif __DragonFly__ + return true; /* DragonFly BSD has no fixed major device numbers */ #else return maj == DRM_MAJOR; #endif