diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/staging/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/staging/Makefile | 1 | ||||
| -rw-r--r-- | drivers/staging/udlfb/Kconfig | 14 | ||||
| -rw-r--r-- | drivers/staging/udlfb/Makefile | 1 | ||||
| -rw-r--r-- | drivers/staging/udlfb/udlfb.h | 117 | ||||
| -rw-r--r-- | drivers/staging/udlfb/udlfb.txt | 144 | ||||
| -rw-r--r-- | drivers/video/Kconfig | 14 | ||||
| -rw-r--r-- | drivers/video/Makefile | 1 | ||||
| -rw-r--r-- | drivers/video/udlfb.c (renamed from drivers/staging/udlfb/udlfb.c) | 135 |
9 files changed, 64 insertions, 365 deletions
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index 5eafdf435550..df31a7228079 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig | |||
| @@ -111,8 +111,6 @@ source "drivers/staging/vt6655/Kconfig" | |||
| 111 | 111 | ||
| 112 | source "drivers/staging/vt6656/Kconfig" | 112 | source "drivers/staging/vt6656/Kconfig" |
| 113 | 113 | ||
| 114 | source "drivers/staging/udlfb/Kconfig" | ||
| 115 | |||
| 116 | source "drivers/staging/hv/Kconfig" | 114 | source "drivers/staging/hv/Kconfig" |
| 117 | 115 | ||
| 118 | source "drivers/staging/vme/Kconfig" | 116 | source "drivers/staging/vme/Kconfig" |
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index a97a955c094b..7a15c0c82b69 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile | |||
| @@ -38,7 +38,6 @@ obj-$(CONFIG_USB_SERIAL_QUATECH_USB2) += quatech_usb2/ | |||
| 38 | obj-$(CONFIG_OCTEON_ETHERNET) += octeon/ | 38 | obj-$(CONFIG_OCTEON_ETHERNET) += octeon/ |
| 39 | obj-$(CONFIG_VT6655) += vt6655/ | 39 | obj-$(CONFIG_VT6655) += vt6655/ |
| 40 | obj-$(CONFIG_VT6656) += vt6656/ | 40 | obj-$(CONFIG_VT6656) += vt6656/ |
| 41 | obj-$(CONFIG_FB_UDL) += udlfb/ | ||
| 42 | obj-$(CONFIG_HYPERV) += hv/ | 41 | obj-$(CONFIG_HYPERV) += hv/ |
| 43 | obj-$(CONFIG_VME_BUS) += vme/ | 42 | obj-$(CONFIG_VME_BUS) += vme/ |
| 44 | obj-$(CONFIG_MRST_RAR_HANDLER) += memrar/ | 43 | obj-$(CONFIG_MRST_RAR_HANDLER) += memrar/ |
diff --git a/drivers/staging/udlfb/Kconfig b/drivers/staging/udlfb/Kconfig deleted file mode 100644 index 65bd5db4ca56..000000000000 --- a/drivers/staging/udlfb/Kconfig +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | config FB_UDL | ||
| 2 | tristate "Displaylink USB Framebuffer support" | ||
| 3 | depends on FB && USB | ||
| 4 | select FB_MODE_HELPERS | ||
| 5 | select FB_SYS_FILLRECT | ||
| 6 | select FB_SYS_COPYAREA | ||
| 7 | select FB_SYS_IMAGEBLIT | ||
| 8 | select FB_SYS_FOPS | ||
| 9 | select FB_DEFERRED_IO | ||
| 10 | ---help--- | ||
| 11 | This is a kernel framebuffer driver for DisplayLink USB devices. | ||
| 12 | Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and | ||
| 13 | mplayer -vo fbdev. Supports all USB 2.0 era DisplayLink devices. | ||
| 14 | To compile as a module, choose M here: the module name is udlfb. | ||
diff --git a/drivers/staging/udlfb/Makefile b/drivers/staging/udlfb/Makefile deleted file mode 100644 index 30d9e675b10f..000000000000 --- a/drivers/staging/udlfb/Makefile +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | obj-$(CONFIG_FB_UDL) += udlfb.o | ||
diff --git a/drivers/staging/udlfb/udlfb.h b/drivers/staging/udlfb/udlfb.h deleted file mode 100644 index 6f9785e9d62e..000000000000 --- a/drivers/staging/udlfb/udlfb.h +++ /dev/null | |||
| @@ -1,117 +0,0 @@ | |||
| 1 | #ifndef UDLFB_H | ||
| 2 | #define UDLFB_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * TODO: Propose standard fb.h ioctl for reporting damage, | ||
| 6 | * using _IOWR() and one of the existing area structs from fb.h | ||
| 7 | * Consider these ioctls deprecated, but they're still used by the | ||
| 8 | * DisplayLink X server as yet - need both to be modified in tandem | ||
| 9 | * when new ioctl(s) are ready. | ||
| 10 | */ | ||
| 11 | #define DLFB_IOCTL_RETURN_EDID 0xAD | ||
| 12 | #define DLFB_IOCTL_REPORT_DAMAGE 0xAA | ||
| 13 | struct dloarea { | ||
| 14 | int x, y; | ||
| 15 | int w, h; | ||
| 16 | int x2, y2; | ||
| 17 | }; | ||
| 18 | |||
| 19 | struct urb_node { | ||
| 20 | struct list_head entry; | ||
| 21 | struct dlfb_data *dev; | ||
| 22 | struct delayed_work release_urb_work; | ||
| 23 | struct urb *urb; | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct urb_list { | ||
| 27 | struct list_head list; | ||
| 28 | spinlock_t lock; | ||
| 29 | struct semaphore limit_sem; | ||
| 30 | int available; | ||
| 31 | int count; | ||
| 32 | size_t size; | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct dlfb_data { | ||
| 36 | struct usb_device *udev; | ||
| 37 | struct device *gdev; /* &udev->dev */ | ||
| 38 | struct fb_info *info; | ||
| 39 | struct urb_list urbs; | ||
| 40 | struct kref kref; | ||
| 41 | char *backing_buffer; | ||
| 42 | int fb_count; | ||
| 43 | bool virtualized; /* true when physical usb device not present */ | ||
| 44 | struct delayed_work free_framebuffer_work; | ||
| 45 | atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */ | ||
| 46 | atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */ | ||
| 47 | char *edid; /* null until we read edid from hw or get from sysfs */ | ||
| 48 | size_t edid_size; | ||
| 49 | int sku_pixel_limit; | ||
| 50 | int base16; | ||
| 51 | int base8; | ||
| 52 | u32 pseudo_palette[256]; | ||
| 53 | /* blit-only rendering path metrics, exposed through sysfs */ | ||
| 54 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ | ||
| 55 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ | ||
| 56 | atomic_t bytes_sent; /* to usb, after compression including overhead */ | ||
| 57 | atomic_t cpu_kcycles_used; /* transpired during pixel processing */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | #define NR_USB_REQUEST_I2C_SUB_IO 0x02 | ||
| 61 | #define NR_USB_REQUEST_CHANNEL 0x12 | ||
| 62 | |||
| 63 | /* -BULK_SIZE as per usb-skeleton. Can we get full page and avoid overhead? */ | ||
| 64 | #define BULK_SIZE 512 | ||
| 65 | #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) | ||
| 66 | #define WRITES_IN_FLIGHT (4) | ||
| 67 | |||
| 68 | #define MIN_EDID_SIZE 128 | ||
| 69 | #define MAX_EDID_SIZE 128 | ||
| 70 | |||
| 71 | #define MAX_VENDOR_DESCRIPTOR_SIZE 256 | ||
| 72 | |||
| 73 | #define GET_URB_TIMEOUT HZ | ||
| 74 | #define FREE_URB_TIMEOUT (HZ*2) | ||
| 75 | |||
| 76 | #define BPP 2 | ||
| 77 | #define MAX_CMD_PIXELS 255 | ||
| 78 | |||
| 79 | #define RLX_HEADER_BYTES 7 | ||
| 80 | #define MIN_RLX_PIX_BYTES 4 | ||
| 81 | #define MIN_RLX_CMD_BYTES (RLX_HEADER_BYTES + MIN_RLX_PIX_BYTES) | ||
| 82 | |||
| 83 | #define RLE_HEADER_BYTES 6 | ||
| 84 | #define MIN_RLE_PIX_BYTES 3 | ||
| 85 | #define MIN_RLE_CMD_BYTES (RLE_HEADER_BYTES + MIN_RLE_PIX_BYTES) | ||
| 86 | |||
| 87 | #define RAW_HEADER_BYTES 6 | ||
| 88 | #define MIN_RAW_PIX_BYTES 2 | ||
| 89 | #define MIN_RAW_CMD_BYTES (RAW_HEADER_BYTES + MIN_RAW_PIX_BYTES) | ||
| 90 | |||
| 91 | #define DL_DEFIO_WRITE_DELAY 5 /* fb_deferred_io.delay in jiffies */ | ||
| 92 | #define DL_DEFIO_WRITE_DISABLE (HZ*60) /* "disable" with long delay */ | ||
| 93 | |||
| 94 | /* remove these once align.h patch is taken into kernel */ | ||
| 95 | #define DL_ALIGN_UP(x, a) ALIGN(x, a) | ||
| 96 | #define DL_ALIGN_DOWN(x, a) ALIGN(x-(a-1), a) | ||
| 97 | |||
| 98 | /* remove once this gets added to sysfs.h */ | ||
| 99 | #define __ATTR_RW(attr) __ATTR(attr, 0644, attr##_show, attr##_store) | ||
| 100 | |||
| 101 | /* | ||
| 102 | * udlfb is both a usb device, and a framebuffer device. | ||
| 103 | * They may exist at the same time, but during various stages | ||
| 104 | * inactivity, teardown, or "virtual" operation, only one or the | ||
| 105 | * other will exist (one will outlive the other). So we can't | ||
| 106 | * call the dev_*() macros, because we don't have a stable dev object. | ||
| 107 | */ | ||
| 108 | #define dl_err(format, arg...) \ | ||
| 109 | pr_err("udlfb: " format, ## arg) | ||
| 110 | #define dl_warn(format, arg...) \ | ||
| 111 | pr_warning("udlfb: " format, ## arg) | ||
| 112 | #define dl_notice(format, arg...) \ | ||
| 113 | pr_notice("udlfb: " format, ## arg) | ||
| 114 | #define dl_info(format, arg...) \ | ||
| 115 | pr_info("udlfb: " format, ## arg) | ||
| 116 | |||
| 117 | #endif | ||
diff --git a/drivers/staging/udlfb/udlfb.txt b/drivers/staging/udlfb/udlfb.txt deleted file mode 100644 index 7fdde2a02a27..000000000000 --- a/drivers/staging/udlfb/udlfb.txt +++ /dev/null | |||
| @@ -1,144 +0,0 @@ | |||
| 1 | |||
| 2 | What is udlfb? | ||
| 3 | =============== | ||
| 4 | |||
| 5 | This is a driver for DisplayLink USB 2.0 era graphics chips. | ||
| 6 | |||
| 7 | DisplayLink chips provide simple hline/blit operations with some compression, | ||
| 8 | pairing that with a hardware framebuffer (16MB) on the other end of the | ||
| 9 | USB wire. That hardware framebuffer is able to drive the VGA, DVI, or HDMI | ||
| 10 | monitor with no CPU involvement until a pixel has to change. | ||
| 11 | |||
| 12 | The CPU or other local resource does all the rendering; optinally compares the | ||
| 13 | result with a local shadow of the remote hardware framebuffer to identify | ||
| 14 | the minimal set of pixels that have changed; and compresses and sends those | ||
| 15 | pixels line-by-line via USB bulk transfers. | ||
| 16 | |||
| 17 | Because of the efficiency of bulk transfers and a protocol on top that | ||
| 18 | does not require any acks - the effect is very low latency that | ||
| 19 | can support surprisingly high resolutions with good performance for | ||
| 20 | non-gaming and non-video applications. | ||
| 21 | |||
| 22 | Mode setting, EDID read, etc are other bulk or control transfers. Mode | ||
| 23 | setting is very flexible - able to set nearly arbitrary modes from any timing. | ||
| 24 | |||
| 25 | Advantages of USB graphics in general: | ||
| 26 | |||
| 27 | * Ability to add a nearly arbitrary number of displays to any USB 2.0 | ||
| 28 | capable system. On Linux, number of displays is limited by fbdev interface | ||
| 29 | (FB_MAX is currently 32). Of course, all USB devices on the same | ||
| 30 | host controller share the same 480Mbs USB 2.0 interface. | ||
| 31 | |||
| 32 | Advantages of supporting DisplayLink chips with kernel framebuffer interface: | ||
| 33 | |||
| 34 | * The actual hardware functionality of DisplayLink chips matches nearly | ||
| 35 | one-to-one with the fbdev interface, making the driver quite small and | ||
| 36 | tight relative to the functionality it provides. | ||
| 37 | * X servers and other applications can use the standard fbdev interface | ||
| 38 | from user mode to talk to the device, without needing to know anything | ||
| 39 | about USB or DisplayLink's protocol at all. A "displaylink" X driver | ||
| 40 | and a slightly modified "fbdev" X driver are among those that already do. | ||
| 41 | |||
| 42 | Disadvantages: | ||
| 43 | |||
| 44 | * Fbdev's mmap interface assumes a real hardware framebuffer is mapped. | ||
| 45 | In the case of USB graphics, it is just an allocated (virtual) buffer. | ||
| 46 | Writes need to be detected and encoded into USB bulk transfers by the CPU. | ||
| 47 | Accurate damage/changed area notifications work around this problem. | ||
| 48 | In the future, hopefully fbdev will be enhanced with an small standard | ||
| 49 | interface to allow mmap clients to report damage, for the benefit | ||
| 50 | of virtual or remote framebuffers. | ||
| 51 | * Fbdev does not arbitrate client ownership of the framebuffer well. | ||
| 52 | * Fbcon assumes the first framebuffer it finds should be consumed for console. | ||
| 53 | * It's not clear what the future of fbdev is, given the rise of KMS/DRM. | ||
| 54 | |||
| 55 | How to use it? | ||
| 56 | ============== | ||
| 57 | |||
| 58 | Udlfb, when loaded as a module, will match against all USB 2.0 generation | ||
| 59 | DisplayLink chips (Alex and Ollie family). It will then attempt to read the EDID | ||
| 60 | of the monitor, and set the best common mode between the DisplayLink device | ||
| 61 | and the monitor's capabilities. | ||
| 62 | |||
| 63 | If the DisplayLink device is successful, it will paint a "green screen" which | ||
| 64 | means that from a hardware and fbdev software perspective, everything is good. | ||
| 65 | |||
| 66 | At that point, a /dev/fb? interface will be present for user-mode applications | ||
| 67 | to open and begin writing to the framebuffer of the DisplayLink device using | ||
| 68 | standard fbdev calls. Note that if mmap() is used, by default the user mode | ||
| 69 | application must send down damage notifcations to trigger repaints of the | ||
| 70 | changed regions. Alternatively, udlfb can be recompiled with experimental | ||
| 71 | defio support enabled, to support a page-fault based detection mechanism | ||
| 72 | that can work without explicit notifcation. | ||
| 73 | |||
| 74 | The most common client of udlfb is xf86-video-displaylink or a modified | ||
| 75 | xf86-video-fbdev X server. These servers have no real DisplayLink specific | ||
| 76 | code. They write to the standard framebuffer interface and rely on udlfb | ||
| 77 | to do its thing. The one extra feature they have is the ability to report | ||
| 78 | rectangles from the X DAMAGE protocol extension down to udlfb via udlfb's | ||
| 79 | damage interface (which will hopefully be standardized for all virtual | ||
| 80 | framebuffers that need damage info). These damage notifications allow | ||
| 81 | udlfb to efficiently process the changed pixels. | ||
| 82 | |||
| 83 | Module Options | ||
| 84 | ============== | ||
| 85 | |||
| 86 | Special configuration for udlfb is usually unnecessary. There are a few | ||
| 87 | options, however. | ||
| 88 | |||
| 89 | From the command line, pass options to modprobe | ||
| 90 | modprobe udlfb defio=1 console=1 | ||
| 91 | |||
| 92 | Or for permanent option, create file like /etc/modprobe.d/options with text | ||
| 93 | options udlfb defio=1 console=1 | ||
| 94 | |||
| 95 | Accepted options: | ||
| 96 | |||
| 97 | fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel | ||
| 98 | module to track changed areas of the framebuffer by page faults. | ||
| 99 | Standard fbdev applications that use mmap but that do not | ||
| 100 | report damage, may be able to work with this enabled. | ||
| 101 | Disabled by default because of overhead and other issues. | ||
| 102 | |||
| 103 | console Allow fbcon to attach to udlfb provided framebuffers. This | ||
| 104 | is disabled by default because fbcon will aggressively consume | ||
| 105 | the first framebuffer it finds, which isn't usually what the | ||
| 106 | user wants in the case of USB displays. | ||
| 107 | |||
| 108 | Sysfs Attributes | ||
| 109 | ================ | ||
| 110 | |||
| 111 | Udlfb creates several files in /sys/class/graphics/fb? | ||
| 112 | Where ? is the sequential framebuffer id of the particular DisplayLink device | ||
| 113 | |||
| 114 | edid If a valid EDID blob is written to this file (typically | ||
| 115 | by a udev rule), then udlfb will use this EDID as a | ||
| 116 | backup in case reading the actual EDID of the monitor | ||
| 117 | attached to the DisplayLink device fails. This is | ||
| 118 | especially useful for fixed panels, etc. that cannot | ||
| 119 | communicate their capabilities via EDID. Reading | ||
| 120 | this file returns the current EDID of the attached | ||
| 121 | monitor (or last backup value written). This is | ||
| 122 | useful to get the EDID of the attached monitor, | ||
| 123 | which can be passed to utilities like parse-edid. | ||
| 124 | |||
| 125 | metrics_bytes_rendered 32-bit count of pixel bytes rendered | ||
| 126 | |||
| 127 | metrics_bytes_identical 32-bit count of how many of those bytes were found to be | ||
| 128 | unchanged, based on a shadow framebuffer check | ||
| 129 | |||
| 130 | metrics_bytes_sent 32-bit count of how many bytes were transferred over | ||
| 131 | USB to communicate the resulting changed pixels to the | ||
| 132 | hardware. Includes compression and protocol overhead | ||
| 133 | |||
| 134 | metrics_cpu_kcycles_used 32-bit count of CPU cycles used in processing the | ||
| 135 | above pixels (in thousands of cycles). | ||
| 136 | |||
| 137 | metrics_reset Write-only. Any write to this file resets all metrics | ||
| 138 | above to zero. Note that the 32-bit counters above | ||
| 139 | roll over very quickly. To get reliable results, design | ||
| 140 | performance tests to start and finish in a very short | ||
| 141 | period of time (one minute or less is safe). | ||
| 142 | |||
| 143 | -- | ||
| 144 | Bernie Thompson <bernie@plugable.com> | ||
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index fdddf58bdaf5..9f36a29b10b4 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
| @@ -2116,6 +2116,20 @@ config FB_SM501 | |||
| 2116 | 2116 | ||
| 2117 | If unsure, say N. | 2117 | If unsure, say N. |
| 2118 | 2118 | ||
| 2119 | config FB_UDL | ||
| 2120 | tristate "Displaylink USB Framebuffer support" | ||
| 2121 | depends on FB && USB | ||
| 2122 | select FB_MODE_HELPERS | ||
| 2123 | select FB_SYS_FILLRECT | ||
| 2124 | select FB_SYS_COPYAREA | ||
| 2125 | select FB_SYS_IMAGEBLIT | ||
| 2126 | select FB_SYS_FOPS | ||
| 2127 | select FB_DEFERRED_IO | ||
| 2128 | ---help--- | ||
| 2129 | This is a kernel framebuffer driver for DisplayLink USB devices. | ||
| 2130 | Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and | ||
| 2131 | mplayer -vo fbdev. Supports all USB 2.0 era DisplayLink devices. | ||
| 2132 | To compile as a module, choose M here: the module name is udlfb. | ||
| 2119 | 2133 | ||
| 2120 | config FB_PNX4008_DUM | 2134 | config FB_PNX4008_DUM |
| 2121 | tristate "Display Update Module support on Philips PNX4008 board" | 2135 | tristate "Display Update Module support on Philips PNX4008 board" |
diff --git a/drivers/video/Makefile b/drivers/video/Makefile index bdf626419433..f9de51c39ad7 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile | |||
| @@ -125,6 +125,7 @@ obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnx4008/ | |||
| 125 | obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o | 125 | obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o |
| 126 | obj-$(CONFIG_FB_PS3) += ps3fb.o | 126 | obj-$(CONFIG_FB_PS3) += ps3fb.o |
| 127 | obj-$(CONFIG_FB_SM501) += sm501fb.o | 127 | obj-$(CONFIG_FB_SM501) += sm501fb.o |
| 128 | obj-$(CONFIG_FB_UDL) += udlfb.o | ||
| 128 | obj-$(CONFIG_FB_XILINX) += xilinxfb.o | 129 | obj-$(CONFIG_FB_XILINX) += xilinxfb.o |
| 129 | obj-$(CONFIG_SH_MIPI_DSI) += sh_mipi_dsi.o | 130 | obj-$(CONFIG_SH_MIPI_DSI) += sh_mipi_dsi.o |
| 130 | obj-$(CONFIG_FB_SH_MOBILE_HDMI) += sh_mobile_hdmi.o | 131 | obj-$(CONFIG_FB_SH_MOBILE_HDMI) += sh_mobile_hdmi.o |
diff --git a/drivers/staging/udlfb/udlfb.c b/drivers/video/udlfb.c index b7ac16005265..020589a6bf02 100644 --- a/drivers/staging/udlfb/udlfb.c +++ b/drivers/video/udlfb.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | * from Florian Echtler, Henrik Bjerregaard Pedersen, and others. | 16 | * from Florian Echtler, Henrik Bjerregaard Pedersen, and others. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 20 | |||
| 19 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 20 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 21 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| @@ -26,8 +28,8 @@ | |||
| 26 | #include <linux/vmalloc.h> | 28 | #include <linux/vmalloc.h> |
| 27 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
| 28 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
| 29 | 31 | #include <video/udlfb.h> | |
| 30 | #include "udlfb.h" | 32 | #include "edid.h" |
| 31 | 33 | ||
| 32 | static struct fb_fix_screeninfo dlfb_fix = { | 34 | static struct fb_fix_screeninfo dlfb_fix = { |
| 33 | .id = "udlfb", | 35 | .id = "udlfb", |
| @@ -40,9 +42,7 @@ static struct fb_fix_screeninfo dlfb_fix = { | |||
| 40 | }; | 42 | }; |
| 41 | 43 | ||
| 42 | static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST | | 44 | static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST | |
| 43 | #ifdef FBINFO_VIRTFB | ||
| 44 | FBINFO_VIRTFB | | 45 | FBINFO_VIRTFB | |
| 45 | #endif | ||
| 46 | FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT | | 46 | FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_FILLRECT | |
| 47 | FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR; | 47 | FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR; |
| 48 | 48 | ||
| @@ -293,7 +293,7 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
| 293 | 293 | ||
| 294 | pos = (unsigned long)info->fix.smem_start + offset; | 294 | pos = (unsigned long)info->fix.smem_start + offset; |
| 295 | 295 | ||
| 296 | dl_notice("mmap() framebuffer addr:%lu size:%lu\n", | 296 | pr_notice("mmap() framebuffer addr:%lu size:%lu\n", |
| 297 | pos, size); | 297 | pos, size); |
| 298 | 298 | ||
| 299 | while (size > 0) { | 299 | while (size > 0) { |
| @@ -595,18 +595,6 @@ error: | |||
| 595 | return 0; | 595 | return 0; |
| 596 | } | 596 | } |
| 597 | 597 | ||
| 598 | static ssize_t dlfb_ops_read(struct fb_info *info, char __user *buf, | ||
| 599 | size_t count, loff_t *ppos) | ||
| 600 | { | ||
| 601 | ssize_t result = -ENOSYS; | ||
| 602 | |||
| 603 | #if defined CONFIG_FB_SYS_FOPS || defined CONFIG_FB_SYS_FOPS_MODULE | ||
| 604 | result = fb_sys_read(info, buf, count, ppos); | ||
| 605 | #endif | ||
| 606 | |||
| 607 | return result; | ||
| 608 | } | ||
| 609 | |||
| 610 | /* | 598 | /* |
| 611 | * Path triggered by usermode clients who write to filesystem | 599 | * Path triggered by usermode clients who write to filesystem |
| 612 | * e.g. cat filename > /dev/fb1 | 600 | * e.g. cat filename > /dev/fb1 |
| @@ -616,12 +604,10 @@ static ssize_t dlfb_ops_read(struct fb_info *info, char __user *buf, | |||
| 616 | static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf, | 604 | static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf, |
| 617 | size_t count, loff_t *ppos) | 605 | size_t count, loff_t *ppos) |
| 618 | { | 606 | { |
| 619 | ssize_t result = -ENOSYS; | 607 | ssize_t result; |
| 620 | struct dlfb_data *dev = info->par; | 608 | struct dlfb_data *dev = info->par; |
| 621 | u32 offset = (u32) *ppos; | 609 | u32 offset = (u32) *ppos; |
| 622 | 610 | ||
| 623 | #if defined CONFIG_FB_SYS_FOPS || defined CONFIG_FB_SYS_FOPS_MODULE | ||
| 624 | |||
| 625 | result = fb_sys_write(info, buf, count, ppos); | 611 | result = fb_sys_write(info, buf, count, ppos); |
| 626 | 612 | ||
| 627 | if (result > 0) { | 613 | if (result > 0) { |
| @@ -632,7 +618,6 @@ static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf, | |||
| 632 | dlfb_handle_damage(dev, 0, start, info->var.xres, | 618 | dlfb_handle_damage(dev, 0, start, info->var.xres, |
| 633 | lines, info->screen_base); | 619 | lines, info->screen_base); |
| 634 | } | 620 | } |
| 635 | #endif | ||
| 636 | 621 | ||
| 637 | return result; | 622 | return result; |
| 638 | } | 623 | } |
| @@ -644,14 +629,10 @@ static void dlfb_ops_copyarea(struct fb_info *info, | |||
| 644 | 629 | ||
| 645 | struct dlfb_data *dev = info->par; | 630 | struct dlfb_data *dev = info->par; |
| 646 | 631 | ||
| 647 | #if defined CONFIG_FB_SYS_COPYAREA || defined CONFIG_FB_SYS_COPYAREA_MODULE | ||
| 648 | |||
| 649 | sys_copyarea(info, area); | 632 | sys_copyarea(info, area); |
| 650 | 633 | ||
| 651 | dlfb_handle_damage(dev, area->dx, area->dy, | 634 | dlfb_handle_damage(dev, area->dx, area->dy, |
| 652 | area->width, area->height, info->screen_base); | 635 | area->width, area->height, info->screen_base); |
| 653 | #endif | ||
| 654 | |||
| 655 | } | 636 | } |
| 656 | 637 | ||
| 657 | static void dlfb_ops_imageblit(struct fb_info *info, | 638 | static void dlfb_ops_imageblit(struct fb_info *info, |
| @@ -659,15 +640,10 @@ static void dlfb_ops_imageblit(struct fb_info *info, | |||
| 659 | { | 640 | { |
| 660 | struct dlfb_data *dev = info->par; | 641 | struct dlfb_data *dev = info->par; |
| 661 | 642 | ||
| 662 | #if defined CONFIG_FB_SYS_IMAGEBLIT || defined CONFIG_FB_SYS_IMAGEBLIT_MODULE | ||
| 663 | |||
| 664 | sys_imageblit(info, image); | 643 | sys_imageblit(info, image); |
| 665 | 644 | ||
| 666 | dlfb_handle_damage(dev, image->dx, image->dy, | 645 | dlfb_handle_damage(dev, image->dx, image->dy, |
| 667 | image->width, image->height, info->screen_base); | 646 | image->width, image->height, info->screen_base); |
| 668 | |||
| 669 | #endif | ||
| 670 | |||
| 671 | } | 647 | } |
| 672 | 648 | ||
| 673 | static void dlfb_ops_fillrect(struct fb_info *info, | 649 | static void dlfb_ops_fillrect(struct fb_info *info, |
| @@ -675,17 +651,12 @@ static void dlfb_ops_fillrect(struct fb_info *info, | |||
| 675 | { | 651 | { |
| 676 | struct dlfb_data *dev = info->par; | 652 | struct dlfb_data *dev = info->par; |
| 677 | 653 | ||
| 678 | #if defined CONFIG_FB_SYS_FILLRECT || defined CONFIG_FB_SYS_FILLRECT_MODULE | ||
| 679 | |||
| 680 | sys_fillrect(info, rect); | 654 | sys_fillrect(info, rect); |
| 681 | 655 | ||
| 682 | dlfb_handle_damage(dev, rect->dx, rect->dy, rect->width, | 656 | dlfb_handle_damage(dev, rect->dx, rect->dy, rect->width, |
| 683 | rect->height, info->screen_base); | 657 | rect->height, info->screen_base); |
| 684 | #endif | ||
| 685 | |||
| 686 | } | 658 | } |
| 687 | 659 | ||
| 688 | #ifdef CONFIG_FB_DEFERRED_IO | ||
| 689 | /* | 660 | /* |
| 690 | * NOTE: fb_defio.c is holding info->fbdefio.mutex | 661 | * NOTE: fb_defio.c is holding info->fbdefio.mutex |
| 691 | * Touching ANY framebuffer memory that triggers a page fault | 662 | * Touching ANY framebuffer memory that triggers a page fault |
| @@ -747,8 +718,6 @@ error: | |||
| 747 | &dev->cpu_kcycles_used); | 718 | &dev->cpu_kcycles_used); |
| 748 | } | 719 | } |
| 749 | 720 | ||
| 750 | #endif | ||
| 751 | |||
| 752 | static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len) | 721 | static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len) |
| 753 | { | 722 | { |
| 754 | int i; | 723 | int i; |
| @@ -765,7 +734,7 @@ static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len) | |||
| 765 | (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2, | 734 | (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2, |
| 766 | HZ); | 735 | HZ); |
| 767 | if (ret < 1) { | 736 | if (ret < 1) { |
| 768 | dl_err("Read EDID byte %d failed err %x\n", i, ret); | 737 | pr_err("Read EDID byte %d failed err %x\n", i, ret); |
| 769 | i--; | 738 | i--; |
| 770 | break; | 739 | break; |
| 771 | } | 740 | } |
| @@ -881,7 +850,6 @@ static int dlfb_ops_open(struct fb_info *info, int user) | |||
| 881 | 850 | ||
| 882 | kref_get(&dev->kref); | 851 | kref_get(&dev->kref); |
| 883 | 852 | ||
| 884 | #ifdef CONFIG_FB_DEFERRED_IO | ||
| 885 | if (fb_defio && (info->fbdefio == NULL)) { | 853 | if (fb_defio && (info->fbdefio == NULL)) { |
| 886 | /* enable defio at last moment if not disabled by client */ | 854 | /* enable defio at last moment if not disabled by client */ |
| 887 | 855 | ||
| @@ -897,9 +865,8 @@ static int dlfb_ops_open(struct fb_info *info, int user) | |||
| 897 | info->fbdefio = fbdefio; | 865 | info->fbdefio = fbdefio; |
| 898 | fb_deferred_io_init(info); | 866 | fb_deferred_io_init(info); |
| 899 | } | 867 | } |
| 900 | #endif | ||
| 901 | 868 | ||
| 902 | dl_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n", | 869 | pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n", |
| 903 | info->node, user, info, dev->fb_count); | 870 | info->node, user, info, dev->fb_count); |
| 904 | 871 | ||
| 905 | return 0; | 872 | return 0; |
| @@ -923,7 +890,7 @@ static void dlfb_free(struct kref *kref) | |||
| 923 | 890 | ||
| 924 | kfree(dev->edid); | 891 | kfree(dev->edid); |
| 925 | 892 | ||
| 926 | dl_warn("freeing dlfb_data %p\n", dev); | 893 | pr_warn("freeing dlfb_data %p\n", dev); |
| 927 | 894 | ||
| 928 | kfree(dev); | 895 | kfree(dev); |
| 929 | } | 896 | } |
| @@ -959,7 +926,7 @@ static void dlfb_free_framebuffer_work(struct work_struct *work) | |||
| 959 | /* Assume info structure is freed after this point */ | 926 | /* Assume info structure is freed after this point */ |
| 960 | framebuffer_release(info); | 927 | framebuffer_release(info); |
| 961 | 928 | ||
| 962 | dl_warn("fb_info for /dev/fb%d has been freed\n", node); | 929 | pr_warn("fb_info for /dev/fb%d has been freed\n", node); |
| 963 | 930 | ||
| 964 | /* ref taken in probe() as part of registering framebfufer */ | 931 | /* ref taken in probe() as part of registering framebfufer */ |
| 965 | kref_put(&dev->kref, dlfb_free); | 932 | kref_put(&dev->kref, dlfb_free); |
| @@ -978,16 +945,14 @@ static int dlfb_ops_release(struct fb_info *info, int user) | |||
| 978 | if (dev->virtualized && (dev->fb_count == 0)) | 945 | if (dev->virtualized && (dev->fb_count == 0)) |
| 979 | schedule_delayed_work(&dev->free_framebuffer_work, HZ); | 946 | schedule_delayed_work(&dev->free_framebuffer_work, HZ); |
| 980 | 947 | ||
| 981 | #ifdef CONFIG_FB_DEFERRED_IO | ||
| 982 | if ((dev->fb_count == 0) && (info->fbdefio)) { | 948 | if ((dev->fb_count == 0) && (info->fbdefio)) { |
| 983 | fb_deferred_io_cleanup(info); | 949 | fb_deferred_io_cleanup(info); |
| 984 | kfree(info->fbdefio); | 950 | kfree(info->fbdefio); |
| 985 | info->fbdefio = NULL; | 951 | info->fbdefio = NULL; |
| 986 | info->fbops->fb_mmap = dlfb_ops_mmap; | 952 | info->fbops->fb_mmap = dlfb_ops_mmap; |
| 987 | } | 953 | } |
| 988 | #endif | ||
| 989 | 954 | ||
| 990 | dl_warn("released /dev/fb%d user=%d count=%d\n", | 955 | pr_warn("released /dev/fb%d user=%d count=%d\n", |
| 991 | info->node, user, dev->fb_count); | 956 | info->node, user, dev->fb_count); |
| 992 | 957 | ||
| 993 | kref_put(&dev->kref, dlfb_free); | 958 | kref_put(&dev->kref, dlfb_free); |
| @@ -1005,12 +970,12 @@ static int dlfb_is_valid_mode(struct fb_videomode *mode, | |||
| 1005 | struct dlfb_data *dev = info->par; | 970 | struct dlfb_data *dev = info->par; |
| 1006 | 971 | ||
| 1007 | if (mode->xres * mode->yres > dev->sku_pixel_limit) { | 972 | if (mode->xres * mode->yres > dev->sku_pixel_limit) { |
| 1008 | dl_warn("%dx%d beyond chip capabilities\n", | 973 | pr_warn("%dx%d beyond chip capabilities\n", |
| 1009 | mode->xres, mode->yres); | 974 | mode->xres, mode->yres); |
| 1010 | return 0; | 975 | return 0; |
| 1011 | } | 976 | } |
| 1012 | 977 | ||
| 1013 | dl_info("%dx%d valid mode\n", mode->xres, mode->yres); | 978 | pr_info("%dx%d valid mode\n", mode->xres, mode->yres); |
| 1014 | 979 | ||
| 1015 | return 1; | 980 | return 1; |
| 1016 | } | 981 | } |
| @@ -1054,7 +1019,7 @@ static int dlfb_ops_set_par(struct fb_info *info) | |||
| 1054 | u16 *pix_framebuffer; | 1019 | u16 *pix_framebuffer; |
| 1055 | int i; | 1020 | int i; |
| 1056 | 1021 | ||
| 1057 | dl_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres); | 1022 | pr_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres); |
| 1058 | 1023 | ||
| 1059 | result = dlfb_set_video_mode(dev, &info->var); | 1024 | result = dlfb_set_video_mode(dev, &info->var); |
| 1060 | 1025 | ||
| @@ -1104,7 +1069,7 @@ static int dlfb_ops_blank(int blank_mode, struct fb_info *info) | |||
| 1104 | 1069 | ||
| 1105 | static struct fb_ops dlfb_ops = { | 1070 | static struct fb_ops dlfb_ops = { |
| 1106 | .owner = THIS_MODULE, | 1071 | .owner = THIS_MODULE, |
| 1107 | .fb_read = dlfb_ops_read, | 1072 | .fb_read = fb_sys_read, |
| 1108 | .fb_write = dlfb_ops_write, | 1073 | .fb_write = dlfb_ops_write, |
| 1109 | .fb_setcolreg = dlfb_ops_setcolreg, | 1074 | .fb_setcolreg = dlfb_ops_setcolreg, |
| 1110 | .fb_fillrect = dlfb_ops_fillrect, | 1075 | .fb_fillrect = dlfb_ops_fillrect, |
| @@ -1133,7 +1098,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) | |||
| 1133 | unsigned char *new_fb; | 1098 | unsigned char *new_fb; |
| 1134 | unsigned char *new_back; | 1099 | unsigned char *new_back; |
| 1135 | 1100 | ||
| 1136 | dl_warn("Reallocating framebuffer. Addresses will change!\n"); | 1101 | pr_warn("Reallocating framebuffer. Addresses will change!\n"); |
| 1137 | 1102 | ||
| 1138 | new_len = info->fix.line_length * info->var.yres; | 1103 | new_len = info->fix.line_length * info->var.yres; |
| 1139 | 1104 | ||
| @@ -1143,7 +1108,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) | |||
| 1143 | */ | 1108 | */ |
| 1144 | new_fb = vmalloc(new_len); | 1109 | new_fb = vmalloc(new_len); |
| 1145 | if (!new_fb) { | 1110 | if (!new_fb) { |
| 1146 | dl_err("Virtual framebuffer alloc failed\n"); | 1111 | pr_err("Virtual framebuffer alloc failed\n"); |
| 1147 | goto error; | 1112 | goto error; |
| 1148 | } | 1113 | } |
| 1149 | 1114 | ||
| @@ -1165,7 +1130,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) | |||
| 1165 | */ | 1130 | */ |
| 1166 | new_back = vmalloc(new_len); | 1131 | new_back = vmalloc(new_len); |
| 1167 | if (!new_back) | 1132 | if (!new_back) |
| 1168 | dl_info("No shadow/backing buffer allcoated\n"); | 1133 | pr_info("No shadow/backing buffer allcoated\n"); |
| 1169 | else { | 1134 | else { |
| 1170 | if (dev->backing_buffer) | 1135 | if (dev->backing_buffer) |
| 1171 | vfree(dev->backing_buffer); | 1136 | vfree(dev->backing_buffer); |
| @@ -1207,7 +1172,7 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
| 1207 | if (info->dev) /* only use mutex if info has been registered */ | 1172 | if (info->dev) /* only use mutex if info has been registered */ |
| 1208 | mutex_lock(&info->lock); | 1173 | mutex_lock(&info->lock); |
| 1209 | 1174 | ||
| 1210 | edid = kmalloc(MAX_EDID_SIZE, GFP_KERNEL); | 1175 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); |
| 1211 | if (!edid) { | 1176 | if (!edid) { |
| 1212 | result = -ENOMEM; | 1177 | result = -ENOMEM; |
| 1213 | goto error; | 1178 | goto error; |
| @@ -1223,9 +1188,9 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
| 1223 | */ | 1188 | */ |
| 1224 | while (tries--) { | 1189 | while (tries--) { |
| 1225 | 1190 | ||
| 1226 | i = dlfb_get_edid(dev, edid, MAX_EDID_SIZE); | 1191 | i = dlfb_get_edid(dev, edid, EDID_LENGTH); |
| 1227 | 1192 | ||
| 1228 | if (i >= MIN_EDID_SIZE) | 1193 | if (i >= EDID_LENGTH) |
| 1229 | fb_edid_to_monspecs(edid, &info->monspecs); | 1194 | fb_edid_to_monspecs(edid, &info->monspecs); |
| 1230 | 1195 | ||
| 1231 | if (info->monspecs.modedb_len > 0) { | 1196 | if (info->monspecs.modedb_len > 0) { |
| @@ -1238,24 +1203,24 @@ static int dlfb_setup_modes(struct dlfb_data *dev, | |||
| 1238 | /* If that fails, use a previously returned EDID if available */ | 1203 | /* If that fails, use a previously returned EDID if available */ |
| 1239 | if (info->monspecs.modedb_len == 0) { | 1204 | if (info->monspecs.modedb_len == 0) { |
| 1240 | 1205 | ||
| 1241 | dl_err("Unable to get valid EDID from device/display\n"); | 1206 | pr_err("Unable to get valid EDID from device/display\n"); |
| 1242 | 1207 | ||
| 1243 | if (dev->edid) { | 1208 | if (dev->edid) { |
| 1244 | fb_edid_to_monspecs(dev->edid, &info->monspecs); | 1209 | fb_edid_to_monspecs(dev->edid, &info->monspecs); |
| 1245 | if (info->monspecs.modedb_len > 0) | 1210 | if (info->monspecs.modedb_len > 0) |
| 1246 | dl_err("Using previously queried EDID\n"); | 1211 | pr_err("Using previously queried EDID\n"); |
| 1247 | } | 1212 | } |
| 1248 | } | 1213 | } |
| 1249 | 1214 | ||
| 1250 | /* If that fails, use the default EDID we were handed */ | 1215 | /* If that fails, use the default EDID we were handed */ |
| 1251 | if (info->monspecs.modedb_len == 0) { | 1216 | if (info->monspecs.modedb_len == 0) { |
| 1252 | if (default_edid_size >= MIN_EDID_SIZE) { | 1217 | if (default_edid_size >= EDID_LENGTH) { |
| 1253 | fb_edid_to_monspecs(default_edid, &info->monspecs); | 1218 | fb_edid_to_monspecs(default_edid, &info->monspecs); |
| 1254 | if (info->monspecs.modedb_len > 0) { | 1219 | if (info->monspecs.modedb_len > 0) { |
| 1255 | memcpy(edid, default_edid, default_edid_size); | 1220 | memcpy(edid, default_edid, default_edid_size); |
| 1256 | dev->edid = edid; | 1221 | dev->edid = edid; |
| 1257 | dev->edid_size = default_edid_size; | 1222 | dev->edid_size = default_edid_size; |
| 1258 | dl_err("Using default/backup EDID\n"); | 1223 | pr_err("Using default/backup EDID\n"); |
| 1259 | } | 1224 | } |
| 1260 | } | 1225 | } |
| 1261 | } | 1226 | } |
| @@ -1381,7 +1346,7 @@ static ssize_t edid_show( | |||
| 1381 | if (off + count > dev->edid_size) | 1346 | if (off + count > dev->edid_size) |
| 1382 | count = dev->edid_size - off; | 1347 | count = dev->edid_size - off; |
| 1383 | 1348 | ||
| 1384 | dl_info("sysfs edid copy %p to %p, %d bytes\n", | 1349 | pr_info("sysfs edid copy %p to %p, %d bytes\n", |
| 1385 | dev->edid, buf, (int) count); | 1350 | dev->edid, buf, (int) count); |
| 1386 | 1351 | ||
| 1387 | memcpy(buf, dev->edid, count); | 1352 | memcpy(buf, dev->edid, count); |
| @@ -1398,15 +1363,13 @@ static ssize_t edid_store( | |||
| 1398 | struct dlfb_data *dev = fb_info->par; | 1363 | struct dlfb_data *dev = fb_info->par; |
| 1399 | 1364 | ||
| 1400 | /* We only support write of entire EDID at once, no offset*/ | 1365 | /* We only support write of entire EDID at once, no offset*/ |
| 1401 | if ((src_size < MIN_EDID_SIZE) || | 1366 | if ((src_size != EDID_LENGTH) || (src_off != 0)) |
| 1402 | (src_size > MAX_EDID_SIZE) || | ||
| 1403 | (src_off != 0)) | ||
| 1404 | return 0; | 1367 | return 0; |
| 1405 | 1368 | ||
| 1406 | dlfb_setup_modes(dev, fb_info, src, src_size); | 1369 | dlfb_setup_modes(dev, fb_info, src, src_size); |
| 1407 | 1370 | ||
| 1408 | if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) { | 1371 | if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) { |
| 1409 | dl_info("sysfs written EDID is new default\n"); | 1372 | pr_info("sysfs written EDID is new default\n"); |
| 1410 | dlfb_ops_set_par(fb_info); | 1373 | dlfb_ops_set_par(fb_info); |
| 1411 | return src_size; | 1374 | return src_size; |
| 1412 | } else | 1375 | } else |
| @@ -1431,7 +1394,7 @@ static ssize_t metrics_reset_store(struct device *fbdev, | |||
| 1431 | static struct bin_attribute edid_attr = { | 1394 | static struct bin_attribute edid_attr = { |
| 1432 | .attr.name = "edid", | 1395 | .attr.name = "edid", |
| 1433 | .attr.mode = 0666, | 1396 | .attr.mode = 0666, |
| 1434 | .size = MAX_EDID_SIZE, | 1397 | .size = EDID_LENGTH, |
| 1435 | .read = edid_show, | 1398 | .read = edid_show, |
| 1436 | .write = edid_store | 1399 | .write = edid_store |
| 1437 | }; | 1400 | }; |
| @@ -1479,7 +1442,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, | |||
| 1479 | total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */ | 1442 | total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */ |
| 1480 | 0, desc, MAX_VENDOR_DESCRIPTOR_SIZE); | 1443 | 0, desc, MAX_VENDOR_DESCRIPTOR_SIZE); |
| 1481 | if (total_len > 5) { | 1444 | if (total_len > 5) { |
| 1482 | dl_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \ | 1445 | pr_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \ |
| 1483 | "%02x %02x %02x %02x %02x %02x %02x\n", | 1446 | "%02x %02x %02x %02x %02x %02x %02x\n", |
| 1484 | total_len, desc[0], | 1447 | total_len, desc[0], |
| 1485 | desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], | 1448 | desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], |
| @@ -1508,7 +1471,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, | |||
| 1508 | case 0x0200: { /* max_area */ | 1471 | case 0x0200: { /* max_area */ |
| 1509 | u32 max_area; | 1472 | u32 max_area; |
| 1510 | max_area = le32_to_cpu(*((u32 *)desc)); | 1473 | max_area = le32_to_cpu(*((u32 *)desc)); |
| 1511 | dl_warn("DL chip limited to %d pixel modes\n", | 1474 | pr_warn("DL chip limited to %d pixel modes\n", |
| 1512 | max_area); | 1475 | max_area); |
| 1513 | dev->sku_pixel_limit = max_area; | 1476 | dev->sku_pixel_limit = max_area; |
| 1514 | break; | 1477 | break; |
| @@ -1524,7 +1487,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, | |||
| 1524 | 1487 | ||
| 1525 | unrecognized: | 1488 | unrecognized: |
| 1526 | /* allow udlfb to load for now even if firmware unrecognized */ | 1489 | /* allow udlfb to load for now even if firmware unrecognized */ |
| 1527 | dl_err("Unrecognized vendor firmware descriptor\n"); | 1490 | pr_err("Unrecognized vendor firmware descriptor\n"); |
| 1528 | 1491 | ||
| 1529 | success: | 1492 | success: |
| 1530 | kfree(buf); | 1493 | kfree(buf); |
| @@ -1557,24 +1520,24 @@ static int dlfb_usb_probe(struct usb_interface *interface, | |||
| 1557 | dev->gdev = &usbdev->dev; /* our generic struct device * */ | 1520 | dev->gdev = &usbdev->dev; /* our generic struct device * */ |
| 1558 | usb_set_intfdata(interface, dev); | 1521 | usb_set_intfdata(interface, dev); |
| 1559 | 1522 | ||
| 1560 | dl_info("%s %s - serial #%s\n", | 1523 | pr_info("%s %s - serial #%s\n", |
| 1561 | usbdev->manufacturer, usbdev->product, usbdev->serial); | 1524 | usbdev->manufacturer, usbdev->product, usbdev->serial); |
| 1562 | dl_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n", | 1525 | pr_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n", |
| 1563 | usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, | 1526 | usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, |
| 1564 | usbdev->descriptor.bcdDevice, dev); | 1527 | usbdev->descriptor.bcdDevice, dev); |
| 1565 | dl_info("console enable=%d\n", console); | 1528 | pr_info("console enable=%d\n", console); |
| 1566 | dl_info("fb_defio enable=%d\n", fb_defio); | 1529 | pr_info("fb_defio enable=%d\n", fb_defio); |
| 1567 | 1530 | ||
| 1568 | dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */ | 1531 | dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */ |
| 1569 | 1532 | ||
| 1570 | if (!dlfb_parse_vendor_descriptor(dev, usbdev)) { | 1533 | if (!dlfb_parse_vendor_descriptor(dev, usbdev)) { |
| 1571 | dl_err("firmware not recognized. Assume incompatible device\n"); | 1534 | pr_err("firmware not recognized. Assume incompatible device\n"); |
| 1572 | goto error; | 1535 | goto error; |
| 1573 | } | 1536 | } |
| 1574 | 1537 | ||
| 1575 | if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) { | 1538 | if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) { |
| 1576 | retval = -ENOMEM; | 1539 | retval = -ENOMEM; |
| 1577 | dl_err("dlfb_alloc_urb_list failed\n"); | 1540 | pr_err("dlfb_alloc_urb_list failed\n"); |
| 1578 | goto error; | 1541 | goto error; |
| 1579 | } | 1542 | } |
| 1580 | 1543 | ||
| @@ -1584,7 +1547,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, | |||
| 1584 | info = framebuffer_alloc(0, &usbdev->dev); | 1547 | info = framebuffer_alloc(0, &usbdev->dev); |
| 1585 | if (!info) { | 1548 | if (!info) { |
| 1586 | retval = -ENOMEM; | 1549 | retval = -ENOMEM; |
| 1587 | dl_err("framebuffer_alloc failed\n"); | 1550 | pr_err("framebuffer_alloc failed\n"); |
| 1588 | goto error; | 1551 | goto error; |
| 1589 | } | 1552 | } |
| 1590 | 1553 | ||
| @@ -1595,7 +1558,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, | |||
| 1595 | 1558 | ||
| 1596 | retval = fb_alloc_cmap(&info->cmap, 256, 0); | 1559 | retval = fb_alloc_cmap(&info->cmap, 256, 0); |
| 1597 | if (retval < 0) { | 1560 | if (retval < 0) { |
| 1598 | dl_err("fb_alloc_cmap failed %x\n", retval); | 1561 | pr_err("fb_alloc_cmap failed %x\n", retval); |
| 1599 | goto error; | 1562 | goto error; |
| 1600 | } | 1563 | } |
| 1601 | 1564 | ||
| @@ -1606,7 +1569,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, | |||
| 1606 | 1569 | ||
| 1607 | retval = dlfb_setup_modes(dev, info, NULL, 0); | 1570 | retval = dlfb_setup_modes(dev, info, NULL, 0); |
| 1608 | if (retval != 0) { | 1571 | if (retval != 0) { |
| 1609 | dl_err("unable to find common mode for display and adapter\n"); | 1572 | pr_err("unable to find common mode for display and adapter\n"); |
| 1610 | goto error; | 1573 | goto error; |
| 1611 | } | 1574 | } |
| 1612 | 1575 | ||
| @@ -1620,7 +1583,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, | |||
| 1620 | 1583 | ||
| 1621 | retval = register_framebuffer(info); | 1584 | retval = register_framebuffer(info); |
| 1622 | if (retval < 0) { | 1585 | if (retval < 0) { |
| 1623 | dl_err("register_framebuffer failed %d\n", retval); | 1586 | pr_err("register_framebuffer failed %d\n", retval); |
| 1624 | goto error; | 1587 | goto error; |
| 1625 | } | 1588 | } |
| 1626 | 1589 | ||
| @@ -1629,7 +1592,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, | |||
| 1629 | 1592 | ||
| 1630 | device_create_bin_file(info->dev, &edid_attr); | 1593 | device_create_bin_file(info->dev, &edid_attr); |
| 1631 | 1594 | ||
| 1632 | dl_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution." | 1595 | pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution." |
| 1633 | " Using %dK framebuffer memory\n", info->node, | 1596 | " Using %dK framebuffer memory\n", info->node, |
| 1634 | info->var.xres, info->var.yres, | 1597 | info->var.xres, info->var.yres, |
| 1635 | ((dev->backing_buffer) ? | 1598 | ((dev->backing_buffer) ? |
| @@ -1673,7 +1636,7 @@ static void dlfb_usb_disconnect(struct usb_interface *interface) | |||
| 1673 | dev = usb_get_intfdata(interface); | 1636 | dev = usb_get_intfdata(interface); |
| 1674 | info = dev->info; | 1637 | info = dev->info; |
| 1675 | 1638 | ||
| 1676 | dl_info("USB disconnect starting\n"); | 1639 | pr_info("USB disconnect starting\n"); |
| 1677 | 1640 | ||
| 1678 | /* we virtualize until all fb clients release. Then we free */ | 1641 | /* we virtualize until all fb clients release. Then we free */ |
| 1679 | dev->virtualized = true; | 1642 | dev->virtualized = true; |
| @@ -1737,7 +1700,7 @@ static void dlfb_urb_completion(struct urb *urb) | |||
| 1737 | if (!(urb->status == -ENOENT || | 1700 | if (!(urb->status == -ENOENT || |
| 1738 | urb->status == -ECONNRESET || | 1701 | urb->status == -ECONNRESET || |
| 1739 | urb->status == -ESHUTDOWN)) { | 1702 | urb->status == -ESHUTDOWN)) { |
| 1740 | dl_err("%s - nonzero write bulk status received: %d\n", | 1703 | pr_err("%s - nonzero write bulk status received: %d\n", |
| 1741 | __func__, urb->status); | 1704 | __func__, urb->status); |
| 1742 | atomic_set(&dev->lost_pixels, 1); | 1705 | atomic_set(&dev->lost_pixels, 1); |
| 1743 | } | 1706 | } |
| @@ -1769,7 +1732,7 @@ static void dlfb_free_urb_list(struct dlfb_data *dev) | |||
| 1769 | int ret; | 1732 | int ret; |
| 1770 | unsigned long flags; | 1733 | unsigned long flags; |
| 1771 | 1734 | ||
| 1772 | dl_notice("Waiting for completes and freeing all render urbs\n"); | 1735 | pr_notice("Waiting for completes and freeing all render urbs\n"); |
| 1773 | 1736 | ||
| 1774 | /* keep waiting and freeing, until we've got 'em all */ | 1737 | /* keep waiting and freeing, until we've got 'em all */ |
| 1775 | while (count--) { | 1738 | while (count--) { |
| @@ -1848,7 +1811,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size) | |||
| 1848 | dev->urbs.count = i; | 1811 | dev->urbs.count = i; |
| 1849 | dev->urbs.available = i; | 1812 | dev->urbs.available = i; |
| 1850 | 1813 | ||
| 1851 | dl_notice("allocated %d %d byte urbs\n", i, (int) size); | 1814 | pr_notice("allocated %d %d byte urbs\n", i, (int) size); |
| 1852 | 1815 | ||
| 1853 | return i; | 1816 | return i; |
| 1854 | } | 1817 | } |
| @@ -1865,7 +1828,7 @@ static struct urb *dlfb_get_urb(struct dlfb_data *dev) | |||
| 1865 | ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT); | 1828 | ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT); |
| 1866 | if (ret) { | 1829 | if (ret) { |
| 1867 | atomic_set(&dev->lost_pixels, 1); | 1830 | atomic_set(&dev->lost_pixels, 1); |
| 1868 | dl_warn("wait for urb interrupted: %x available: %d\n", | 1831 | pr_warn("wait for urb interrupted: %x available: %d\n", |
| 1869 | ret, dev->urbs.available); | 1832 | ret, dev->urbs.available); |
| 1870 | goto error; | 1833 | goto error; |
| 1871 | } | 1834 | } |
| @@ -1897,7 +1860,7 @@ static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len) | |||
| 1897 | if (ret) { | 1860 | if (ret) { |
| 1898 | dlfb_urb_completion(urb); /* because no one else will */ | 1861 | dlfb_urb_completion(urb); /* because no one else will */ |
| 1899 | atomic_set(&dev->lost_pixels, 1); | 1862 | atomic_set(&dev->lost_pixels, 1); |
| 1900 | dl_err("usb_submit_urb error %x\n", ret); | 1863 | pr_err("usb_submit_urb error %x\n", ret); |
| 1901 | } | 1864 | } |
| 1902 | return ret; | 1865 | return ret; |
| 1903 | } | 1866 | } |
