From patchwork Wed Nov 30 20:37:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 9454889 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 8D6156074E for ; Wed, 30 Nov 2016 20:37:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 807F327570 for ; Wed, 30 Nov 2016 20:37:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73E92283E8; Wed, 30 Nov 2016 20:37:33 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 ED9AA27570 for ; Wed, 30 Nov 2016 20:37:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E22CA6E3AF; Wed, 30 Nov 2016 20:37:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F6A16E542 for ; Wed, 30 Nov 2016 20:37:30 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id a20so31201752wme.2 for ; Wed, 30 Nov 2016 12:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HZ+yY6JO82qdbzpnr4ekwGN+t472I4BQL4uHD83vUdM=; b=Ir+fi8iFtWOzGrABJqLuvXeli2Nt2WE3uI8pG6rsYOyIDTK2Ghq02SAUoTmLV9KQ1F I1M4128I74iIi0GsOS2dYnhjURO3VcXvlvQQ/i1xWnHf2J9Pzh/eCwIbm5o0RZUy3ZPF KAjJf2+z3yYDP4187DHlmNvKjw1rnAvMiu8b+iJixVD7bmMhMNCih3NOThPXdQkTvVRe IY5DJzA4UsMKjYSdgIx/0Kwvks9AYY5w2E+BjfGuOsYAPPJ803wL72e0qy7OaXG1bll6 tv2UmCD3lOjxCzPgKpEksGuvAgzpJ0d5yef1nqT8QocXxRGFmkWIgJHKtvSrWE9x1htQ smUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HZ+yY6JO82qdbzpnr4ekwGN+t472I4BQL4uHD83vUdM=; b=jObu/okJlLnpknhTmF9a/r75kpia7wmnQ77boX+TWkAVUe67B2PosJqqDDeFOqoMHt 3jlJ+NcbCSuVlP88ZI3JyI9elSi8d23ZqaLXtM1I0oWPTZxQBKhDWB/cXnFd68VUNmHe xFdybkOj0HSCQTH5PSxmYXdODywNydCW7FBv73iAA0HPAXFmjmNITZZUy02YX0iKLy7C h4zTybyWaO7ey4EUwUxZiEJhFYAfUV/0UuS+hm/qCLIsmfgJdnBLbCngHAwaC7iPjQDX o/brL3+0V03qLZQpunrUR0MNiemq3nyC120DZLfZKRk5kKc4gjmRaUOhjO3YTBBQfgzh G6PA== X-Gm-Message-State: AKaTC03TvN88hC8Fub4Mu8IIfgdPJ+3bhWzLKzFsAkp+pqUXBwAkbLKYRRnkj9XPdt0uNg== X-Received: by 10.28.173.131 with SMTP id w125mr29175154wme.0.1480538248771; Wed, 30 Nov 2016 12:37:28 -0800 (PST) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:1098:5:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id e5sm9703979wma.12.2016.11.30.12.37.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 12:37:28 -0800 (PST) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 2/4] kms: remove commented out libudev code Date: Wed, 30 Nov 2016 20:37:05 +0000 Message-Id: <20161130203707.19058-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161130203707.19058-1-emil.l.velikov@gmail.com> References: <20161130203707.19058-1-emil.l.velikov@gmail.com> Cc: emil.l.velikov@gmail.com 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 Cc: Jakob Bornecrantz Signed-off-by: Emil Velikov --- Jakob, seems like libkms did not get the traction one would have expected. With gbm, mini-gbm around and plans brewing for gbm2/liballoc should we keep the library around ? Afaict there hasn't been any distributions building/shipping it in a while. --- libkms/Makefile.am | 4 --- libkms/linux.c | 94 ------------------------------------------------------ 2 files changed, 98 deletions(-) diff --git a/libkms/Makefile.am b/libkms/Makefile.am index 7c1debe..461fc35 100644 --- a/libkms/Makefile.am +++ b/libkms/Makefile.am @@ -10,10 +10,6 @@ libkms_ladir = $(libdir) libkms_la_LDFLAGS = -version-number 1:0:0 -no-undefined libkms_la_LIBADD = ../libdrm.la -#if HAVE_LIBUDEV -#libkms_la_LIBADD += $(LIBUDEV_LIBS) -#endif - libkms_la_SOURCES = $(LIBKMS_FILES) if HAVE_VMWGFX diff --git a/libkms/linux.c b/libkms/linux.c index 69eb1aa..0b50777 100644 --- a/libkms/linux.c +++ b/libkms/linux.c @@ -141,105 +141,11 @@ linux_from_sysfs(int fd, struct kms_driver **out) return ret; } -#if 0 -#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE -#include - -struct create_record -{ - unsigned vendor; - unsigned chip; - int (*func)(int fd, struct kms_driver **out); -}; - -static const struct create_record table[] = { - { 0x8086, 0x2a42, intel_create }, /* i965 */ -#ifdef HAVE_VMWGFX - { 0x15ad, 0x0405, vmwgfx_create }, /* VMware vGPU */ -#endif - { 0, 0, NULL }, -}; - -static int -linux_get_pciid_from_fd(int fd, unsigned *vendor_id, unsigned *chip_id) -{ - struct udev *udev; - struct udev_device *device; - struct udev_device *parent; - const char *pci_id; - struct stat buffer; - int ret; - - ret = fstat(fd, &buffer); - if (ret) - return -EINVAL; - - if (!S_ISCHR(buffer.st_mode)) - return -EINVAL; - - udev = udev_new(); - if (!udev) - return -ENOMEM; - - device = udev_device_new_from_devnum(udev, 'c', buffer.st_rdev); - if (!device) - goto err_free_udev; - - parent = udev_device_get_parent(device); - if (!parent) - goto err_free_device; - - pci_id = udev_device_get_property_value(parent, "PCI_ID"); - if (!pci_id) - goto err_free_device; - - if (sscanf(pci_id, "%x:%x", vendor_id, chip_id) != 2) - goto err_free_device; - - udev_device_unref(device); - udev_unref(udev); - - return 0; - -err_free_device: - udev_device_unref(device); -err_free_udev: - udev_unref(udev); - return -EINVAL; -} - -static int -linux_from_udev(int fd, struct kms_driver **out) -{ - unsigned vendor_id, chip_id; - int ret, i; - - ret = linux_get_pciid_from_fd(fd, &vendor_id, &chip_id); - if (ret) - return ret; - - for (i = 0; table[i].func; i++) - if (table[i].vendor == vendor_id && table[i].chip == chip_id) - return table[i].func(fd, out); - - return -ENOSYS; -} -#else -static int -linux_from_udev(int fd, struct kms_driver **out) -{ - return -ENOSYS; -} -#endif - drm_private int linux_create(int fd, struct kms_driver **out) { if (!dumb_create(fd, out)) return 0; - if (!linux_from_udev(fd, out)) - return 0; - return linux_from_sysfs(fd, out); }