LCD7 Portrait mode in GDM

I am trying to get the LCD7 from BeagleBoardToys to go into portrait mode under Gnome.

I’m running “Linux beaglebone 3.8.13 #1 SMP Tue Jun 18 02:11:09 EDT 2013 armv7l GNU/Linux” on a BBW, which is the stock Angstrom image.

I can get the console frame buffer to rotate by exiting out of the display manager and typing the following into the console:

echo 3 > /sys/class/graphics/fbcon/rotate

However, once I start up gdm again, it switches back to landscape mode.

Under gdm I have tried the following:

  1. System → Preferences → Monitors → Changed “Rotation” to anything but normal → Display turns off/blanks for ~30 seconds, then returns to landscape mode.
  2. Edited “Device” section of /etc/X11/xorg.conf to include ‘Option “Rotate” “Left”’, but it doesn’t work. According to /var/log/Xorg.0.log, the modesetting driver does not recognize the rotate option.
  3. Edited .config/monitors.xml to change resolutions and rotation, which didn’t work either.
  4. Various xrandr options:
    xrandr -o left

cvt 480 800 xrandr --newmode "480x800_60.00" 31.00 480 504 552 624 800 803 813 831 -hsync +vsync xrandr --addmode LVDS-0 480x800_60.00 xrandr --output LVDS-0 --mode 480x800_60.00

The Xorg.0 log has the following entry for portrait mode:

cat /var/log/Xorg.0.log | tail

[940786.612] (II) modesetting(0)Modeline "800x480"x61.5 30.00 800 840 888 928 480 493 496 526 -hsync -vsync (32.3 kHz)
[940788.145] (II) modesetting(0)EDID for output LVDS-0
[940788.145] (II) modesetting(0)Printing probed modes for output LVDS-0
[940788.145] (II) modesetting(0)Modeline "800x480"x61.5 30.00 800 840 888 928 480 493 496 526 -hsync -vsync (32.3 kHz)
[940788.159] (II) modesetting(0)EDID for output LVDS-0
[940788.160] (II) modesetting(0)Printing probed modes for output LVDS-0
[940788.160] (II) modesetting(0)Modeline "800x480"x61.5 30.00 800 840 888 928 480 493 496 526 -hsync -vsync (32.3 kHz)
[940788.180] (II) modesetting(0)EDID for output LVDS-0
[940788.181] (II) modesetting(0)Printing probed modes for output LVDS-0
[940788.181] (II) modesetting(0)Modeline "800x480"x61.5 30.00 800 840 888 928 480 493 496 526 -hsync -vsync (32.3 kHz)

Running ‘cat /var/log/Xorg.0.log | tail’ again, after using the GUI rotation change method produces:

[942030.873] (II) modesetting(0)EDID for output LVDS-0
[942030.874] (II) modesetting(0)Printing probed modes for output LVDS-0
[942030.874] (II) modesetting(0)Modeline "800x480"x61.5 30.00 800 840 888 928 480 493 496 526 -hsync -vsync (32.3 kHz)
[942040.579] (II) modesetting(0)EDID for output LVDS-0
[942040.580] (II) modesetting(0)Printing probed modes for output LVDS-0
[942040.581] (II) modesetting(0)Modeline "800x480"x61.5 30.00 800 840 888 928 480 493 496 526 -hsync -vsync (32.3 kHz)
[942040.665] (II) modesetting(0)EDID for output LVDS-0
[942040.666] (II) modesetting(0)Printing probed modes for output LVDS-0
[942040.668] (II) modesetting(0)Modeline "800x480"x61.5 30.00 800 840 888 928 480 493 496 526 -hsync -vsync (32.3 kHz)
[942040.717] (II) modesetting(0)Allocate new frame buffer 480x800 stride

I also spent some time looking at journalctl, but didn’t see anything interesting or blatantly obvious.

I’m not sure where to go from here. Do I try to get a valid mode for 480x800 working, or is there another log I can look at to get more info on the failure?

Thanks,
Louis

fbcon is the framebuffer for text/console mode only. What framebuffer is being used by x11?

Thanks for your reply…It appears that /sys/class/graphics/fb0 is the frame buffer for X11. When I

echo 3 > /sys/class/graphics/fb0/rotate

The X11 session changes to a console view and displays a small cursor in the top left corner. The only way to get X11 back is to issue

systemctl restart gdm

Louis

Try running:

cat /var/log/Xorg.0.log | grep driver

From the a terminal window[make sure your windows environment has been loaded!]

This will give you a list of what drivers have been loaded.

As a followup, assuming your using fbdev AND you have an xorg.conf file then you can try following the instructions from http://www.x.org/archive/X11R6.8.0/doc/fbdev.4.html to rotate the screen.

See http://www.x.org/archive/X11R6.8.0/doc/xorg.conf.5.html for a list of possible locations of the file.

NOTE: I find XWindows configuration very frustrating because there are a LOT of changes between different versions of X AND customizations made by each linux distribution. Xorg.conf does not always exist AND is often ignored if you manually create it!

Thanks for the suggestions and fresh direction. I will not have access to the hardware for a day or two, but I will update this thread once I follow your advice.

It's nice to know that I'm not the only one that finds this frustrating. I'm going to have to make a matrix for the distros, that I'm currently using, and what wireless configurators, system controllers, and X11 settings are used for each.

Louis

Well…It is not using the fbdev module…it is using Kernel Mode Setting (KMS) driver.

Some info on KMS and DRM:
http://www.mjmwired.net/kernel/Documentation/fb/modedb.txt
http://moi.vonos.net/linux/drm-and-kms/

Can I assume the frame buffer is working, because I can switch the console to portrait? So it must be related to X11’s interface to the driver?

Is it because there is only one Modeline listed in the Xorg log? It only shows 800x480, do I need to add a 480x800 modeline for portrait mode? If so, how do I add a mode to the KMS driver?

I’ve tried passing these options to the Kernel at boot

video=480x800

or

omapfb.mode=lvds:480x800M

by modifying /media/BEAGLE_BONE/uEnv.txt. But nothing is different upon a reboot.

I can confirm, by running

dmesg | grep 'command'

that the modes are being passed to the kernel.

Thanks,
Louis

KMS is a TYPE of driver, but it is not the driver. IE on my workstation I use the open source KMS radeon driver.

I’d really like to see a copy of /var/log/Xorg.0.log and if you don’t mind dumping dmesg to a text file and posting that as well I’d appreciate it.

Simplest way of getting ALL the data to go through.

Again, don’t be too discouraged. Video issues with non-standard/current hardware are usual with Linux. I tend to use older hardware and run into problems with Radeon cards all the time.

Thanks for sticking with me. Knowing that KMS is a type helps me understand more about the video system.

I’ve included the logs from the boot to landscape mode, and then performed a diff on the Xorg and dmesg logs after an attempt to change to portrait mode.

The diff of the Xorg log:

diff /var/log/Xorg.0.log /var/log/Xorg.0.log_landscape.txt

produced the result in xorg_portrait_diff.txt.

The dmesg diff did not produce a result.

To complement the dmesg log, I’ve included the journal dump (after an attempt to switch to portrait mode, although I don’t think it makes a difference).

Thanks,
Louis

dmesg_landscape.txt (30.3 KB)

Xorg.0.log_landscape.txt (16.1 KB)

xorg_portrait_diff.txt (941 Bytes)

journal_post.txt (80.3 KB)

Hmm, learn something new. modesetting is a driver too! I thought it just referred to the KMS type of driver, but it also refers to a fallback driver for X11.

And it only supports a couple of options, one of which is not rotate!

If your using some form of debian variant, you can try:
“sudo apt-get install xserver-xorg-video-fbdev”

Install the basic fbdev driver and give that a shot.

You can also try xserver-xorg-video-omap and xserver-xorg-video-omapfb
[the name may be slightly different, so you can also try “apt-cache search fbdev”, omap and omapfb

Now the bad news: I /think/ none of the above will work because they will only be used by the HDMI display by default. Checking the device tree source for BB-BONE-LCD7 I see lines such as:

/* Settings for ThreeFive S9700RTWV35TR / LCD7 cape: */
panel {
compatible = “tilcdc,panel”;

My gut feeling is that this specifies the driver to use: ie use the tildc-panel driver. You could try exiting x-windows and then running
“sudo modprobe -v panel-generic-dpi” [might need to do “sudo modprobe -v panel-generic-dpi.ko”]

If that succeeds, then reload x-windows and check the x11 logs to see if the driver has changed.

Success!

I installed fbdev (2:0.4.2-r17.0.12):

opkg install xf86-video-fbdev

I then enabled fbdev in X11 by editing the “Device” section of /etc/X11/xorg.conf to:

Section "Device" Identifier "Builtin Default fbdev Device 0" Driver "fbdev" Option "Rotate" "CCW" EndSection

That rotated the screen, but the touchscreen needed to swap x and y, and invert x, so I added two Options to the “evdev touchscreen catchall” identifier of /usr/share/X11/xorg.conf.d/10-evdev.conf:

Section "InputClass" Identifier "evdev touchscreen catchall" MatchIsTouchscreen "on" MatchDevicePath "/dev/input/event*" Driver "evdev" Option "SwapAxes" "true" Option "InvertX" "true" EndSection

Which worked for the base X server (clock face pointer and login screen), but as soon as the default user logged in, the touchscreen lost its swap axes option. I could run:

xinput --set-prop "ti-tsc" "Evdev Axes Swap" 1
from an xterm window, to get it to work again, but I wanted it to be automatic.

At first I tried adding it to the .xprofile file, but that didn’t work. I then found that by modifying /etc/pointercal.xinput to the following:

xinput set-int-prop "ti-tsc" "Evdev Axis Calibration" 32 3733 367 79 3992; xinput set-int-prop "ti-tsc" "Evdev Axes Swap" 8 1;
everything worked on a reboot.

Thanks for your help, Gary. I wish it would have worked with modesetting and xrandr, but I will leave that as an exercise for another user :slight_smile:

And for the HDMI vs LCD driver, as far as I know, the base (internal to the AM33xx) lcd controller is used for both. I looked at the source dts file for HDMI and it defines a similar fb section as the LCD7 dts file. But, at this point, I don’t need to dig any deeper…

Louis

Thanks for taking the time to troubleshoot all this Louis! I took the liberty of emailing Gerald Coley directly via the e-mail link on CircuitCo’s wiki [http://circuitco.com/support/index.php?title=BeagleBoneBlack] and asked him to add your config info to the wiki as screen rotation seems to be a recurring issue with the BBB, and at least having a good “how to” for one flavor of linux should point the way for others!

That suggestion needs to go to the supplier of the cape.

Gerald
.

This configuration was performed on the LCD7-00A4 cape by Beagleboardtoys. I’m not sure of the exact organization of CircuitCo, but aren’t they one in the same (BBT and CC)?

Louis

Yes, Circuitco is the company. But the Wiki is not run by Circuitco. I am not Circuitco.

Gerald

This is the **official BeagleBone Black Wiki** maintained and supported by BeagleBoard.org a non-profit 501(C) organization.

It is currently hosted by Circuitco, the manufacturer of the BeagleBone Black.

Thanks Gerald, I went ahead and sent that suggestion on the CircuitCo directly.

Hi Sir ,

I was able to rotate the display by the below method display now works fine in portrait mode .
But i having a new issue in System settings–> Display settings.
It shows “Could not screen information RANDR extension is not present”.
If you have any inputs on this issue please let me know.

Regards ,
Jimmy

Hi Sir ,

On checking the RANDR status using “grep -i -C 2 randr /var/log/Xorg.0.log”.
Its found that RANDR is disabled .
It shows
[ 21.083] Initializing built-in extension XFIXES
[ 21.083] Initializing built-in extension RENDER
[ 21.083] Initializing built-in extension RANDR
[ 21.083] Initializing built-in extension COMPOSITE
[ 21.083] Initializing built-in extension DAMAGE

Hi Louis,

Your diligence with this issue is much appreciated → and your modifications worked; I can now change the orientation of my desktop within Angstrom. However, now my mouse pointer is confused. up/down is now left/right and visa versa. Any advice on how to fix this?

Thanks,
Dennis

whoops, my bad. I entered the two options under the wrong input device. everything is working now. thanks again!