DisplayLink

From Gentoo Wiki
Revision as of 23:27, 30 March 2012 by Scientes (Talk | contribs)

Jump to: navigation, search

DisplayLink is a technology that enables monitors to work via USB. In general the local GPU renders the picture,Template:Fact the frambuffer device compresses the data and sends it to the external device via USB.

Note: There is a new DRM_UDL driver for this hardware, merged into the 3.4 release cycle. I have not gotten it to work yet, even with the xf86-video-modesetting X11 driver.

Also, you can use the xf86-video-fbdev driver as well.

Contents

Installation

Enable the DisplayLink framebuffer device in your kernel:

Kernel configuration

Device Drivers --->
    Graphics support --->
        <M> Support for frame buffer devices --->
            <M> Displaylink USB Framebuffer support

After booting into the new kernel the external monitor should show a green background image. That means the kernel module is loaded and the device works, it also creates the device in /dev/fb0.

Note
if you have already other framebuffer devices with your AMD driver, it will be /dev/fb1...

The X driver x11-drivers/xf86-video-displaylink is only available in the X11 overlay. Assuming layman is already configured, you add it with the following command:

root # layman -a x11

Then update your /etc/make.conf with the new graphics card: Portage uses the variable VIDEO_CARDS for enabling support for various graphics cards in packages. Setting VIDEO_CARDS to displaylink will pull in the correct driver:

File/etc/portage/make.conf

 VIDEO_CARDS="displaylink"

After setting this you want to update your system so the changes take effect:

root # emerge --ask --changed-use --deep world
Note
if it does not pull the driver with emerge -DuN world, install it manually

One X-Server

TODO

Two X-Server

This method is failsafe and should work with any graphics card installed. We start two instances of X-Server for each device and then use a software called x2x to move the input devices between them.

  • two independent instances and desktops
  • Input devices follow the mouse pointer

Software

For this method, we need another input device driver called x11-drivers/xf86-input-void:

File/etc/make.conf

INPUT_DEVICES="... void ..."
Note
check if it pulls the X driver with emerge -DuN world, if not install it manually

The program x11-misc/x2x is available in portage and can be installed via:

root # emerge -av x11-misc/x2x

xorg.conf.DL

We configure two independent /etc/X11/xorg.conf for each device and initialize the desktop using ~/.xinitrc scripts.
Create this file in /etc/X11/ and name it xorg.conf.DL:

File/etc/X11/xorg.conf.DL

Section "Device"
    Identifier "DisplayLinkDevice"
    driver "displaylink"
    Option "fbdev" "/dev/fb0"    # You have to use the correct framebuffer device here
EndSection

Section "Monitor"
    Identifier "DisplayLinkMonitor"
EndSection

Section "Screen"
    Identifier "Default Screen"
    Device "DisplayLinkDevice"
    Monitor "DisplayLinkMonitor"
    SubSection "Display"
        Depth 16         # 24bit works fine but for USB 2.0 a lot of data
        Modes "1280x1024"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier "Server Layout"
    Screen 0 "Default Screen" 0 0
    Option "AllowMouseOpenFail" "True"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
EndSection

Section "ServerFlags"
    Option "AllowEmptyInput" "false"
    Option "AutoAddDevices" "false"
    Option "AutoEnableDevices" "false"
EndSection

Section "InputDevice"
    Identifier "Keyboard0"
    Driver "void"
EndSection

Section "InputDevice"
    Identifier "Mouse0"
    Driver "void"
EndSection

.xinitrc2

Next we create the ~/.initrc2 for our external display. Create and customize the file to your needs, here is an example:

Note
DPMS is turned off, because I once had trouble to wake up the monitor again
File~/.xinitrc2

# DPMS stuff
## turn on monitor
xset dpms force on
## disable sleep modes etc.
xset -dpms
## disable screensaver
xset s off

# turn off beep
xset -b

# activate zapping (ctrl+alt+Bksp killall X)
setxkbmap -option terminate:ctrl_alt_bksp

# Set the background using feh
feh --bg-scale /usr/share/slim/themes/capernoited/background.jpg

# compositoring
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &

# start programs
wicd-client &
mrxvt &
# start the actual window manager
exec /usr/bin/awesome

displaylink.sh

This is the actual script that starts the second instance of xorg-server. Make it executeable and save it somewhere in your home folder, in this example we save it to ~/.displaylink.sh

File~/.displaylink.sh

#!/bin/sh
xinit ~/.xinitrc2 -- /usr/bin/X :1 -xf86config xorg.conf.DL -novtswitch -sharevts -audit 0 vt12 &
sleep 5
x2x -west -from :0 -to :1 &
Note
If you add this script to your actual ~/.xinitrc (which is executed on every start of X) or add it to Gnome/KDE etc. autostart, it will automatically initialize the second desktop for you. If the second screen is not attached, it just fails to do so.

Links

Personal tools
Namespaces

Variants
Actions
Gentoo Websites logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Navigation
Toolbox
Categories