Commit d3189545 authored by Stuart Hopkins's avatar Stuart Hopkins Committed by Florian Tobias Schandinat

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: default avatarStuart Hopkins <stuart@linux-depot.com>
Signed-off-by: default avatarBernie Thompson <bernie@plugable.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent def76608
...@@ -105,6 +105,11 @@ console Allow fbcon to attach to udlfb provided framebuffers. This ...@@ -105,6 +105,11 @@ console Allow fbcon to attach to udlfb provided framebuffers. This
the first framebuffer it finds, which isn't usually what the the first framebuffer it finds, which isn't usually what the
user wants in the case of USB displays. user wants in the case of USB displays.
shadow Allocate a 2nd framebuffer to shadow what's currently across
the USB bus in device memory. If any pixels are unchanged,
do not transmit. Spends host memory to save USB transfers.
Enabled by default. Only disable on very low memory systems.
Sysfs Attributes Sysfs Attributes
================ ================
......
...@@ -62,6 +62,7 @@ MODULE_DEVICE_TABLE(usb, id_table); ...@@ -62,6 +62,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
/* module options */ /* module options */
static int console; /* Optionally allow fbcon to consume first framebuffer */ static int console; /* Optionally allow fbcon to consume first framebuffer */
static int fb_defio; /* Optionally enable experimental fb_defio mmap support */ static int fb_defio; /* Optionally enable experimental fb_defio mmap support */
static int shadow = 1; /* Optionally disable shadow framebuffer */
/* dlfb keeps a list of urbs for efficient bulk transfers */ /* dlfb keeps a list of urbs for efficient bulk transfers */
static void dlfb_urb_completion(struct urb *urb); static 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,7 +1149,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
int new_len; int new_len;
unsigned char *old_fb = info->screen_base; unsigned char *old_fb = info->screen_base;
unsigned char *new_fb; unsigned char *new_fb;
unsigned char *new_back; unsigned char *new_back = 0;
pr_warn("Reallocating framebuffer. Addresses will change!\n"); pr_warn("Reallocating framebuffer. Addresses will change!\n");
...@@ -1180,7 +1181,8 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) ...@@ -1180,7 +1181,8 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
* But with imperfect damage info we may send pixels over USB * But with imperfect damage info we may send pixels over USB
* that were, in fact, unchanged - wasting limited USB bandwidth * that were, in fact, unchanged - wasting limited USB bandwidth
*/ */
new_back = vzalloc(new_len); if (shadow)
new_back = vzalloc(new_len);
if (!new_back) if (!new_back)
pr_info("No shadow/backing buffer allocated\n"); pr_info("No shadow/backing buffer allocated\n");
else { else {
...@@ -1593,6 +1595,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1593,6 +1595,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
usbdev->descriptor.bcdDevice, dev); usbdev->descriptor.bcdDevice, dev);
pr_info("console enable=%d\n", console); pr_info("console enable=%d\n", console);
pr_info("fb_defio enable=%d\n", fb_defio); pr_info("fb_defio enable=%d\n", fb_defio);
pr_info("shadow enable=%d\n", shadow);
dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */ dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */
...@@ -1950,6 +1953,9 @@ MODULE_PARM_DESC(console, "Allow fbcon to consume first framebuffer found"); ...@@ -1950,6 +1953,9 @@ MODULE_PARM_DESC(console, "Allow fbcon to consume first framebuffer found");
module_param(fb_defio, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); module_param(fb_defio, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
MODULE_PARM_DESC(fb_defio, "Enable fb_defio mmap support. *Experimental*"); MODULE_PARM_DESC(fb_defio, "Enable fb_defio mmap support. *Experimental*");
module_param(shadow, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
MODULE_PARM_DESC(shadow, "Shadow vid mem. Disable to save mem but lose perf");
MODULE_AUTHOR("Roberto De Ioris <roberto@unbit.it>, " MODULE_AUTHOR("Roberto De Ioris <roberto@unbit.it>, "
"Jaya Kumar <jayakumar.lkml@gmail.com>, " "Jaya Kumar <jayakumar.lkml@gmail.com>, "
"Bernie Thompson <bernie@plugable.com>"); "Bernie Thompson <bernie@plugable.com>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment