From Linux Rockchip
Jump to: navigation, search

The RK3188 has a dual LCD display controller

On most devices HDMI output is driven by lcdc1 (second output) using extra HDMI convertor chip. Depending on the device, lcdc0 may drive a TV encoder chip (RK1000) that produces an analog composite signal to an optional AV output, a mipi convertor chip to connect a high-resolution LDC display, etc.


Using old driver in Rockchip-provided kernel

Kernel messages will refer to the LCD outputs as lcdc0 and lcdc1. Both are probed at boot time, unless they have been disabled in kernel config. If a display is found connected, it is initialized with a default display mode and a default scaling hardcoded in the kernel.

HDMI Display mode

The current display mode, consisting of display resolution and refresh rate, may be read and changed at runtime.

ls /sys/class/display/*HDMI/

# read supported modes
cat /sys/class/display/*HDMI/modes

# read current mode
cat /sys/class/display/*HDMI/mode

# change display mode to 1280x720 progressive mode at 60 hertz
echo $MODE > /sys/class/display/*HDMI/mode

HDMI Scaling

If you see black borders around the picture, it is likely that the display output has been scaled down.

find /sys -name "scale"

# read current scale
cat /sys/class/display/*HDMI/scale

# change scale to 100% (turn off down-scaling)
echo "xscale=100" > /sys/class/display/*HDMI/scale
echo "yscale=100" > /sys/class/display/*HDMI/scale

Color depth

If the kernel defaults to a 16bit framebuffer (RGB565) and you want to switch to full color depth (RGB888), fbset may be used. Care must be taken to run it before X11 starts.

  • The rockchip framebuffer code of Android 4.2.2 kernel determines default color depth by the kernel logo used. If CONFIG_LOGO_LINUX_BMP is enabled, you will get a 32bit default frame buffer, else a 16bit one with color banding.
See drivers/video/rockchip/rk_fb.c line 733 for details.
  • If your display shows garbage after running fbset, switch off your TV or LCD and then on again. The LCD controller in the device will reinitialize doing this.

If the kernel cannot be modified, the code below shows how to use fbset on upstart based systems such as Ubuntu.

sudo apt-get install fbset
sudo su

cat <<EOF > /etc/init/fbset.conf
# fbset - run fbset to set truecolor fbmode

description "run fbset ASAP"

start on startup and started udev or starting lightdm

    if [ -x /bin/fbset ]
    then /bin/fbset -nonstd 1 -depth 32 -rgba \"8/0,8/8,8/16,8/24\" -a
end script

cat <<EOF >> /etc/X11/xorg.conf

Section "Screen"
        Identifier      "DefaultIdentifier"
        Device          "DefaultDevice"
        Monitor         "DefaultMonitor"
        DefaultDepth    24

If you mess up X11 and the console and get a black screen, try to SSH into the RK3188 device and issue:

service lightdm stop
/bin/fbset -nonstd 1 -depth 32 -rgba "8/0,8/8,8/16,8/24" -a
service lightdm start

Mainline kernel

Mainline display driver is under development.