Question

I would like to know the functioncode/source_file which rotates screen by 90/180/270 degrees using xrandr tool ?

xrandr -o left xrandr -o right xrandr -o inverted xrandr -o normal

What function invokes screen rotation in Xserver using above commands ?

Regards, Levon

Was it helpful?

Solution

There are two different X extensions that handle the internal rotation of windows. The most basic is RANDR and its source code is in the top level randr directory of the X Server source.

The MODES extension that provides support for multi-headed devices and which exposes the Outputs and CRTCs you can see listed in the results of invoking xrandr, is the second extension that works with rotating windows. MODES can be found in the hw/xfree86/modes subdirectory of the X server source.

If an X driver uses RANDR directly, it must provide a number of functions that lets RANDR rotate and display windows. If you are using MODES then it sets itself as a layer between RANDR and your driver, and you have to give MODES a more limited set of functions and it handles much of the work.

That said, I've yet to actually get MODES to rotate a window in the X Driver I'm writing, probably because both RANDR and MODES are practically undocumented and its far from clear what their image processing models are.

OTHER TIPS

One of the functions in /usr/include/X11/extensions/Xrandr.h - probably XRRSetScreenConfig - uses the RANDR extension to ask the server to configure a pile of things including the rotation. That's what the xrandr commandline tool would be using.

If you're asking what actually does the work, that's a harder question - the X server, assuming it supports the RANDR extension, may be using generic code, though more likely it is using very chipset-specific code, to do the actual work when rendering the frame...

Yo should check

xrandr --output --rotate left

if it doesn't work maybe your X driver doesn't support rotating or it's disabled. Try

Option         "RandRRotation" "True"

in the Screen section /etc/X11/xorg.conf file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top