# HOWTO rotate X for your pivoting LCD screen w/nVidia hardwar

## slik

It is relatively simple, but there are a few gotchas to be aware of.

First of all, the nvidia binary drivers don't let you do this, so we must use the nv driver that comes with X.   The nv driver will not use 2D hardware accelleration when the screen is turned, since it has to draw the screen in software to rotate it.  Also, I don't believe 3d will work either, but if you're going to do some gaming, you don't want to do it in a portrait orientation anyway.

Next, the randr extention must be disabled.  It is part of the  extmod module, just look at the snippets from my xorg.conf/XF86Config for how to do this.

And finally, a point about the rotation itself.  If you pivot your screen clockwise, you want to rotate X counterclockwise and visa versa.  :Very Happy: 

Only relevant parts of config file shown.

```

Section "Module"

#     Load "glx"

      Load "extmod"

      SubSection "extmod"

              Option "omit xfree86-dga"

              Option "omit xfree86-xrandr"

      EndSubSection

EndSection

Section "Device"

      Driver      "nv"

      Option      "FlatPanel" "1"

      Option      "Rotate" "CCW"

#or   Option      "Rotate" "CW"

EndSection

Section "Screen"

#   You do not need to change anything here, same setup

#   as landscape.

#   i.e. Don't change 1280x1024 to 1024x1280

EndSection

```

You could make some scripts to start up which orientation you would like to work in, or potentially use some ServerLayout sections in your config file, like so...

```

Section "ServerLayout"

      Identifier        "Default"

      Device            "DefaultDevice"

      etc.

EndSection

Section "ServerLayout"

      Identifier       "Portrait"

      Device           "PortraitDevice"

      etc.

EndSection

Section "Device"

      Identifier       "PortraitDevice"

      Driver           "nv"

      Option           "FlatPanel" "1"

      Option           "Rotate" "CCW"

      etc.

EndSection

```

and then select which one you want, like so..

```

startx -- -layout Portrait

```

I haven't tried messing with this yet though.

-----------

search keywords: pivot, rotate, lcd, nvidia, screen, xwindows, xf86config, xorg.config, xrandr, nv, cw, ccw, howto, portrait, vertical, orientation[/code]

----------

## shaniac

so the virtual foot-kissing thank-yous will have to wait until I get home to try it.  If it works for me, I will be very grateful, as I have been beating my head against the wall trying to get xrandr to work for quite a while now....

----------

## vassdoki

Hi!

I've tried it and works fine, but very slow without the acceleration.

Not really usable unfortunately.

I wish xrandr would work, that would be the good solution.

vassdoki

----------

## pjv

Does this work with ATI cards too? And how can you define a shortkey to switch between server layouts (or any other way to do this quickly)? Thx

----------

## vassdoki

I don't know about ATI, but I guess it should work.

It works with my nvidia card and nv driver, and there is no shortcut key, you have to quit X and start it like this:

```
startx -- -layout layout_name
```

where layout_name is the Identifier from the Section "ServerLayout".

chiao vassdoki

----------

## pjv

ok thx

But I'm using GDM (and gnome) so I never really see a terminal and thus can't do a manual startx. I should have to kill gdm to close it down and then do a manual startx. This is kind of a primitive method. Is there anyway I can make an option anywhere to get it done automatically and preferrably without killing gdm (or even better without logging out my gnome session)? Between GDM and gnome X restarts btw.

----------

## vassdoki

That's why I don't use it either. If there were such method, I would love to know it too.

----------

## skobar

The new nvidia drivers (> 7167) do now support rotation with xrandr  :Smile: 

----------

## vassdoki

 *skobar wrote:*   

> The new nvidia drivers (> 7167) do now support rotation with xrandr 

 

Thank You very much!! It is working, and does have acceleration and does not need restart!  :Very Happy: 

This should be written in the xorg.conf Device section:  Option "RandRRotation"

(I have Option "RandR" "on" too, but it wasn't written in the nvidia readme: )

xrandr -q says now this:

 SZ:    Pixels          Physical       Refresh

*0   1280 x 1024   ( 382mm x 302mm )  *75   60  

 1   1280 x 960    ( 382mm x 302mm )   60  

[...]

Current rotation - left

Current reflection - none

Rotations possible - normal left inverted right 

Reflections possible - none

fantastic!

----------

## skobar

My only problem is KDE here. When i rotate the screen 'left' 'kicker' and 'kwin' from kde seems not to detect the new resolution correctly  :Sad:  The kicker is not at the bottom (it has the right orientation, but is at about 1024, not at 1280) and seems to think (like kwin) that the screen has now a 1280x1280 resolution. After killing and restarting kicker/kwin it works as aspekted...

Any one else tried it with kde?

----------

## vassdoki

i experience the same with gnome.

----------

## odborg

 *skobar wrote:*   

> My only problem is KDE here. When i rotate the screen 'left' 'kicker' and 'kwin' from kde seems not to detect the new resolution correctly  The kicker is not at the bottom (it has the right orientation, but is at about 1024, not at 1280) and seems to think (like kwin) that the screen has now a 1280x1280 resolution. After killing and restarting kicker/kwin it works as aspekted...
> 
> Any one else tried it with kde?

 

I have the same problem. I also need to restart kdesktop in order for my background to look proper.

Unfortunately, when I restart kicker, the tray/dock panel where krandrtray is loaded disappears until i restart the session (logout and login). Removing and re-adding it doesn't help.

There's a bug report http://bugs.kde.org/show_bug.cgi?id=101516 on bugs.kde.org saying it's a problem in xorg https://bugs.freedesktop.org/show_bug.cgi?id=2965. I guess this explains why other WMs also are having problems.

----------

## Pixelbrei

Hey Nice!

But apparently it does not work together with twinview  :Sad: 

Or is there any chance to rotate both of my screens?

----------

## SniperSlap

I love it.  Rotation is fast and flawless, hardware accelerated, and no loss of effectiveness to my existing choice of funky features!  Now I'm using every possible feature my 711T can afford me!

But of course, making it work 100% will always take work:

I wouldn't mind if I could have my rotation settings implemented at system startup so that I can use GDM.  This is one of those situations where I wish nVidia could throw me a bone with their stellar driver functionality and give me an xorg.conf configuration option that controls the rotation.

I have a hunch the directive exists, because if you use nvidia-settings, you'll see that you can control the rotation through there?????

----------

## Schmolch

Hello,

can anyone using NVIDIA's Rotate please report how fast it is?

Is it really Hardware-Accelerated?

What Resolution do you run and how fast is your CPU?

I have a AMD 1.8GHz running a 1024x1280 Resolution (not hardware-accelerated).

It is usuable, but for really smooth scrolling (on webpages for example) i would need 5 or better 10 GHz i guess.

----------

## vassdoki

 *Schmolch wrote:*   

> What Resolution do you run and how fast is your CPU?

 

Hi!

As far as I know, it IS hardware accelerated, I don't have any problem with it, scrolling works so fast as without rotating.

I use the binary nvidia driver and xrandr.

```
model name      : Intel(R) Celeron(R) CPU 2.00GHz

cpu MHz         : 2004.959

cache size      : 128 KB
```

```
gentoo$ xrandr -q

 SZ:    Pixels          Physical       Refresh

*0   1280 x 1024   ( 382mm x 302mm )  *75   60  

Current rotation - left
```

----------

## Schmolch

Anyone with the same problem (slow xorg when rotated) should update to the latest Xorg from cvs (in portage), It is alot (ALOT!) faster and makes buying a nvidia-card completely obsolete  :Smile: 

[update]

what i said above is complete bullshit. im not even sure if its gotten any faster at all. im using a nvidia-card now and it totally rocks  :Smile: 

----------

