aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz2010-01-12 11:53:49 -0600
committerJakob Bornecrantz2010-01-12 15:10:12 -0600
commitd920fa9d0b54873d53f03a006d0fe3df11136b74 (patch)
tree43178c3fb49a55920ebbfb66ae111d5e1b735491 /libkms/api.c
parentd207a38701d664ac818829249d4d2566349bb359 (diff)
downloadexternal-libdrm-d920fa9d0b54873d53f03a006d0fe3df11136b74.tar.gz
external-libdrm-d920fa9d0b54873d53f03a006d0fe3df11136b74.tar.xz
external-libdrm-d920fa9d0b54873d53f03a006d0fe3df11136b74.zip
libkms: Use sysfs instead of udev to find driver
Udev code is still there just commented out.
Diffstat (limited to 'libkms/api.c')
-rw-r--r--libkms/api.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/libkms/api.c b/libkms/api.c
index 12dcd9a1..7696918a 100644
--- a/libkms/api.c
+++ b/libkms/api.c
@@ -32,35 +32,9 @@
32#include <string.h> 32#include <string.h>
33#include "internal.h" 33#include "internal.h"
34 34
35struct create_record
36{
37 unsigned vendor;
38 unsigned chip;
39 int (*func)(int fd, struct kms_driver **out);
40};
41
42static struct create_record table[] = {
43 { 0x8086, 0x2a42, intel_create }, /* i965 */
44#ifdef HAVE_VMWGFX
45 { 0x15ad, 0x0405, vmwgfx_create }, /* VMware vGPU */
46#endif
47 { 0, 0, NULL },
48};
49
50int kms_create(int fd, struct kms_driver **out) 35int kms_create(int fd, struct kms_driver **out)
51{ 36{
52 unsigned vendor_id, chip_id; 37 return linux_create(fd, out);
53 int ret, i;
54
55 ret = linux_get_pciid_from_fd(fd, &vendor_id, &chip_id);
56 if (ret)
57 return ret;
58
59 for (i = 0; table[i].func; i++)
60 if (table[i].vendor == vendor_id && table[i].chip == chip_id)
61 return table[i].func(fd, out);
62
63 return -ENOSYS;
64} 38}
65 39
66int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out) 40int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)