Skip to content
This repository

Add udlfb for displaylink screens #141

Open
pssc opened this Issue · 13 comments

5 participants

Phill (pssc) popcornmix George Galt jwilker2 philharlow
Phill (pssc)

A number of people seem to have had luck with display-link touch screens the currently involves replacing the whole kernel.

--- - 2013-01-29 10:30:20.596892704 +0000
+++ .config 2013-01-28 12:44:18.088627426 +0000
@@ -2227,16 +2227,17 @@
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
-# CONFIG_FB_SYS_FILLRECT is not set
-# CONFIG_FB_SYS_COPYAREA is not set
-# CONFIG_FB_SYS_IMAGEBLIT is not set
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
-# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_SYS_FOPS=m
# CONFIG_FB_WMT_GE_ROPS is not set
+CONFIG_FB_DEFERRED_IO=y
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
-# CONFIG_FB_MODE_HELPERS is not set
+CONFIG_FB_MODE_HELPERS=y
# CONFIG_FB_TILEBLITTING is not set

#
@@ -2247,7 +2248,7 @@
# CONFIG_FB_UVESA is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_SMSCUFX is not set
-# CONFIG_FB_UDL is not set
+CONFIG_FB_UDL=m
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_BROADSHEET is not set

popcornmix
Owner

I'm a little concerned that this could have a performance impact on non-displaylink framebuffer users.
Particularly CONFIG_FB_DEFERRED_IO.

Phill (pssc)

looking at Documentation/fb/deferred_io.txt and the uldfb code it will only be used if supported by the particular framebuffer as support has to be explicitly enabled with the driver

iinfo->fbdefio = &hecubafb_defio; (handler function for fb defio in driver)
fb_deferred_io_init(info);

In the case of udlfb it can also be turned off via an option as well as some auto detection for clients that support damage detection(X?).

A further look in drivers/video/fb_defio.c and fb_deferred_io_init + associated functions looks like it should have little or no overhead on fb in general that don’t support it.

Phill

Phill (pssc)

I have run up the app(squeezeplay) using its graphic tests (sdl based) I have been using on the standard fb console fps and cpu load tests remain the same.

Phill.

Phill (pssc)

Anything else I can to do move this along?

popcornmix
Owner

I was a bit concerned by this:

int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
    struct fb_info *info = file->private_data;
    struct inode *inode = file->f_path.dentry->d_inode;
    int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
    if (err)
        return err;

    /* Skip if deferred io is compiled-in but disabled on this fbdev */
    if (!info->fbdefio)
        return 0;

Looks like filemap_write_and_wait_range will get called if CONFIG_DEFERRED_IO is enabled in kernel, even if current fb driver is disbled.

I think I need more convincing this change is harmless, and more evidence that there is demand for this before forcing it on everyone.

Phill (pssc)

Ok I understand the caution here,

Its that just implementing normal fsync behavior for a char dev flushing all data to the file/device looks like its a copy of fs/libfs.c generic_file_fsync with the if statement in the wrong place for detecting if its needed for the fb to me...

Most small compact screens seem to come as usb ones these days and they tend to come with a touch screen to boot so its ideal for interfacing with a device like the pi either for one off configuration or as some sort of embed application and they have a very low bar compared with other LCD touch screen interfacing options that don’t use the hdmi. ie I can buy it off amazon and plug it in...

http://www.amazon.co.uk/Mimo-UM-720S-USB-Powered-Monitor-Screen/dp/B002U0K7H/ref=sr_1_1?s=electronics&ie=UTF8&qid=1359735631&sr=1-1

George Galt

I too am interested in getting support for DisplayLink USB monitors with RaspberryPi. Is there anything I can do to help test that there will be no performance hit if udlfb is enabled by default?

Thanks.

Phill (pssc)

Ok,

I have applied the following to fix and enable the usb touch screen I have. It now works in the SDL and x ok for the past week or so and fixes the performance issues. In addition to the initial kernel config option.

diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c
index 64cda56..957c71d 100644
--- a/drivers/video/fb_defio.c
+++ b/drivers/video/fb_defio.c
@@ -70,14 +70,15 @@ int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasy
 {
        struct fb_info *info = file->private_data;
        struct inode *inode = file->f_path.dentry->d_inode;
-      int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
-       if (err)
-               return err;

        /* Skip if deferred io is compiled-in but disabled on this fbdev */
        if (!info->fbdefio)
                return 0;

+       int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
+       if (err)
+              return err;-
+
        mutex_lock(&inode->i_mutex);
        /* Kill off the delayed work */
        cancel_delayed_work_sync(&info->deferred_work);

 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_ADS7846 is not set
+# CONFIG_TOUCHSCREEN_AD7877 is not set
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
+# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
+# CONFIG_TOUCHSCREEN_BU21013 is not set
+# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
+# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
+# CONFIG_TOUCHSCREEN_DYNAPRO is not set
+# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
+# CONFIG_TOUCHSCREEN_EETI is not set
+# CONFIG_TOUCHSCREEN_EGALAX is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_ILI210X is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
+# CONFIG_TOUCHSCREEN_MAX11801 is not set
+# CONFIG_TOUCHSCREEN_MCS5000 is not set
+# CONFIG_TOUCHSCREEN_MMS114 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_PIXCIR is not set
+CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
+CONFIG_TOUCHSCREEN_USB_EGALAX=y
+CONFIG_TOUCHSCREEN_USB_PANJIT=y
+CONFIG_TOUCHSCREEN_USB_3M=y
+CONFIG_TOUCHSCREEN_USB_ITM=y
+CONFIG_TOUCHSCREEN_USB_ETURBO=y
+CONFIG_TOUCHSCREEN_USB_GUNZE=y
+CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y
+CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
+CONFIG_TOUCHSCREEN_USB_IDEALTEK=y
+CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
+CONFIG_TOUCHSCREEN_USB_GOTOP=y
+CONFIG_TOUCHSCREEN_USB_JASTEC=y
+CONFIG_TOUCHSCREEN_USB_ELO=y
+CONFIG_TOUCHSCREEN_USB_E2I=y
+CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
+CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
+CONFIG_TOUCHSCREEN_USB_NEXIO=y
+CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set

--- a/linux/drivers/usb/input/usbtouchscreen.c        2007-03-23 15:49:35.000000000 +0100
+++ b/linux/drivers/usb/input/usbtouchscreen.c    2007-03-23 15:52:02.000000000 +0100
@@ -54,6 +54,12 @@
 static int swap_xy;
 module_param(swap_xy, bool, 0644);
 MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");
+static int invert_x;
+module_param(invert_x, bool, 0644);
+MODULE_PARM_DESC(invert_x, "Invert X axis.");
+static int invert_y;
+module_param(invert_y, bool, 0644);
+MODULE_PARM_DESC(invert_y, "Invert Y axis.");

 /* device specifc data/functions */
 struct usbtouch_usb;
@@ -514,6 +520,7 @@
                                  unsigned char *pkt, int len)
 {
        struct usbtouch_device_info *type = usbtouch->type;
+       int x, y;

        if (!type->read_data(usbtouch, pkt))
                        return;
@@ -521,12 +528,20 @@
        input_report_key(usbtouch->input, BTN_TOUCH, usbtouch->touch);

        if (swap_xy) {
-               input_report_abs(usbtouch->input, ABS_X, usbtouch->y);
-               input_report_abs(usbtouch->input, ABS_Y, usbtouch->x);
+               x = usbtouch->y;
+               y = usbtouch->x;
        } else {
-               input_report_abs(usbtouch->input, ABS_X, usbtouch->x);
-               input_report_abs(usbtouch->input, ABS_Y, usbtouch->y);
+               x = usbtouch->x;
+               y = usbtouch->y;
        }
+       if (invert_x)
+               x = type->max_xc - x + type->min_xc;
+       if (invert_y)
+               y = type->max_yc - y + type->min_yc;
+
+       input_report_abs(usbtouch->input, ABS_X, x);
+       input_report_abs(usbtouch->input, ABS_Y, y);
+
        if (type->max_press)
                input_report_abs(usbtouch->input, ABS_PRESSURE, usbtouch->press);
        input_sync(usbtouch->input);

jwilker2

I too am interested in getting expanded support for DisplayLink USB monitors with RaspberryPi. A number of others including myself have projects underway. I can report that from my point of view the performance of the DisplayLink USB monitor running on a Model B rev. 1 board directly off the sdcard is quite acceptable. I have it configured with an iPazzPort bluetooth wireless keyboard and a gpio interfaced relay, thermistor and i2c LED. It's gotten more than few looks from others when I show them what I'm up to. I'm frankly surprised it's as capable as it is and I built it. At least one person whose posts I noticed was installing one in his car and I'm sure since the monitors without touchscreen are frequently priced as low as $79 here he's not alone.

On another note, implementing e2i touchscreen on Mimo 720S is representing quite a challenge for a few of us (we have a forum http://raspberrypi.org/phpBB3/viewtopic.php?f=64&t=27781&p=303264#p303264) perhaps one of you kind folks could help point us toward someone more knowledgeable than ourselves who could diagnose it.

I'm sure a few others will be stopping by to express their support.

jwilker2 jwilker2 referenced this issue in raspberrypi/linux
Closed

USB HID issues with MiMo #224

philharlow

I would also like to voice support for the mimo displays. I am one of the ones having issues with the touchscreen part my 720S, but with a modified kernel the display operates perfectly with only a tiny bit of lag. They are decent quality, cheap, and use one single cable which is nice for mobile projects, I'm surprised there isn't more support already! Thanks for anything you can do!

George Galt
ggalt commented

@philharlow & @jwilker2, what distro and kernel are you using? I'm currently on Arch using the 3.6.11-7+ kernel. I had both the touchscreen and udlfb working when I recompiled my own kernel (following directions here: http://anup.info/blog/2012/10/13/raspberry-pi-mimo-monitor), but I left it alone for a while and after a few updates, it no longer works (udlfb doesn't load). My assumption is that the update to the firmware hasn't propagated through to ArchArm kernel yet and so there is some mismatch I'm fighting. Any insight would be helpful. FYI, I plan on recompiling my own kernel this weekend to see if I can get udlfb back.

jwilker2

@ggalt & @philharlow
Hello, George
Boy, if you had touchscreen running under Arch that is good news! We've had a rather intractable problem with it under Rasbian. I'm very interested in being of any assistance I can with your efforts I've run Arch on the Pi, however, I'm no kernel level genius but I'm sure going to give it a hard look again starting right now.

Just a thought, if you have your old 'source tree' intact, don't overwrite it! The 'old' working kernel.img may still be there, good news of course, and the means to regenerate it all the better.

We've been having a hell of a time getting this running under Raspbian - Linux raspberrypi 3.6.11+ 389, if the firmware is the culprit that's interesting and may be fixable. We've heard reports that an older version of Occidentalis that's distributed by Adafruit successfully ran touchscreen at one point. Currently there are no problems I'm are of as far as the DisplayLink framebuffer device it runs impressively well for me.

Can you tell me which USB Monitor you have? The one that is troublesome for us is: ID 17e9:401a DisplayLink that is to say: Mimo USB MINI MONITOR 720-s the monitor portion is great, touchscreen not so much. ID 1ac7:0001 the touchscreen endpoint fails to configure reporting what I think is a bogus error.

This from another forum that should help you prevent finding your 'baby' DOA:
'If your goal is to achieve something experimental, are happy to compile your own kernel, and are frustrated by updates breaking it, the solution is to do updates this way:
sudo SKIP_KERNEL=1 rpi-update (updates your firmware)
git pull (from your kernel source directory)
Compile and install as normal.'

We can move this off this forum if all the wrong people are being spammed.

Thanks for contacting me.

Regards,

Jim

George Galt
ggalt commented

Jim and others:

I've created a public repository where we can continue this discussion without bothering the people here. Here is a link: ggalt/RaspberryArch#1

George

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.