From d3189545ee69527e949769b89a4cbb331de97b4a Mon Sep 17 00:00:00 2001 From: Stuart Hopkins Date: Sun, 21 Aug 2011 13:34:17 -0700 Subject: 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 Signed-off-by: Bernie Thompson Signed-off-by: Florian Tobias Schandinat --- Documentation/fb/udlfb.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation') diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt index 7fdde2a02a27..473ceed9e4eb 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 the first framebuffer it finds, which isn't usually what the 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 ================ -- cgit v1.2.3-59-g8ed1b From 9f811b72c669e29f8c01e258d912254065e58f11 Mon Sep 17 00:00:00 2001 From: Bernie Thompson Date: Sun, 21 Aug 2011 13:35:38 -0700 Subject: udlfb: Enable fb_defio by default Enables page fault based detection of mmap writes to the framebuffer, which allows standard fbdev apps (like the generic fbdev xorg driver) to work on DisplayLink devices. Not all bugs are shaken out of the fb_defio path of udlfb, but it's tantalizingly close, so this seems a good time to enable by default. Alternatively, option can be disabled when running with an xorg driver that can more directly communicate damaged regions of the framebuffer via IOCTL. This is a simpler, higher perf option, when available. Signed-off-by: Bernie Thompson Signed-off-by: Florian Tobias Schandinat --- Documentation/fb/udlfb.txt | 24 ++++++++++++++++-------- drivers/video/udlfb.c | 4 ++-- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'Documentation') diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt index 473ceed9e4eb..c6d90a6fb901 100644 --- a/Documentation/fb/udlfb.txt +++ b/Documentation/fb/udlfb.txt @@ -87,20 +87,28 @@ Special configuration for udlfb is usually unnecessary. There are a few options, however. From the command line, pass options to modprobe -modprobe udlfb defio=1 console=1 +modprobe udlfb fb_defio=0 console=1 shadow=1 -Or for permanent option, create file like /etc/modprobe.d/options with text -options udlfb defio=1 console=1 +Or modify options on the fly at /sys/module/udlfb/parameters directory via +sudo nano fb_defio +change the parameter in place, and save the file. -Accepted options: +Unplug/replug USB device to apply with new settings + +Or for permanent option, create file like /etc/modprobe.d/udlfb.conf with text +options udlfb fb_defio=0 console=1 shadow=1 + +Accepted boolean options: fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel module to track changed areas of the framebuffer by page faults. - Standard fbdev applications that use mmap but that do not - report damage, may be able to work with this enabled. - Disabled by default because of overhead and other issues. + Standard fbdev applications that use mmap but that do not + report damage, should be able to work with this enabled. + Disable when running with X server that supports reporting + changed regions via ioctl, as this method is simpler, + more stable, and higher performance. -console Allow fbcon to attach to udlfb provided framebuffers. This +console Allow fbcon to attach to udlfb provided framebuffers. This is disabled by default because fbcon will aggressively consume the first framebuffer it finds, which isn't usually what the user wants in the case of USB displays. diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 2341b275e815..2b694e1c73cb 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -61,7 +61,7 @@ MODULE_DEVICE_TABLE(usb, id_table); /* module options */ 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 = 1; /* Detect mmap writes using page faults */ static int shadow = 1; /* Optionally disable shadow framebuffer */ /* dlfb keeps a list of urbs for efficient bulk transfers */ @@ -1951,7 +1951,7 @@ module_param(console, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); 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_PARM_DESC(fb_defio, "Enable fb_defio mmap support. *Experimental*"); +MODULE_PARM_DESC(fb_defio, "Page fault detection of mmap writes"); 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"); -- cgit v1.2.3-59-g8ed1b From 4aa7faffe44bda5db54c214f5b3f789ec805cb9b Mon Sep 17 00:00:00 2001 From: Bernie Thompson Date: Sun, 21 Aug 2011 13:35:39 -0700 Subject: udlfb: Enable fbcon access to framebuffer by default Signed-off-by: Bernie Thompson Signed-off-by: Florian Tobias Schandinat --- Documentation/fb/udlfb.txt | 10 ++++++---- drivers/video/udlfb.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt index c6d90a6fb901..57d2f2908b12 100644 --- a/Documentation/fb/udlfb.txt +++ b/Documentation/fb/udlfb.txt @@ -107,16 +107,18 @@ fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel Disable when running with X server that supports reporting changed regions via ioctl, as this method is simpler, more stable, and higher performance. + default: fb_defio=1 -console Allow fbcon to attach to udlfb provided framebuffers. This - is disabled by default because fbcon will aggressively consume - the first framebuffer it finds, which isn't usually what the - user wants in the case of USB displays. +console Allow fbcon to attach to udlfb provided framebuffers. + Can be disabled if fbcon and other clients + (e.g. X with --shared-vt) are in conflict. + default: console=1 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. + default: shadow=1 Sysfs Attributes ================ diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 2b694e1c73cb..101846c2084a 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -60,7 +60,7 @@ static struct usb_device_id id_table[] = { MODULE_DEVICE_TABLE(usb, id_table); /* module options */ -static int console; /* Optionally allow fbcon to consume first framebuffer */ +static int console = 1; /* Allow fbcon to open framebuffer */ static int fb_defio = 1; /* Detect mmap writes using page faults */ static int shadow = 1; /* Optionally disable shadow framebuffer */ @@ -1948,7 +1948,7 @@ static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len) } module_param(console, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); -MODULE_PARM_DESC(console, "Allow fbcon to consume first framebuffer found"); +MODULE_PARM_DESC(console, "Allow fbcon to open framebuffer"); module_param(fb_defio, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); MODULE_PARM_DESC(fb_defio, "Page fault detection of mmap writes"); -- cgit v1.2.3-59-g8ed1b