dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: emil.l.velikov@gmail.com
Subject: [PATCH libdrm 2/4] kms: remove commented out libudev code
Date: Wed, 30 Nov 2016 20:37:05 +0000	[thread overview]
Message-ID: <20161130203707.19058-2-emil.l.velikov@gmail.com> (raw)
In-Reply-To: <20161130203707.19058-1-emil.l.velikov@gmail.com>

Cc: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
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 <libudev.h>
-
-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);
 }
-- 
2.10.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-11-30 20:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 20:37 [PATCH libdrm 1/4] tests: remove useless legacy tests Emil Velikov
2016-11-30 20:37 ` Emil Velikov [this message]
2016-11-30 20:37 ` [PATCH libdrm 3/4] configure: remove libudev checks Emil Velikov
2016-11-30 20:37 ` [PATCH libdrm 4/4] tests: automake: reorder makefile contents Emil Velikov
2016-12-01  7:00 ` [PATCH libdrm 1/4] tests: remove useless legacy tests Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161130203707.19058-2-emil.l.velikov@gmail.com \
    --to=emil.l.velikov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).