aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Hopkins <stuart@linux-depot.com>2011-08-21 16:34:17 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-08-24 06:10:44 -0400
commitd3189545ee69527e949769b89a4cbb331de97b4a (patch)
tree170eff40bdf5c47cc4c35c13f1c927a952f32783
parentdef76608681983c1fe70c0fa780d8fe777442ef5 (diff)
udlfb: Add module option to do without shadow framebuffer
By default, udlfb allocates a 2nd buffer to shadow what's across the bus on the USB device. It can operate without this shadow, but then it cannot tell which pixels have changed, and must send all. Saves host memory, but worsens the USB 2.0 bus bottleneck. This option allows users in very low memory situations (e.g. bifferboard) to optionally turn off this shadow framebuffer. Signed-off-by: Stuart Hopkins <stuart@linux-depot.com> Signed-off-by: Bernie Thompson <bernie@plugable.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r--Documentation/fb/udlfb.txt5
-rw-r--r--drivers/video/udlfb.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt
index 7fdde2a02a2..473ceed9e4e 100644
--- a/Documentation/fb/udlfb.txt
+++ b/Documentation/fb/udlfb.txt
@@ -105,6 +105,11 @@ console Allow fbcon to attach to udlfb provided framebuffers. This
105 the first framebuffer it finds, which isn't usually what the 105 the first framebuffer it finds, which isn't usually what the
106 user wants in the case of USB displays. 106 user wants in the case of USB displays.
107 107
108shadow Allocate a 2nd framebuffer to shadow what's currently across
109 the USB bus in device memory. If any pixels are unchanged,
110 do not transmit. Spends host memory to save USB transfers.
111 Enabled by default. Only disable on very low memory systems.
112
108Sysfs Attributes 113Sysfs Attributes
109================ 114================
110 115
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 37498abcd91..2341b275e81 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -62,6 +62,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
62/* module options */ 62/* module options */
63static int console; /* Optionally allow fbcon to consume first framebuffer */ 63static int console; /* Optionally allow fbcon to consume first framebuffer */
64static int fb_defio; /* Optionally enable experimental fb_defio mmap support */ 64static int fb_defio; /* Optionally enable experimental fb_defio mmap support */
65static int shadow = 1; /* Optionally disable shadow framebuffer */
65 66
66/* dlfb keeps a list of urbs for efficient bulk transfers */ 67/* dlfb keeps a list of urbs for efficient bulk transfers */
67static void dlfb_urb_completion(struct urb *urb); 68static void dlfb_urb_completion(struct urb *urb);
@@ -1148,7 +1149,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
1148 int new_len; 1149 int new_len;
1149 unsigned char *old_fb = info->screen_base; 1150 unsigned char *old_fb = info->screen_base;
1150 unsigned char *new_fb; 1151 unsigned char *new_fb;
1151 unsigned char *new_back; 1152 unsigned char *new_back = 0;
1152 1153
1153 pr_warn("Reallocating framebuffer. Addresses will change!\n"); 1154 pr_warn("Reallocating framebuffer. Addresses will change!\n");
1154 1155
@@ -1180,7 +1181,8 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
1180 * But with imperfect damage info we may send pixels over USB 1181 * But with imperfect damage info we may send pixels over USB
1181 * that were, in fact, unchanged - wasting limited USB bandwidth 1182 * that were, in fact, unchanged - wasting limited USB bandwidth
1182 */ 1183 */
1183 new_back = vzalloc(new_len); 1184 if (shadow)
1185 new_back = vzalloc(new_len);
1184 if (!new_back) 1186 if (!new_back)
1185 pr_info("No shadow/backing buffer allocated\n"); 1187 pr_info("No shadow/backing buffer allocated\n");
1186 else { 1188 else {
@@ -1593,6 +1595,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
1593 usbdev->descriptor.bcdDevice, dev); 1595 usbdev->descriptor.bcdDevice, dev);
1594 pr_info("console enable=%d\n", console); 1596 pr_info("console enable=%d\n", console);
1595 pr_info("fb_defio enable=%d\n", fb_defio); 1597 pr_info("fb_defio enable=%d\n", fb_defio);
1598 pr_info("shadow enable=%d\n", shadow);
1596 1599
1597 dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */ 1600 dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */
1598 1601
@@ -1950,6 +1953,9 @@ MODULE_PARM_DESC(console, "Allow fbcon to consume first framebuffer found");
1950module_param(fb_defio, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); 1953module_param(fb_defio, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
1951MODULE_PARM_DESC(fb_defio, "Enable fb_defio mmap support. *Experimental*"); 1954MODULE_PARM_DESC(fb_defio, "Enable fb_defio mmap support. *Experimental*");
1952 1955
1956module_param(shadow, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
1957MODULE_PARM_DESC(shadow, "Shadow vid mem. Disable to save mem but lose perf");
1958
1953MODULE_AUTHOR("Roberto De Ioris <roberto@unbit.it>, " 1959MODULE_AUTHOR("Roberto De Ioris <roberto@unbit.it>, "
1954 "Jaya Kumar <jayakumar.lkml@gmail.com>, " 1960 "Jaya Kumar <jayakumar.lkml@gmail.com>, "
1955 "Bernie Thompson <bernie@plugable.com>"); 1961 "Bernie Thompson <bernie@plugable.com>");