From c91a793f66d5b06292aa431ae3a36c8aca991fa3 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 5 Jul 2011 17:04:11 -0700 Subject: drivers/video/udlfb bind framebuffer to interface. Udlfb has been binding the framebuffer device to its parent, which isn't correct and causes confusion with operations like udev remove. Coming plug and play multiseat support is dependent on this fix. Signed-off-by: Kay Sievers Signed-off-by: Bernie Thompson Signed-off-by: Paul Mundt --- drivers/video/udlfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/udlfb.c') diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 816a4fda04f5..c6584c9f235a 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -1549,7 +1549,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, /* We don't register a new USB class. Our client interface is fbdev */ /* allocates framebuffer driver structure, not framebuffer memory */ - info = framebuffer_alloc(0, &usbdev->dev); + info = framebuffer_alloc(0, &interface->dev); if (!info) { retval = -ENOMEM; pr_err("framebuffer_alloc failed\n"); -- cgit v1.2.3-59-g8ed1b From b63d10130e68aa6480cc1b2483d7c5ce57a05481 Mon Sep 17 00:00:00 2001 From: Bernie Thompson Date: Sun, 10 Jul 2011 00:30:00 -0700 Subject: drivers/video/udlfb match class, subclass, and protocol Match udlfb only against vendor-specific class (e.g. only DisplayLink graphics, not composite standard audio class interfaces). This enables compatibility with composite graphics+audio devices (e.g. HDMI). Match udlfb only against compatible subclass 0 and protocol 0 chips. DisplayLink's USB 3.0 generation chips increment these values to signal that they have a incompatible protocol, preventing udlfb from erroneously matching to hardware it does not support. Tested to confirm proper behavior on both USB 2.0 and USB 3.0 generation devices. Reported-by: Andrew Kephart Signed-off-by: Bernie Thompson Signed-off-by: Paul Mundt --- drivers/video/udlfb.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'drivers/video/udlfb.c') diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index c6584c9f235a..4e133754ba2b 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -49,13 +49,22 @@ static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST | FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR; /* - * There are many DisplayLink-based products, all with unique PIDs. We are able - * to support all volume ones (circa 2009) with a single driver, so we match - * globally on VID. TODO: Probe() needs to detect when we might be running - * "future" chips, and bail on those, so a compatible driver can match. + * There are many DisplayLink-based graphics products, all with unique PIDs. + * So we match on DisplayLink's VID + Vendor-Defined Interface Class (0xff) + * We also require a match on SubClass (0x00) and Protocol (0x00), + * which is compatible with all known USB 2.0 era graphics chips and firmware, + * but allows DisplayLink to increment those for any future incompatible chips */ static struct usb_device_id id_table[] = { - {.idVendor = 0x17e9, .match_flags = USB_DEVICE_ID_MATCH_VENDOR,}, + {.idVendor = 0x17e9, + .bInterfaceClass = 0xff, + .bInterfaceSubClass = 0x00, + .bInterfaceProtocol = 0x00, + .match_flags = USB_DEVICE_ID_MATCH_VENDOR | + USB_DEVICE_ID_MATCH_INT_CLASS | + USB_DEVICE_ID_MATCH_INT_SUBCLASS | + USB_DEVICE_ID_MATCH_INT_PROTOCOL, + }, {}, }; MODULE_DEVICE_TABLE(usb, id_table); -- cgit v1.2.3-59-g8ed1b