DisplayLink Linux Rotation

Posted on 02. Jan, 2010 by Bernie Thompson in udlfb

With a kernel framebuffer driver that supports defio (like the version of udlfb in testing at git.plugable.com), it’s possible to use the standard xf86-video-fbdev X driver, rather than a custom DisplayLink one.

One interesting gain is xf86-video-fbdev supports rotation with a custom option (note it disables DGA and xrandr when it rotated mode).

To enable, in the xorg.conf “Device” section, add a Rotate option, setting it to CW, CCW, or UD.

Section "Device"
  Identifier "dl"
  Driver "fbdev"
  Option "rotate" "CCW"
  Option "fbdev" "/dev/fb1"
EndSection

One downside is rendering is significantly slower, as the extra work of rotation is done at the X level and the page-fault behavior of defio means even small updates refresh much of the screen. Here’s some numbers that can be compared to earlier posts (in non-rotate mode):

bernie@bernie-aspireone:~/git/misc-udlfb$ ./udlfb-perf.sh fb0 gtkperf -a
Xlib:  extension "RANDR" missing on display ":3.0".
GtkPerf 0.40 - Starting testing: Fri Jan  1 09:47:20 2010
 
GtkEntry - time:  0.00
GtkComboBox - time:  3.73
GtkComboBoxEntry - time:  2.08
GtkSpinButton - time:  0.49
GtkProgressBar - time:  0.69
GtkToggleButton - time:  0.47
GtkCheckButton - time:  0.44
GtkRadioButton - time:  0.79
GtkTextView - Add text - time:  2.30
GtkTextView - Scroll - time:  1.24
GtkDrawingArea - Lines - time:  4.14
GtkDrawingArea - Circles - time:  4.56
GtkDrawingArea - Text - time:  4.11
GtkDrawingArea - Pixbufs - time:  0.90
 ---
Total time: 25.96
 
Quitting..
 
model name      : Intel(R) Atom(TM) CPU N270   @ 1.60GHz
model name      : Intel(R) Atom(TM) CPU N270   @ 1.60GHz
cpu MHz         : 800.000
cpu MHz         : 800.000
MemTotal:        2052144 kB
Framebuffer Mode: 1920,1080
 
Rendered bytes:  1238913024 (total pixels * Bpp)
Identical bytes: 1070725304 (skipped via shadow buffer check)
sent bytes:      125732225 (compressed usb data, including overhead)
K CPU cycles:    7478653 (transpired, may include context switches)
 
% pixels found to be unchanged: 86.00 %
Compression of changed pixels : 25.00 %
Total CPU cycles spent per input pixel: 6
Total CPU cycles spent per output pixel: 59
USB Mbps: 35.52 (theoretical USB 2.0 peak 480)

Linux USB quirks on 2.6.32

Posted on 02. Jan, 2010 by Bernie Thompson in Programming

Doing development on udlfb on Linux 2.6.32, crossed paths with these two quirks.

The usb_skeleton.c sample driver appears to run afoul of this problem, resulting in a warn_on during bulk transfer completion, if done the way the sample recommends. Because completion routines can be called with irqs disabled, usb_buffer_free on dma-ready buffers can’t be called from them — which pushed the udlfb implementation to diverge from the skeleton model and pre-allocate a small set of urbs, and free only on driver disconnect.

Calls to usb_bulk_msg (simple synchronous bulk out) appeared to be silently failing for largish transfers (generally 16-32K). Nasty to track down, since no errors are returned. Caused removal all use of usb_bulk_msg from udlfb, except for transactions that are known to be small.

fbi – linux framebuffer imageviewer

Posted on 24. Dec, 2009 by Bernie Thompson in Tips

I was embarrassed to discover that the ever-popular dlfb “green screen” is broken in subtle ways by the new defio support. So for now with this new driver, DL devices may up with what appears to be gibberish. I didn’t notice, because my test config launches X on the DisplayLink device immediately.

In the absence of a working X setup, and until the draw-during-probe issue is resolved, another great way to confirm your DL devices are working properly is with the fbi (“linux framebuffer imageviewer”) utility.

sudo apt-get install fbi

Run the above to install fbi (on Ubuntu/Debian).

fbi -d /dev/fb0 -a *.jpg

And this to show a full-screen slideshow with fbi — replacing “/dev/fb0″ with one of your DisplayLink devices. You can “ls /sys/class/graphics/” to see all your framebuffer devices, and look within those directories for details on them. Of course, run the fbi utility from a directory with some jpgs (or other images) to display. pg-up/pg-down to move between photos.

You must run the fbi program from a console (fbi limitation). So hit Ctrl-Alt-F1 or something first, login from that text console, and run from there.

This wouldn’t work with older versions of udlfb or displaylink-mod (without defio support), and it makes a nice new test case. Now, short instructions for getting mplayer working for fbdev video would be welcome …

Page 5 of 8« First...34567...Last »