DisplayLink Linux Rotation

[updated 8/14/2011 with latest udlfb info]

The xorg generic fbdev driver (xf86-video-fbdev) supports rotation with a custom option (note it disables DGA and xrandr when it rotated mode). DisplayLink devices can use this driver two ways:

  • With the udlfb fb_defio option enabled to detect framebuffer writes based on page faults
  • With the fbdev xorg server patched to report damage (writes to the framebuffer). Instructions for compiling and adding the ReportDamage option to xorg.conf are at the end of this post.

To enable rotation, 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 "ReportDamage" "true"
  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)

9 comments on “DisplayLink Linux Rotation”

  1. Jens Seekamp Reply

    Works like a charm,

    got a display link device to work in portrait mode.

    With the display not rotated there are no errors, if I use the rotate option there are random vertical lines that appear to be frozen and do not update any more. These lines only disappear on a restart of X.

    I tried disabling ShadowFB (is it even used???) with no difference.

    Any idea on how to fix this or is it due to the beta character of udlfb?

    Thanks for your work, Regards

    Jens Seekamp

    • Chris Verges Reply

      Hi Bernie,

      Thanks for this great posting! It really helped to find the exact problem I’m having on a Google search.

      Any update on the defio/udlfb vertical line issue?

      Chris

  2. Jens Seekamp Reply

    Hi Bernie !

    Please allow one more question about a strange effect:

    I am trying to use a touchscreen display via a dislaylink adapter, using the evtouch-driver (http://www.conan.de/touchscreen/evtouch.html) for the touch-feature. Without any rotation everything works fine, but as soon as I rotate the display – which works fine – the X-server dies as soon as the touchscreen is actually touched. The log says ‘EVTouch TouchScreen: Unable to grab device (Device or resource busy).’, and the server dies with signal 11.

    The only thing I changed is to include the rotate-option in the device-section of the screen.

    Do you have any idea or workaround ?

    Thank you very much, best regards !
    Jens

  3. Bernie Thompson Reply

    Hi Jens,

    Unfortunately, I don’t have an answer on this one, as none of my devices has touchscreen going. It may be a xf86-video-fbdev limitation, you might want to ask around ..

    Best wishes,
    Bernie

  4. Brad Reply

    Hi Bernie

    I see that this post was made back in 2010, so I realize that I’m a little late to the party. Anyhow, looks like you committed to udlfb 12 days ago, so I imagine the project is still under active development.

    My question is about the install process for udlfb. I have a Mimo 7″ usb monitor that I have working sans rotation in Ubuntu 11.04 with the DisplayLink driver. I cloned udlfb and ran “make && sudo make install”, but after switching my xorg.conf to use {Driver “fbdev”} I couldn’t get anything on the monitor, with or without the rotation option. Can you give me any advice on places I should be looking to troubleshoot this?

    Thanks very much
    -Brad

    • Bernie Thompson Reply

      Hi Brad,

      Thanks for the prompt. I’ve updated the post with some more recent information. In your case (running fbdev, just getting a black screen), it’s likely you just need to enable udlfb’s fb_defio option (per the link above).

      Thanks,
      Bernie

      • Bernie Thompson Reply

        Note that the kernel doc isn’t clear on the name of the option. The correct instruction to enable fb_defio to create file like /etc/modprobe.d/options.conf with a line of text like

        options udlfb fb_defio=1

        • Brad Reply

          Thanks a lot, Bernie! It’s working with the change to /etc/modprobe.d/options.conf. I wouldn’t have figured that out without your help.

Leave a Reply