2 * udlfb.c -- Framebuffer driver for DisplayLink USB controller
4 * Copyright (C) 2009 Roberto De Ioris <roberto@unbit.it>
5 * Copyright (C) 2009 Jaya Kumar <jayakumar.lkml@gmail.com>
6 * Copyright (C) 2009 Bernie Thompson <bernie@plugable.com>
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License v2. See the file COPYING in the main directory of this archive for
12 * Layout is based on skeletonfb by James Simmons and Geert Uytterhoeven,
13 * usb-skeleton by GregKH.
15 * Device-specific portions based on information from Displaylink, with work
16 * from Florian Echtler, Henrik Bjerregaard Pedersen, and others.
19 #include <linux/module.h>
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/usb.h>
23 #include <linux/uaccess.h>
26 #include <linux/vmalloc.h>
30 static struct fb_fix_screeninfo dlfb_fix = {
32 .type = FB_TYPE_PACKED_PIXELS,
33 .visual = FB_VISUAL_TRUECOLOR,
37 .accel = FB_ACCEL_NONE,
40 static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST |
44 FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT |
45 FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR;
48 * There are many DisplayLink-based products, all with unique PIDs. We are able
49 * to support all volume ones (circa 2009) with a single driver, so we match
50 * globally on VID. TODO: Probe() needs to detect when we might be running
51 * "future" chips, and bail on those, so a compatible driver can match.
53 static struct usb_device_id id_table[] = {
54 {.idVendor = 0x17e9, .match_flags = USB_DEVICE_ID_MATCH_VENDOR,},
57 MODULE_DEVICE_TABLE(usb, id_table);
59 #ifndef CONFIG_FB_DEFERRED_IO
60 #warning message "kernel FB_DEFFERRED_IO option to support generic fbdev apps"
63 #ifndef CONFIG_FB_SYS_IMAGEBLIT
64 #ifndef CONFIG_FB_SYS_IMAGEBLIT_MODULE
65 #warning message "FB_SYS_* in kernel or module option to support fb console"
69 #ifndef CONFIG_FB_MODE_HELPERS
70 #warning message "kernel FB_MODE_HELPERS required. Expect build break"
73 /* dlfb keeps a list of urbs for efficient bulk transfers */
74 static void dlfb_urb_completion(struct urb *urb);
75 static struct urb *dlfb_get_urb(struct dlfb_data *dev);
76 static int dlfb_submit_urb(struct dlfb_data *dev, struct urb * urb, size_t len);
77 static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size);
78 static void dlfb_free_urb_list(struct dlfb_data *dev);
80 /* other symbols with dependents */
81 #ifdef CONFIG_FB_DEFERRED_IO
82 static struct fb_deferred_io dlfb_defio;
86 * All DisplayLink bulk operations start with 0xAF, followed by specific code
87 * All operations are written to buffers which then later get sent to device
89 static char *dlfb_set_register(char *buf, u8 reg, u8 val)
98 static char *dlfb_vidreg_lock(char *buf)
100 return dlfb_set_register(buf, 0xFF, 0x00);
103 static char *dlfb_vidreg_unlock(char *buf)
105 return dlfb_set_register(buf, 0xFF, 0xFF);
109 * On/Off for driving the DisplayLink framebuffer to the display
111 static char *dlfb_enable_hvsync(char *buf, bool enable)
114 return dlfb_set_register(buf, 0x1F, 0x00);
116 return dlfb_set_register(buf, 0x1F, 0x01);
119 static char *dlfb_set_color_depth(char *buf, u8 selection)
121 return dlfb_set_register(buf, 0x00, selection);
124 static char *dlfb_set_base16bpp(char *wrptr, u32 base)
126 /* the base pointer is 16 bits wide, 0x20 is hi byte. */
127 wrptr = dlfb_set_register(wrptr, 0x20, base >> 16);
128 wrptr = dlfb_set_register(wrptr, 0x21, base >> 8);
129 return dlfb_set_register(wrptr, 0x22, base);
133 * DisplayLink HW has separate 16bpp and 8bpp framebuffers.
134 * In 24bpp modes, the low 323 RGB bits go in the 8bpp framebuffer
136 static char *dlfb_set_base8bpp(char *wrptr, u32 base)
138 wrptr = dlfb_set_register(wrptr, 0x26, base >> 16);
139 wrptr = dlfb_set_register(wrptr, 0x27, base >> 8);
140 return dlfb_set_register(wrptr, 0x28, base);
143 static char *dlfb_set_register_16(char *wrptr, u8 reg, u16 value)
145 wrptr = dlfb_set_register(wrptr, reg, value >> 8);
146 return dlfb_set_register(wrptr, reg+1, value);
150 * This is kind of weird because the controller takes some
151 * register values in a different byte order than other registers.
153 static char *dlfb_set_register_16be(char *wrptr, u8 reg, u16 value)
155 wrptr = dlfb_set_register(wrptr, reg, value);
156 return dlfb_set_register(wrptr, reg+1, value >> 8);
160 * LFSR is linear feedback shift register. The reason we have this is
161 * because the display controller needs to minimize the clock depth of
162 * various counters used in the display path. So this code reverses the
163 * provided value into the lfsr16 value by counting backwards to get
164 * the value that needs to be set in the hardware comparator to get the
165 * same actual count. This makes sense once you read above a couple of
166 * times and think about it from a hardware perspective.
168 static u16 dlfb_lfsr16(u16 actual_count)
170 u32 lv = 0xFFFF; /* This is the lfsr value that the hw starts with */
172 while (actual_count--) {
174 (((lv >> 15) ^ (lv >> 4) ^ (lv >> 2) ^ (lv >> 1)) & 1))
182 * This does LFSR conversion on the value that is to be written.
183 * See LFSR explanation above for more detail.
185 static char *dlfb_set_register_lfsr16(char *wrptr, u8 reg, u16 value)
187 return dlfb_set_register_16(wrptr, reg, dlfb_lfsr16(value));
191 * This takes a standard fbdev screeninfo struct and all of its monitor mode
192 * details and converts them into the DisplayLink equivalent register commands.
194 static char *dlfb_set_vid_cmds(char *wrptr, struct fb_var_screeninfo *var)
200 /* x display start */
201 xds = var->left_margin + var->hsync_len;
202 wrptr = dlfb_set_register_lfsr16(wrptr, 0x01, xds);
204 xde = xds + var->xres;
205 wrptr = dlfb_set_register_lfsr16(wrptr, 0x03, xde);
207 /* y display start */
208 yds = var->upper_margin + var->vsync_len;
209 wrptr = dlfb_set_register_lfsr16(wrptr, 0x05, yds);
211 yde = yds + var->yres;
212 wrptr = dlfb_set_register_lfsr16(wrptr, 0x07, yde);
214 /* x end count is active + blanking - 1 */
215 wrptr = dlfb_set_register_lfsr16(wrptr, 0x09,
216 xde + var->right_margin - 1);
218 /* libdlo hardcodes hsync start to 1 */
219 wrptr = dlfb_set_register_lfsr16(wrptr, 0x0B, 1);
221 /* hsync end is width of sync pulse + 1 */
222 wrptr = dlfb_set_register_lfsr16(wrptr, 0x0D, var->hsync_len + 1);
224 /* hpixels is active pixels */
225 wrptr = dlfb_set_register_16(wrptr, 0x0F, var->xres);
227 /* yendcount is vertical active + vertical blanking */
228 yec = var->yres + var->upper_margin + var->lower_margin +
230 wrptr = dlfb_set_register_lfsr16(wrptr, 0x11, yec);
232 /* libdlo hardcodes vsync start to 0 */
233 wrptr = dlfb_set_register_lfsr16(wrptr, 0x13, 0);
235 /* vsync end is width of vsync pulse */
236 wrptr = dlfb_set_register_lfsr16(wrptr, 0x15, var->vsync_len);
238 /* vpixels is active pixels */
239 wrptr = dlfb_set_register_16(wrptr, 0x17, var->yres);
241 /* convert picoseconds to 5kHz multiple for pclk5k = x * 1E12/5k */
242 wrptr = dlfb_set_register_16be(wrptr, 0x1B,
243 200*1000*1000/var->pixclock);
249 * This takes a standard fbdev screeninfo struct that was fetched or prepared
250 * and then generates the appropriate command sequence that then drives the
251 * display controller.
253 static int dlfb_set_video_mode(struct dlfb_data *dev,
254 struct fb_var_screeninfo *var)
262 if (!atomic_read(&dev->usb_active))
265 urb = dlfb_get_urb(dev);
268 buf = (char *) urb->transfer_buffer;
271 * This first section has to do with setting the base address on the
272 * controller * associated with the display. There are 2 base
273 * pointers, currently, we only * use the 16 bpp segment.
275 wrptr = dlfb_vidreg_lock(buf);
276 wrptr = dlfb_set_color_depth(wrptr, 0x00);
277 /* set base for 16bpp segment to 0 */
278 wrptr = dlfb_set_base16bpp(wrptr, 0);
279 /* set base for 8bpp segment to end of fb */
280 wrptr = dlfb_set_base8bpp(wrptr, dev->info->fix.smem_len);
282 wrptr = dlfb_set_vid_cmds(wrptr, var);
283 wrptr = dlfb_enable_hvsync(wrptr, true);
284 wrptr = dlfb_vidreg_unlock(wrptr);
286 writesize = wrptr - buf;
288 retval = dlfb_submit_urb(dev, urb, writesize);
293 static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
295 unsigned long start = vma->vm_start;
296 unsigned long size = vma->vm_end - vma->vm_start;
297 unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
298 unsigned long page, pos;
299 struct dlfb_data *dev = info->par;
301 dl_notice("MMAP: %lu %u\n", offset + size, info->fix.smem_len);
303 if (offset + size > info->fix.smem_len)
306 pos = (unsigned long)info->fix.smem_start + offset;
309 page = vmalloc_to_pfn((void *)pos);
310 if (remap_pfn_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
315 if (size > PAGE_SIZE)
321 vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */
327 * Trims identical data from front and back of line
328 * Sets new front buffer address and width
329 * And returns byte count of identical pixels
330 * Assumes CPU natural alignment (unsigned long)
331 * for back and front buffer ptrs and width
333 static int dlfb_trim_hline(const u8 *bback, const u8 **bfront, int *width_bytes)
336 const unsigned long *back = (const unsigned long *) bback;
337 const unsigned long *front = (const unsigned long *) *bfront;
338 const int width = *width_bytes / sizeof(unsigned long);
339 int identical = width;
343 prefetch((void *) front);
344 prefetch((void *) back);
346 for (j = 0; j < width; j++) {
347 if (back[j] != front[j]) {
353 for (k = width - 1; k > j; k--) {
354 if (back[k] != front[k]) {
360 identical = start + (width - end);
361 *bfront = (u8 *) &front[start];
362 *width_bytes = (end - start) * sizeof(unsigned long);
364 return identical * sizeof(unsigned long);
368 Render a command stream for an encoded horizontal line segment of pixels.
370 A command buffer holds several commands.
371 It always begins with a fresh command header
372 (the protocol doesn't require this, but we enforce it to allow
373 multiple buffers to be potentially encoded and sent in parallel).
374 A single command encodes one contiguous horizontal line of pixels
376 The function relies on the client to do all allocation, so that
377 rendering can be done directly to output buffers (e.g. USB URBs).
378 The function fills the supplied command buffer, providing information
379 on where it left off, so the client may call in again with additional
380 buffers if the line will take several buffers to complete.
382 A single command can transmit a maximum of 256 pixels,
383 regardless of the compression ratio (protocol design limit).
384 To the hardware, 0 for a size byte means 256
386 Rather than 256 pixel commands which are either rl or raw encoded,
387 the rlx command simply assumes alternating raw and rl spans within one cmd.
388 This has a slightly larger header overhead, but produces more even results.
389 It also processes all data (read and write) in a single pass.
390 Performance benchmarks of common cases show it having just slightly better
391 compression than 256 pixel raw -or- rle commands, with similar CPU consumpion.
392 But for very rl friendly data, will compress not quite as well.
394 static void dlfb_compress_hline(
395 const uint16_t **pixel_start_ptr,
396 const uint16_t *const pixel_end,
397 uint32_t *device_address_ptr,
398 uint8_t **command_buffer_ptr,
399 const uint8_t *const cmd_buffer_end)
401 const uint16_t *pixel = *pixel_start_ptr;
402 uint32_t dev_addr = *device_address_ptr;
403 uint8_t *cmd = *command_buffer_ptr;
406 while ((pixel_end > pixel) &&
407 (cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) {
408 uint8_t *raw_pixels_count_byte = 0;
409 uint8_t *cmd_pixels_count_byte = 0;
410 const uint16_t *raw_pixel_start = 0;
411 const uint16_t *cmd_pixel_start, *cmd_pixel_end = 0;
412 const uint32_t be_dev_addr = cpu_to_be32(dev_addr);
414 prefetchw((void *) cmd); /* pull in one cache line at least */
418 *cmd++ = (uint8_t) ((be_dev_addr >> 8) & 0xFF);
419 *cmd++ = (uint8_t) ((be_dev_addr >> 16) & 0xFF);
420 *cmd++ = (uint8_t) ((be_dev_addr >> 24) & 0xFF);
422 cmd_pixels_count_byte = cmd++; /* we'll know this later */
423 cmd_pixel_start = pixel;
425 raw_pixels_count_byte = cmd++; /* we'll know this later */
426 raw_pixel_start = pixel;
428 cmd_pixel_end = pixel + min(MAX_CMD_PIXELS + 1,
429 min((int)(pixel_end - pixel),
430 (int)(cmd_buffer_end - cmd) / bpp));
432 prefetch_range((void *) pixel, (cmd_pixel_end - pixel) * bpp);
434 while (pixel < cmd_pixel_end) {
435 const uint16_t * const repeating_pixel = pixel;
437 *(uint16_t *)cmd = cpu_to_be16p(pixel);
441 if (unlikely((pixel < cmd_pixel_end) &&
442 (*pixel == *repeating_pixel))) {
443 /* go back and fill in raw pixel count */
444 *raw_pixels_count_byte = ((repeating_pixel -
445 raw_pixel_start) + 1) & 0xFF;
447 while ((pixel < cmd_pixel_end)
448 && (*pixel == *repeating_pixel)) {
452 /* immediately after raw data is repeat byte */
453 *cmd++ = ((pixel - repeating_pixel) - 1) & 0xFF;
455 /* Then start another raw pixel span */
456 raw_pixel_start = pixel;
457 raw_pixels_count_byte = cmd++;
461 if (pixel > raw_pixel_start) {
462 /* finalize last RAW span */
463 *raw_pixels_count_byte = (pixel-raw_pixel_start) & 0xFF;
466 *cmd_pixels_count_byte = (pixel - cmd_pixel_start) & 0xFF;
467 dev_addr += (pixel - cmd_pixel_start) * bpp;
470 if (cmd_buffer_end <= MIN_RLX_CMD_BYTES + cmd) {
471 /* Fill leftover bytes with no-ops */
472 if (cmd_buffer_end > cmd)
473 memset(cmd, 0xAF, cmd_buffer_end - cmd);
474 cmd = (uint8_t *) cmd_buffer_end;
477 *command_buffer_ptr = cmd;
478 *pixel_start_ptr = pixel;
479 *device_address_ptr = dev_addr;
485 * There are 3 copies of every pixel: The front buffer that the fbdev
486 * client renders to, the actual framebuffer across the USB bus in hardware
487 * (that we can only write to, slowly, and can never read), and (optionally)
488 * our shadow copy that tracks what's been sent to that hardware buffer.
490 static void dlfb_render_hline(struct dlfb_data *dev, struct urb **urb_ptr,
491 const char *front, char **urb_buf_ptr,
492 u32 byte_offset, u32 byte_width,
493 int *ident_ptr, int *sent_ptr)
495 const u8 *line_start, *line_end, *next_pixel;
496 u32 dev_addr = dev->base16 + byte_offset;
497 struct urb *urb = *urb_ptr;
498 u8 *cmd = *urb_buf_ptr;
499 u8 *cmd_end = (u8 *) urb->transfer_buffer + urb->transfer_buffer_length;
501 line_start = (u8 *) (front + byte_offset);
502 next_pixel = line_start;
503 line_end = next_pixel + byte_width;
505 if (dev->backing_buffer) {
507 const u8 *back_start = (u8 *) (dev->backing_buffer
510 *ident_ptr += dlfb_trim_hline(back_start, &next_pixel,
513 offset = next_pixel - line_start;
514 line_end = next_pixel + byte_width;
516 back_start += offset;
517 line_start += offset;
519 memcpy((char *)back_start, (char *) line_start,
523 while (next_pixel < line_end) {
525 dlfb_compress_hline((const uint16_t **) &next_pixel,
526 (const uint16_t *) line_end, &dev_addr,
527 (u8 **) &cmd, (u8 *) cmd_end);
529 if (cmd >= cmd_end) {
530 int len = cmd - (u8 *) urb->transfer_buffer;
531 if (dlfb_submit_urb(dev, urb, len))
532 return; /* lost pixels is set */
534 urb = dlfb_get_urb(dev);
536 return; /* lost_pixels is set */
538 cmd = urb->transfer_buffer;
539 cmd_end = &cmd[urb->transfer_buffer_length];
546 int dlfb_handle_damage(struct dlfb_data *dev, int x, int y,
547 int width, int height, char *data)
551 cycles_t start_cycles, end_cycles;
553 int bytes_identical = 0;
557 start_cycles = get_cycles();
559 aligned_x = DL_ALIGN_DOWN(x, sizeof(unsigned long));
560 width = DL_ALIGN_UP(width + (x-aligned_x), sizeof(unsigned long));
564 (x + width > dev->info->var.xres) ||
565 (y + height > dev->info->var.yres))
568 if (!atomic_read(&dev->usb_active))
571 urb = dlfb_get_urb(dev);
574 cmd = urb->transfer_buffer;
576 for (i = y; i < y + height ; i++) {
577 const int line_offset = dev->info->fix.line_length * i;
578 const int byte_offset = line_offset + (x * BPP);
580 dlfb_render_hline(dev, &urb, (char *) dev->info->fix.smem_start,
581 &cmd, byte_offset, width * BPP,
582 &bytes_identical, &bytes_sent);
585 if (cmd > (char *) urb->transfer_buffer) {
586 /* Send partial buffer remaining before exiting */
587 int len = cmd - (char *) urb->transfer_buffer;
588 ret = dlfb_submit_urb(dev, urb, len);
591 dlfb_urb_completion(urb);
593 atomic_add(bytes_sent, &dev->bytes_sent);
594 atomic_add(bytes_identical, &dev->bytes_identical);
595 atomic_add(width*height*2, &dev->bytes_rendered);
596 end_cycles = get_cycles();
597 atomic_add(((unsigned int) ((end_cycles - start_cycles)
598 >> 10)), /* Kcycles */
599 &dev->cpu_kcycles_used);
604 /* hardware has native COPY command (see libdlo), but not worth it for fbcon */
605 static void dlfb_ops_copyarea(struct fb_info *info,
606 const struct fb_copyarea *area)
609 struct dlfb_data *dev = info->par;
611 #if defined CONFIG_FB_SYS_COPYAREA || defined CONFIG_FB_SYS_COPYAREA_MODULE
613 sys_copyarea(info, area);
615 dlfb_handle_damage(dev, area->dx, area->dy,
616 area->width, area->height, info->screen_base);
618 atomic_inc(&dev->copy_count);
622 static void dlfb_ops_imageblit(struct fb_info *info,
623 const struct fb_image *image)
625 struct dlfb_data *dev = info->par;
627 #if defined CONFIG_FB_SYS_IMAGEBLIT || defined CONFIG_FB_SYS_IMAGEBLIT_MODULE
629 sys_imageblit(info, image);
631 dlfb_handle_damage(dev, image->dx, image->dy,
632 image->width, image->height, info->screen_base);
636 atomic_inc(&dev->blit_count);
639 static void dlfb_ops_fillrect(struct fb_info *info,
640 const struct fb_fillrect *rect)
642 struct dlfb_data *dev = info->par;
644 #if defined CONFIG_FB_SYS_FILLRECT || defined CONFIG_FB_SYS_FILLRECT_MODULE
646 sys_fillrect(info, rect);
648 dlfb_handle_damage(dev, rect->dx, rect->dy, rect->width,
649 rect->height, info->screen_base);
652 atomic_inc(&dev->fill_count);
656 static void dlfb_get_edid(struct dlfb_data *dev)
662 for (i = 0; i < sizeof(dev->edid); i++) {
663 ret = usb_control_msg(dev->udev,
664 usb_rcvctrlpipe(dev->udev, 0), (0x02),
665 (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2,
667 dev->edid[i] = rbuf[1];
671 static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd,
675 struct dlfb_data *dev = info->par;
676 struct dloarea *area = NULL;
678 if (!atomic_read(&dev->usb_active))
681 /* TODO: Update X server to get this from sysfs instead */
682 if (cmd == DLFB_IOCTL_RETURN_EDID) {
683 char *edid = (char *)arg;
685 if (copy_to_user(edid, dev->edid, sizeof(dev->edid)))
690 /* TODO: Help propose a standard fb.h ioctl to report mmap damage */
691 if (cmd == DLFB_IOCTL_REPORT_DAMAGE) {
693 area = (struct dloarea *)arg;
698 if (area->x > info->var.xres)
699 area->x = info->var.xres;
704 if (area->y > info->var.yres)
705 area->y = info->var.yres;
707 atomic_set(&dev->use_defio, 0);
709 dlfb_handle_damage(dev, area->x, area->y, area->w, area->h,
711 atomic_inc(&dev->damage_count);
717 /* taken from vesafb */
719 dlfb_ops_setcolreg(unsigned regno, unsigned red, unsigned green,
720 unsigned blue, unsigned transp, struct fb_info *info)
724 if (regno >= info->cmap.len)
728 if (info->var.red.offset == 10) {
730 ((u32 *) (info->pseudo_palette))[regno] =
731 ((red & 0xf800) >> 1) |
732 ((green & 0xf800) >> 6) | ((blue & 0xf800) >> 11);
735 ((u32 *) (info->pseudo_palette))[regno] =
737 ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11);
745 * It's common for several clients to have framebuffer open simultaneously.
746 * e.g. both fbcon and X. Makes things interesting.
748 static int dlfb_ops_open(struct fb_info *info, int user)
750 struct dlfb_data *dev = info->par;
753 * We could special case kernel mode clients (fbcon) here
756 mutex_lock(&dev->fb_open_lock);
760 #ifdef CONFIG_FB_DEFERRED_IO
761 if ((atomic_read(&dev->use_defio)) && (info->fbdefio == NULL)) {
763 info->fbdefio = &dlfb_defio;
764 fb_deferred_io_init(info);
768 dl_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n",
769 info->node, user, info, dev->fb_count);
771 mutex_unlock(&dev->fb_open_lock);
776 static int dlfb_ops_release(struct fb_info *info, int user)
778 struct dlfb_data *dev = info->par;
780 mutex_lock(&dev->fb_open_lock);
784 #ifdef CONFIG_FB_DEFERRED_IO
785 if ((dev->fb_count == 0) && (info->fbdefio)) {
786 fb_deferred_io_cleanup(info);
787 info->fbdefio = NULL;
788 info->fbops->fb_mmap = dlfb_ops_mmap;
792 dl_notice("release /dev/fb%d user=%d count=%d\n",
793 info->node, user, dev->fb_count);
795 mutex_unlock(&dev->fb_open_lock);
801 * Called when all client interfaces to start transactions have been disabled,
802 * and all references to our device instance (dlfb_data) are released.
803 * Every transaction must have a reference, so we know are fully spun down
805 static void dlfb_delete(struct kref *kref)
807 struct dlfb_data *dev = container_of(kref, struct dlfb_data, kref);
809 if (dev->backing_buffer)
810 vfree(dev->backing_buffer);
812 mutex_destroy(&dev->fb_open_lock);
818 * Called by fbdev as last part of unregister_framebuffer() process
819 * No new clients can open connections. Deallocate everything fb_info.
821 static void dlfb_ops_destroy(struct fb_info *info)
823 struct dlfb_data *dev = info->par;
825 if (info->cmap.len != 0)
826 fb_dealloc_cmap(&info->cmap);
827 if (info->monspecs.modedb)
828 fb_destroy_modedb(info->monspecs.modedb);
829 if (info->screen_base)
830 vfree(info->screen_base);
832 fb_destroy_modelist(&info->modelist);
834 framebuffer_release(info);
836 /* ref taken before register_framebuffer() for dlfb_data clients */
837 kref_put(&dev->kref, dlfb_delete);
841 * Check whether a video mode is supported by the DisplayLink chip
842 * We start from monitor's modes, so don't need to filter that here
844 static int dlfb_is_valid_mode(struct fb_videomode *mode,
845 struct fb_info *info)
847 struct dlfb_data *dev = info->par;
849 if (mode->xres * mode->yres > dev->sku_pixel_limit)
855 static void dlfb_var_color_format(struct fb_var_screeninfo *var)
857 const struct fb_bitfield red = { 11, 5, 0 };
858 const struct fb_bitfield green = { 5, 6, 0 };
859 const struct fb_bitfield blue = { 0, 5, 0 };
861 var->bits_per_pixel = 16;
867 static int dlfb_ops_check_var(struct fb_var_screeninfo *var,
868 struct fb_info *info)
870 struct fb_videomode mode;
872 /* TODO: support dynamically changing framebuffer size */
873 if ((var->xres * var->yres * 2) > info->fix.smem_len)
876 /* set device-specific elements of var unrelated to mode */
877 dlfb_var_color_format(var);
879 fb_var_to_videomode(&mode, var);
881 if (!dlfb_is_valid_mode(&mode, info))
887 static int dlfb_ops_set_par(struct fb_info *info)
889 struct dlfb_data *dev = info->par;
891 dl_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres);
893 return dlfb_set_video_mode(dev, &info->var);
896 static int dlfb_ops_blank(int blank_mode, struct fb_info *info)
898 struct dlfb_data *dev = info->par;
902 urb = dlfb_get_urb(dev);
905 bufptr = (char *) urb->transfer_buffer;
907 /* overloading usb_active. UNBLANK can conflict with teardown */
909 bufptr = dlfb_vidreg_lock(bufptr);
910 if (blank_mode != FB_BLANK_UNBLANK) {
911 atomic_set(&dev->usb_active, 0);
912 bufptr = dlfb_enable_hvsync(bufptr, false);
914 atomic_set(&dev->usb_active, 1);
915 bufptr = dlfb_enable_hvsync(bufptr, true);
917 bufptr = dlfb_vidreg_unlock(bufptr);
919 dlfb_submit_urb(dev, urb, bufptr - (char *) urb->transfer_buffer);
924 static struct fb_ops dlfb_ops = {
925 .owner = THIS_MODULE,
926 .fb_setcolreg = dlfb_ops_setcolreg,
927 .fb_fillrect = dlfb_ops_fillrect,
928 .fb_copyarea = dlfb_ops_copyarea,
929 .fb_imageblit = dlfb_ops_imageblit,
930 .fb_mmap = dlfb_ops_mmap,
931 .fb_ioctl = dlfb_ops_ioctl,
932 .fb_open = dlfb_ops_open,
933 .fb_release = dlfb_ops_release,
934 .fb_blank = dlfb_ops_blank,
935 .fb_check_var = dlfb_ops_check_var,
936 .fb_set_par = dlfb_ops_set_par,
940 * Calls dlfb_get_edid() to query the EDID of attached monitor via usb cmds
941 * Then parses EDID into three places used by various parts of fbdev:
942 * fb_var_screeninfo contains the timing of the monitor's preferred mode
943 * fb_info.monspecs is full parsed EDID info, including monspecs.modedb
944 * fb_info.modelist is a linked list of all monitor & VESA modes which work
946 * If EDID is not readable/valid, then modelist is all VESA modes,
947 * monspecs is NULL, and fb_var_screeninfo is set to safe VESA mode
948 * Returns 0 if EDID parses successfully
950 static int dlfb_parse_edid(struct dlfb_data *dev,
951 struct fb_var_screeninfo *var,
952 struct fb_info *info)
955 const struct fb_videomode *default_vmode = NULL;
958 fb_destroy_modelist(&info->modelist);
959 memset(&info->monspecs, 0, sizeof(info->monspecs));
962 fb_edid_to_monspecs(dev->edid, &info->monspecs);
964 if (info->monspecs.modedb_len > 0) {
966 for (i = 0; i < info->monspecs.modedb_len; i++) {
967 if (dlfb_is_valid_mode(&info->monspecs.modedb[i], info))
968 fb_add_videomode(&info->monspecs.modedb[i],
972 default_vmode = fb_find_best_display(&info->monspecs,
975 struct fb_videomode fb_vmode = {0};
977 dl_err("Unable to get valid EDID from device/display\n");
981 * Add the standard VESA modes to our modelist
982 * Since we don't have EDID, there may be modes that
983 * overspec monitor and/or are incorrect aspect ratio, etc.
984 * But at least the user has a chance to choose
986 for (i = 0; i < VESA_MODEDB_SIZE; i++) {
987 if (dlfb_is_valid_mode((struct fb_videomode *)
988 &vesa_modes[i], info))
989 fb_add_videomode(&vesa_modes[i],
994 * default to resolution safe for projectors
995 * (since they are most common case without EDID)
999 fb_vmode.refresh = 60;
1000 default_vmode = fb_find_nearest_mode(&fb_vmode,
1004 fb_videomode_to_var(var, default_vmode);
1005 dlfb_var_color_format(var);
1010 static ssize_t metrics_bytes_rendered_show(struct device *fbdev,
1011 struct device_attribute *a, char *buf) {
1012 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1013 struct dlfb_data *dev = fb_info->par;
1014 return snprintf(buf, PAGE_SIZE, "%u\n",
1015 atomic_read(&dev->bytes_rendered));
1018 static ssize_t metrics_bytes_identical_show(struct device *fbdev,
1019 struct device_attribute *a, char *buf) {
1020 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1021 struct dlfb_data *dev = fb_info->par;
1022 return snprintf(buf, PAGE_SIZE, "%u\n",
1023 atomic_read(&dev->bytes_identical));
1026 static ssize_t metrics_bytes_sent_show(struct device *fbdev,
1027 struct device_attribute *a, char *buf) {
1028 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1029 struct dlfb_data *dev = fb_info->par;
1030 return snprintf(buf, PAGE_SIZE, "%u\n",
1031 atomic_read(&dev->bytes_sent));
1034 static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
1035 struct device_attribute *a, char *buf) {
1036 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1037 struct dlfb_data *dev = fb_info->par;
1038 return snprintf(buf, PAGE_SIZE, "%u\n",
1039 atomic_read(&dev->cpu_kcycles_used));
1042 static ssize_t metrics_misc_show(struct device *fbdev,
1043 struct device_attribute *a, char *buf) {
1044 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1045 struct dlfb_data *dev = fb_info->par;
1046 return snprintf(buf, PAGE_SIZE,
1047 "Calls to\ndamage: %u\nblit: %u\n"
1048 "defio faults: %u\ncopy: %u\n"
1050 "active framebuffer clients: %d\n"
1051 "urbs available %d(%d)\n"
1052 "Shadow framebuffer in use? %s\n"
1053 "Any lost pixels? %s\n",
1054 atomic_read(&dev->damage_count),
1055 atomic_read(&dev->blit_count),
1056 atomic_read(&dev->defio_fault_count),
1057 atomic_read(&dev->copy_count),
1058 atomic_read(&dev->fill_count),
1060 dev->urbs.available, dev->urbs.limit_sem.count,
1061 (dev->backing_buffer) ? "yes" : "no",
1062 atomic_read(&dev->lost_pixels) ? "yes" : "no");
1065 static ssize_t edid_show(struct kobject *kobj, struct bin_attribute *a,
1066 char *buf, loff_t off, size_t count) {
1067 struct device *fbdev = container_of(kobj, struct device, kobj);
1068 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1069 struct dlfb_data *dev = fb_info->par;
1070 char *edid = &dev->edid[0];
1071 const size_t size = sizeof(dev->edid);
1073 if (dlfb_parse_edid(dev, &fb_info->var, fb_info))
1079 if (off + count > size)
1081 memcpy(buf, edid + off, count);
1087 static ssize_t metrics_reset_store(struct device *fbdev,
1088 struct device_attribute *attr,
1089 const char *buf, size_t count)
1091 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1092 struct dlfb_data *dev = fb_info->par;
1094 atomic_set(&dev->bytes_rendered, 0);
1095 atomic_set(&dev->bytes_identical, 0);
1096 atomic_set(&dev->bytes_sent, 0);
1097 atomic_set(&dev->cpu_kcycles_used, 0);
1098 atomic_set(&dev->blit_count, 0);
1099 atomic_set(&dev->copy_count, 0);
1100 atomic_set(&dev->fill_count, 0);
1101 atomic_set(&dev->defio_fault_count, 0);
1102 atomic_set(&dev->damage_count, 0);
1107 static ssize_t use_defio_show(struct device *fbdev,
1108 struct device_attribute *a, char *buf) {
1109 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1110 struct dlfb_data *dev = fb_info->par;
1111 return snprintf(buf, PAGE_SIZE, "%d\n",
1112 atomic_read(&dev->use_defio));
1115 static ssize_t use_defio_store(struct device *fbdev,
1116 struct device_attribute *attr,
1117 const char *buf, size_t count)
1119 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1120 struct dlfb_data *dev = fb_info->par;
1124 atomic_set(&dev->use_defio, 0);
1126 atomic_set(&dev->use_defio, 1);
1131 static struct bin_attribute edid_attr = {
1132 .attr.name = "edid",
1138 static struct device_attribute fb_device_attrs[] = {
1139 __ATTR_RO(metrics_bytes_rendered),
1140 __ATTR_RO(metrics_bytes_identical),
1141 __ATTR_RO(metrics_bytes_sent),
1142 __ATTR_RO(metrics_cpu_kcycles_used),
1143 __ATTR_RO(metrics_misc),
1144 __ATTR(metrics_reset, S_IWUGO, NULL, metrics_reset_store),
1145 __ATTR_RW(use_defio),
1148 #ifdef CONFIG_FB_DEFERRED_IO
1149 static void dlfb_dpy_deferred_io(struct fb_info *info,
1150 struct list_head *pagelist)
1153 struct fb_deferred_io *fbdefio = info->fbdefio;
1154 struct dlfb_data *dev = info->par;
1157 cycles_t start_cycles, end_cycles;
1159 int bytes_identical = 0;
1160 int bytes_rendered = 0;
1161 int fault_count = 0;
1163 if (!atomic_read(&dev->use_defio))
1166 if (!atomic_read(&dev->usb_active))
1169 start_cycles = get_cycles();
1171 urb = dlfb_get_urb(dev);
1174 cmd = urb->transfer_buffer;
1176 /* walk the written page list and render each to device */
1177 list_for_each_entry(cur, &fbdefio->pagelist, lru) {
1178 dlfb_render_hline(dev, &urb, (char *) info->fix.smem_start,
1179 &cmd, cur->index << PAGE_SHIFT,
1180 PAGE_SIZE, &bytes_identical, &bytes_sent);
1181 bytes_rendered += PAGE_SIZE;
1185 if (cmd > (char *) urb->transfer_buffer) {
1186 /* Send partial buffer remaining before exiting */
1187 int len = cmd - (char *) urb->transfer_buffer;
1188 dlfb_submit_urb(dev, urb, len);
1191 dlfb_urb_completion(urb);
1193 atomic_add(fault_count, &dev->defio_fault_count);
1194 atomic_add(bytes_sent, &dev->bytes_sent);
1195 atomic_add(bytes_identical, &dev->bytes_identical);
1196 atomic_add(bytes_rendered, &dev->bytes_rendered);
1197 end_cycles = get_cycles();
1198 atomic_add(((unsigned int) ((end_cycles - start_cycles)
1199 >> 10)), /* Kcycles */
1200 &dev->cpu_kcycles_used);
1203 static struct fb_deferred_io dlfb_defio = {
1205 .deferred_io = dlfb_dpy_deferred_io,
1211 * This is necessary before we can communicate with the display controller.
1213 static int dlfb_select_std_channel(struct dlfb_data *dev)
1216 u8 set_def_chn[] = { 0x57, 0xCD, 0xDC, 0xA7,
1217 0x1C, 0x88, 0x5E, 0x15,
1218 0x60, 0xFE, 0xC6, 0x97,
1219 0x16, 0x3D, 0x47, 0xF2 };
1221 ret = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
1222 NR_USB_REQUEST_CHANNEL,
1223 (USB_DIR_OUT | USB_TYPE_VENDOR), 0, 0,
1224 set_def_chn, sizeof(set_def_chn), USB_CTRL_SET_TIMEOUT);
1229 static int dlfb_usb_probe(struct usb_interface *interface,
1230 const struct usb_device_id *id)
1232 struct usb_device *usbdev;
1233 struct dlfb_data *dev;
1234 struct fb_info *info;
1235 int videomemorysize;
1237 unsigned char *videomemory;
1238 int retval = -ENOMEM;
1239 struct fb_var_screeninfo *var;
1241 u16 *pix_framebuffer;
1243 /* usb initialization */
1245 usbdev = interface_to_usbdev(interface);
1247 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
1249 err("dlfb_usb_probe: failed alloc of dev struct\n");
1253 /* we need to wait for both usb and fbdev to spin down on disconnect */
1254 kref_init(&dev->kref); /* matching kref_put in usb .disconnect fn */
1255 kref_get(&dev->kref); /* matching kref_put in .fb_destroy function*/
1258 dev->gdev = &usbdev->dev; /* our generic struct device * */
1259 usb_set_intfdata(interface, dev);
1261 if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
1263 dl_err("dlfb_alloc_urb_list failed\n");
1267 mutex_init(&dev->fb_open_lock);
1269 /* We don't register a new USB class. Our client interface is fbdev */
1271 /* allocates framebuffer driver structure, not framebuffer memory */
1272 info = framebuffer_alloc(0, &usbdev->dev);
1275 dl_err("framebuffer_alloc failed\n");
1280 info->pseudo_palette = dev->pseudo_palette;
1281 info->fbops = &dlfb_ops;
1285 /* TODO set limit based on actual SKU detection */
1286 dev->sku_pixel_limit = 2048 * 1152;
1288 INIT_LIST_HEAD(&info->modelist);
1289 dlfb_parse_edid(dev, var, info);
1292 * ok, now that we've got the size info, we can alloc our framebuffer.
1294 info->fix = dlfb_fix;
1295 info->fix.line_length = var->xres * (var->bits_per_pixel / 8);
1296 videomemorysize = info->fix.line_length * var->yres;
1299 * The big chunk of system memory we use as a virtual framebuffer.
1300 * TODO: Handle fbcon cursor code calling blit in interrupt context
1302 videomemory = vmalloc(videomemorysize);
1305 dl_err("Virtual framebuffer alloc failed\n");
1309 info->screen_base = videomemory;
1310 info->fix.smem_len = PAGE_ALIGN(videomemorysize);
1311 info->fix.smem_start = (unsigned long) videomemory;
1312 info->flags = udlfb_info_flags;
1316 * Second framebuffer copy, mirroring the state of the framebuffer
1317 * on the physical USB device. We can function without this.
1318 * But with imperfect damage info we may end up sending pixels over USB
1319 * that were, in fact, unchanged -- wasting limited USB bandwidth
1321 dev->backing_buffer = vmalloc(videomemorysize);
1322 if (!dev->backing_buffer)
1323 dl_warn("No shadow/backing buffer allcoated\n");
1325 memset(dev->backing_buffer, 0, videomemorysize);
1327 retval = fb_alloc_cmap(&info->cmap, 256, 0);
1329 dl_err("fb_alloc_cmap failed %x\n", retval);
1333 /* ready to begin using device */
1335 #ifdef CONFIG_FB_DEFERRED_IO
1336 atomic_set(&dev->use_defio, 1);
1338 atomic_set(&dev->usb_active, 1);
1339 dlfb_select_std_channel(dev);
1341 dlfb_ops_check_var(var, info);
1342 dlfb_ops_set_par(info);
1344 /* paint greenscreen */
1345 pix_framebuffer = (u16 *) videomemory;
1346 for (i = 0; i < videomemorysize / 2; i++)
1347 pix_framebuffer[i] = 0x37e6;
1349 dlfb_handle_damage(dev, 0, 0, info->var.xres, info->var.yres,
1352 retval = register_framebuffer(info);
1354 dl_err("register_framebuffer failed %d\n", retval);
1359 for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
1360 device_create_file(info->dev, &fb_device_attrs[i]);
1362 device_create_bin_file(info->dev, &edid_attr);
1364 dl_err("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
1365 " Using %dK framebuffer memory\n", info->node,
1366 var->xres, var->yres,
1367 ((dev->backing_buffer) ?
1368 videomemorysize * 2 : videomemorysize) >> 10);
1374 unregister_framebuffer(info);
1375 dlfb_ops_destroy(info);
1377 kref_put(&dev->kref, dlfb_delete);
1379 if (dev->urbs.count > 0)
1380 dlfb_free_urb_list(dev);
1381 kref_put(&dev->kref, dlfb_delete); /* last ref from kref_init */
1383 /* dev has been deallocated. Do not dereference */
1389 static void dlfb_usb_disconnect(struct usb_interface *interface)
1391 struct dlfb_data *dev;
1392 struct fb_info *info;
1395 dev = usb_get_intfdata(interface);
1398 /* when non-active we'll update virtual framebuffer, but no new urbs */
1399 atomic_set(&dev->usb_active, 0);
1401 usb_set_intfdata(interface, NULL);
1403 for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
1404 device_remove_file(info->dev, &fb_device_attrs[i]);
1406 device_remove_bin_file(info->dev, &edid_attr);
1408 /* this function will wait for all in-flight urbs to complete */
1409 dlfb_free_urb_list(dev);
1412 dl_notice("Detaching /dev/fb%d\n", info->node);
1413 unregister_framebuffer(info);
1414 dlfb_ops_destroy(info);
1417 /* release reference taken by kref_init in probe() */
1418 kref_put(&dev->kref, dlfb_delete);
1420 /* consider dlfb_data freed */
1425 static struct usb_driver dlfb_driver = {
1427 .probe = dlfb_usb_probe,
1428 .disconnect = dlfb_usb_disconnect,
1429 .id_table = id_table,
1432 static int __init dlfb_module_init(void)
1436 res = usb_register(&dlfb_driver);
1438 err("usb_register failed. Error number %d", res);
1440 printk("VMODES initialized\n");
1445 static void __exit dlfb_module_exit(void)
1447 usb_deregister(&dlfb_driver);
1450 module_init(dlfb_module_init);
1451 module_exit(dlfb_module_exit);
1453 static void dlfb_urb_completion(struct urb *urb)
1455 struct urb_node *unode = urb->context;
1456 struct dlfb_data *dev = unode->dev;
1457 unsigned long flags;
1459 /* sync/async unlink faults aren't errors */
1461 if (!(urb->status == -ENOENT ||
1462 urb->status == -ECONNRESET ||
1463 urb->status == -ESHUTDOWN)) {
1464 dl_err("%s - nonzero write bulk status received: %d\n",
1465 __func__, urb->status);
1466 atomic_set(&dev->lost_pixels, 1);
1470 urb->transfer_buffer_length = dev->urbs.size; /* reset to actual */
1472 spin_lock_irqsave(&dev->urbs.lock, flags);
1473 list_add_tail(&unode->entry, &dev->urbs.list);
1474 dev->urbs.available++;
1475 spin_unlock_irqrestore(&dev->urbs.lock, flags);
1477 up(&dev->urbs.limit_sem);
1480 static void dlfb_free_urb_list(struct dlfb_data *dev)
1482 int count = dev->urbs.count;
1483 struct list_head *node;
1484 struct urb_node *unode;
1487 unsigned long flags;
1489 dl_notice("Waiting for completes and freeing all render urbs\n");
1491 /* keep waiting and freeing, until we've got 'em all */
1493 /* Timeout means a memory leak and/or fault */
1494 ret = down_timeout(&dev->urbs.limit_sem, FREE_URB_TIMEOUT);
1499 spin_lock_irqsave(&dev->urbs.lock, flags);
1501 node = dev->urbs.list.next; /* have reserved one with sem */
1502 list_del_init(node);
1504 spin_unlock_irqrestore(&dev->urbs.lock, flags);
1506 unode = list_entry(node, struct urb_node, entry);
1509 /* Free each separately allocated piece */
1510 usb_buffer_free(urb->dev, dev->urbs.size,
1511 urb->transfer_buffer, urb->transfer_dma);
1516 kref_put(&dev->kref, dlfb_delete);
1520 static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size)
1524 struct urb_node *unode;
1527 spin_lock_init(&dev->urbs.lock);
1529 dev->urbs.size = size;
1530 INIT_LIST_HEAD(&dev->urbs.list);
1533 unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL);
1538 urb = usb_alloc_urb(0, GFP_KERNEL);
1545 buf = usb_buffer_alloc(dev->udev, MAX_TRANSFER, GFP_KERNEL,
1546 &urb->transfer_dma);
1553 /* urb->transfer_buffer_length set to actual before submit */
1554 usb_fill_bulk_urb(urb, dev->udev, usb_sndbulkpipe(dev->udev, 1),
1555 buf, size, dlfb_urb_completion, unode);
1556 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1558 list_add_tail(&unode->entry, &dev->urbs.list);
1563 sema_init(&dev->urbs.limit_sem, i);
1564 dev->urbs.count = i;
1565 dev->urbs.available = i;
1567 kref_get(&dev->kref); /* released in free_render_urbs() */
1569 dl_notice("allocated %d %d byte urbs \n", i, (int) size);
1574 static struct urb *dlfb_get_urb(struct dlfb_data *dev)
1577 struct list_head *entry;
1578 struct urb_node *unode;
1579 struct urb *urb = NULL;
1580 unsigned long flags;
1582 /* Wait for an in-flight buffer to complete and get re-queued */
1583 ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT);
1585 atomic_set(&dev->lost_pixels, 1);
1586 dl_err("wait for urb interrupted: %x\n", ret);
1590 spin_lock_irqsave(&dev->urbs.lock, flags);
1592 BUG_ON(list_empty(&dev->urbs.list)); /* reserved one with limit_sem */
1593 entry = dev->urbs.list.next;
1594 list_del_init(entry);
1595 dev->urbs.available--;
1597 spin_unlock_irqrestore(&dev->urbs.lock, flags);
1599 unode = list_entry(entry, struct urb_node, entry);
1606 static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len)
1610 BUG_ON(len > dev->urbs.size);
1612 urb->transfer_buffer_length = len; /* set to actual payload len */
1613 ret = usb_submit_urb(urb, GFP_KERNEL);
1615 dlfb_urb_completion(urb); /* because no one else will */
1616 atomic_set(&dev->lost_pixels, 1);
1617 dl_err("usb_submit_urb error %x\n", ret);
1622 MODULE_AUTHOR("Roberto De Ioris <roberto@unbit.it>, "
1623 "Jaya Kumar <jayakumar.lkml@gmail.com>, "
1624 "Bernie Thompson <bernie@plugable.com>");
1625 MODULE_DESCRIPTION("DisplayLink kernel framebuffer driver");
1626 MODULE_LICENSE("GPL");