# radeon driver & xrandr can't rotate display



## graemeg (Mar 20, 2016)

Does anybody know if there is a known limitation with xrandr(1) under FreeBSD, and possibly with the Radeon open source driver?

I bought two new 21" monitors to go with my Dell U2711 27" monitor in a multi-monitor setup. It's just taken me 5 days to get all three monitors running in a seemless desktop and at their native resolution.

Anyway, a long story short. In the end I use my Radeon HD 7870 video card with the open source Radeon driver, and a start-up script that executes `xrandr` to set up the monitors as I want (almost). I want the two new 21" monitors to run in portrait mode while my 27" monitor is between them in landscape mode. At the moment they are all in landscape mode. As soon as I execute `xrandr` as follows:

`xrander --output DisplayPort-1 --rotate left`

then my right 21" monitor goes blank. Using --rotate normal, and I can get it back alive again. It seems nothing I do makes them work in portrait mode, hence my question if there is a known limitation under FreeBSD?

xrandr doesn't give any errors after the above command either.

I'm running FreeBSD 10.1 release p26 and x11-servers/xorg-server (v1.17.4) and all related drivers are up to date.


----------



## sidetone (Mar 20, 2016)

Did you include which monitor you want left of or right of the other one? The position based on the position of the next monitors?


----------



## graemeg (Mar 20, 2016)

Yes I did. Here is what I run after I start up my window manager (jwm(1)).

```
# 3 monitors: P2214H + U2711 + P2214H
xrandr --output DisplayPort-0 --mode 1920x1080 --pos 0x0 --output DVI-0 --mode 2560x1440 --right-of DisplayPort-0 --output DisplayPort-1 --mode 1920x1080 --right-of DVI-0
```


Here is what I have in /etc/X11/xorg.conf - initially I tried to set up my monitors using Xinerama, but no matter what I tried, I couldn't get it working. So disabled any `xinerama` settings in xorg.conf, then tried xrandr() after reading many posts on the internet saying xrandr() is now the preferred method of setting up monitors. But those posts were all talking about Linux, not FreeBSD.


```
Section "ServerLayout"
  Identifier  "Main"
  Screen  0  "Screen0" 0 0
#  Screen  1  "Screen1" RightOf "Screen0"
#  Screen  2  "Screen2" LeftOf "Screen0"
  InputDevice  "Mouse0" "CorePointer"
  InputDevice  "Keyboard1" "CoreKeyboard"
  Option  "Xinerama" "0"
EndSection

Section "Files"
  ModulePath  "/usr/local/lib/xorg/modules"
  FontPath  "/usr/local/lib/X11/fonts/100dpi/"
  FontPath  "/usr/local/lib/X11/fonts/75dpi/"
  FontPath  "/usr/local/lib/X11/fonts/misc/"
  FontPath  "/usr/local/lib/X11/fonts/Type1/"
  FontPath  "/usr/local/lib/X11/fonts/Liberation/"
  FontPath  "/usr/local/lib/X11/fonts/bitstream-vera/"
  FontPath  "/usr/local/share/fonts/dejavu/"
  FontPath  "/usr/local/share/fonts/webfonts/"
EndSection

Section "Module"
  Load  "glx"
  Load  "dri2"
  Load  "glamoregl"
EndSection

Section "ServerFlags"
  Option  "AutoAddDevices" "False"
  Option  "AllowEmptyInput" "False"
  Option  "DRI2" "1"
  Option  "AIGLX" "True"
  Option  "DontZap" "off"
  Option  "BackingStore" "1"
EndSection

# TypeMatrix 2030 USB
Section "InputDevice"
  Identifier  "Keyboard0"
  Driver  "kbd"
  Option  "XkbModel" "tm2030USB"
  Option  "XkbLayout" "us"
EndSection

# Filco tenkeyless keyboard
Section "InputDevice"
  Identifier  "Keyboard1"
  Driver  "kbd"
  Option  "XkbModel" "pc104"
  Option  "XkbVariant" "dvorak-alt-intl"
EndSection

Section "InputDevice"
  Identifier  "Mouse0"
  Driver  "mouse"
  Option  "Protocol" "auto"
  Option  "Device" "/dev/sysmouse"
  Option  "ZAxisMapping" "4 5 6 7"
EndSection


Section "Monitor"
  Identifier  "Monitor0"
  VendorName  "DELL"
  ModelName  "P2214H-1"
  HorizSync  30.0 - 83.0
  VertRefresh  56.0 - 76.0
  Option  "DPMS" "1"
#  Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync
  Modeline "1920x1080_60.00"  148.50  1920 2008 2052 2200  1080 1084 1089 1125  +HSync +Vsync
  Option  "ModeDebug" "TRUE"
  Option  "UseEdid" "FALSE"
  Option  "ExactModeTimingsDVI" "True"
  Option  "ModeValidation" "NoDFPNativeResolutionCheck"
  DisplaySize  1920 1080
EndSection

Section "Monitor"
  Identifier  "Monitor1"
  VendorName  "DELL"
  ModelName  "U2711"
  HorizSync  30.0 - 89.0
  VertRefresh  56.0 - 76.0
  Option  "DPMS" "1"
#  Option  "ModeDebug" "TRUE"
#  Option  "UseEdid" "FALSE"
#  Option  "ExactModeTimingsDVI" "True"
#  Option  "ModeValidation" "NoDFPNativeResolutionCheck"
  ModeLine  "2560x1440_60.00" 241.5 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
  DisplaySize  2560 1440
EndSection

Section "Monitor"
  Identifier  "Monitor2"
  VendorName  "DELL"
  ModelName  "P2214H-2"
  HorizSync  30.0 - 83.0
  VertRefresh  56.0 - 76.0
  Option  "DPMS" "1"
#  Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync
  Modeline "1920x1080_60.00"  148.50  1920 2008 2052 2200  1080 1084 1089 1125  +HSync +Vsync
  Option  "ModeDebug" "TRUE"
  Option  "UseEdid" "FALSE"
  Option  "ExactModeTimingsDVI" "True"
  Option  "ModeValidation" "NoDFPNativeResolutionCheck"
EndSection

Section "Device"
  Identifier  "DisplayPort-0"
  Driver  "radeon"
  VendorName  "AMD Corporation"
  BoardName  "Radeon HD 7870"
  BusID  "PCI:1:0:0"
  Screen  0
  Option  "BackingStore" "1"
EndSection

Section "Device"
  Identifier  "DVI-0"
  Driver  "radeon"
  VendorName  "AMD Corporation"
  BoardName  "Radeon HD 7870"
  BusID  "PCI:1:0:0"
  Screen  1
  Option  "BackingStore" "1"
EndSection

#Section "Device"
#  Identifier  "DisplayPort-1"
#  Driver  "radeon"
#  VendorName  "AMD Corporation"
#  BoardName  "Radeon HD 7870"
#  BusID  "PCI:1:0:0"
#  Screen  2
#  Option  "BackingStore" "1"
#EndSection

Section "Screen"
  Identifier  "Screen0"
  Device  "DisplayPort-0"
#  VideoAdaptor  "DVI-0"
  Monitor  "Monitor0"
  DefaultDepth  24
  SubSection  "Display"
  Depth  24
  Modes  "1920x1080_60.00"
  EndSubSection
  Option "Accel"
EndSection

Section "Screen"
  Identifier  "Screen1"
  Device  "DVI-0"
  Monitor  "Monitor1"
#  VideoAdaptor  "DisplayPort-1"
  DefaultDepth  24
  SubSection  "Display"
  Depth  24
  Modes  "2560x1440_60.00"
  EndSubSection
  Option "Accel"
EndSection


#Section "Screen"
#  Identifier  "Screen2"
#  Device  "DisplayPort-1"
#  Monitor  "Monitor2"
#  DefaultDepth  24
#  SubSection  "Display"
#  Depth  24
#  Modes  "1920x1080_60.00"
#  EndSubSection
#EndSection
```


----------



## sidetone (Mar 20, 2016)

I don't use xorg.conf for configuring monitors, and `xrandr` can do it by itself. Maybe the `xrandr` settings should all be on the same command line. See if the rotate option works on your DVI monitor, because at least that should work. Try the two types of monitors alone. Also, I don't include the mode settings, who knows if the height and width are messing with the settings.

There might be an error in the command line, that's difficult to see.

Maybe `xrandr --output DVI-0 --left-of DisplayPort-1 --rotate left --output DisplayPort-0 --right-of DisplayPort-1 --rotate right`

You'll have to check if I made a small error. I'm not sure if running of two instance of `xrandr`, removed the previous options. If this doesn't work try x11/arandr to set it by GUI, and see if it sets up the command.


----------



## graemeg (Mar 20, 2016)

I can't rotate any of my 3 monitors. As far as I know `xrandr` commands can be run one after another, and that doesn't reset previous commands. Either way, I modified my start-up script to run them all in one command when X starts up, and that didn't help either. Strangely my mouse cursor then gets rotated on them, but the actual desktop and applications displayed on the two side monitors aren't rotated. Very weird.

Thanks for mentioning x11/arandr - I tried that, but it made no difference. It visually displays what I want, but when I apply it or save it to a script and run it, my side monitors go into power-save mode.


----------



## sidetone (Mar 20, 2016)

graemeg said:


> Strangely my mouse cursor then gets rotated on them, but the actual desktop and applications displayed on the two side monitors aren't rotated.


 I thought the monitor was physically being turned sideways. Is that what it is, or did the display just affect the mouse?

It looks like there's just settings that have to be exact (minor errors), or put into your .xsession file.


----------



## graemeg (Mar 20, 2016)

At the moment the three monitors are physically in landscape orientation - because that is the only why I can get all three to work. As soon as I can software rotate the two 22" monitors into portrait mode, then I'll obviously physically rotate them too to be usable.

As I mentioned, with the all-in-one-command `xrandr` startup script the two 22" inch monitors still look like landscape mode (desktop background, application windows), but only the mouse cursor (the arrow) is rotated.

I even removed (renamed) my xorg.conf so it doesn't get used at all, and everything is only done via `xrandr`, but that didn't make any difference with the rotation issue.

Does `xrandr` log any errors somewhere - maybe that might give me a hint as to what is going wrong [in case it is a settings issue on my system]?

It would be ideal if I could rotate the two 22" monitors, but if I can't, it wouldn't be the end of the world. At least now [after 5 days of struggling] I have all three working and in their native resolutions.


----------



## wblock@ (Mar 21, 2016)

There is lots of unnecessary and possibly detrimental stuff in that xorg.conf.  AllowEmptyInput has been known to be bad for several years.  There are lots of other entries that might be preventing rotation from working.

I would suggest removing that file entirely, or at the very least the Monitor, Device, and Screen sections.  See the updated Xorg Configuration section of the Handbook for the modern way to do it, and start by only setting the things that are required: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html.


----------

