Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XRandR only sees one mode - the highest one #1

Open
gmc-holle opened this issue Apr 13, 2012 · 8 comments

Comments

Projects
None yet
3 participants
@gmc-holle
Copy link

commented Apr 13, 2012

Hi,

As I understood this X.org driver for i.MX supports XRandR. So I thought it should be possible to switch between all available modes. I checked out the latest code from git and compiled it. But the driver only sees the highest possible mode or maybe the one choosen by the kernel driver on start-up. I don't know to check it the right way. I'm running kernel 2.6.31.14.12 as kernel 2.6.31.14.26 tends to crash (simply stops doing anything) on heavy load - especially when using OpenGLES/EGL what I need to run xbmc.

The kernel driver sees all available and supported modes of the monitor and chooses the highest one. That's ok.


[ 1.625922] SII9022: 12 Supported Modelines:
[ 1.630212] SII9022: "1600x1200@60" 162.22034 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
[ 1.639648] SII9022: "720x400@70" 26.171159 720 737 808 896 400 401 404 417 -hsync -vsync
[ 1.648213] SII9022: "640x480@60" 25.200342 640 656 752 800 480 490 492 525 -hsync -vsync
[ 1.656778] SII9022: "640x480@75" 31.500031 640 656 720 840 480 481 484 500 -hsync -vsync
[ 1.665343] SII9022: "800x600@60" 40.00 800 840 968 1056 600 601 605 628 +hsync +vsync
[ 1.673647] SII9022: "800x600@75" 49.500049 800 816 896 1056 600 601 604 625 +hsync +vsync
[ 1.682300] SII9022: "1024x768@60" 65.2600 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
[ 1.691110] SII9022: "1024x768@75" 78.802206 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
[ 1.700109] SII9022: "1280x1024@75" 135.7425 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync
[ 1.709458] SII9022: "1280x1024@60" 108.3024 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
[ 1.718806] SII9022: "1600x1200@60" 162.22034 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
[ 1.728244] SII9022: "1152x864@75" 108.3024 1152 1216 1344 1600 864 865 868 900 +hsync +vsync

[ 1.737162] SII9022: Setting Resolution: 1152x864

But the X.Org driver is telling me this in the logs:


2898011.643 LoadModule: "imx"
2898011.643 Loading /usr/lib/xorg/modules/drivers/imx_drv.so
2898011.646 Module imx: vendor="X.Org Foundation"
[2898011.646] compiled for 1.11.2, module version = 0.2.0
[2898011.646] ABI class: X.Org Video Driver, version 11.0
2898011.646 IMX: driver for framebuffer: imx
2898011.646 using VT number 8

2898011.661 Falling back to old probe method for imx
2898011.661 Loading sub module "fbdevhw"
2898011.661 LoadModule: "fbdevhw"
2898011.662 Loading /usr/lib/xorg/modules/libfbdevhw.so
2898011.663 Module fbdevhw: vendor="X.Org Foundation"
[2898011.663] compiled for 1.11.2, module version = 0.0.2
[2898011.663] ABI class: X.Org Video Driver, version 11.0
2898011.663 Loading /usr/lib/xorg/modules/drivers/imx_drv.so
2898011.663 Loading /usr/lib/xorg/modules/libfbdevhw.so
2898011.663 IMX(0): using default device
2898011.664 VGA arbiter: cannot open kernel arbiter, no multi-card support
2898011.664 IMX(0): Creating default Display subsection in Screen section
"Default Screen" for depth/fbbpp 24/32
2898011.664 IMX(0): Depth 24, (--) framebuffer bpp 32
2898011.664 IMX(0): RGB weight 888
2898011.664 IMX(0): Default visual is TrueColor
2898011.664 IMX(0): Using gamma correction (1.0, 1.0, 1.0)
2898011.664 IMX(0): hardware: DISP3 BG (video memory: 32768kB)
2898011.665 IMX(0): checking modes against framebuffer device...
2898011.665 IMX(0): checking modes against monitor...
2898011.665 IMX(0): Virtual size is 1152x864 (pitch 1152)
2898011.665 IMX(0): Built-in mode "current": 108.0 MHz, 67.5 kHz, 75.0 Hz
2898011.665 IMX(0): Modeline "current"x0.0 108.00 1152 1216 1344 1600 864 865 868 900 +hsync +vsync -csync (67.5 kHz)
2898011.665 IMX(0): DPI set to (96, 96)
2898011.665 Loading sub module "fb"
2898011.665 LoadModule: "fb"
2898011.666 Loading /usr/lib/xorg/modules/libfb.so
2898011.667 Module fb: vendor="X.Org Foundation"
[2898011.668] compiled for 1.11.2, module version = 1.0.0
[2898011.668] ABI class: X.Org ANSI C Emulation, version 0.4
2898011.668 Loading sub module "exa"
2898011.668 LoadModule: "exa"
2898011.668 Loading /usr/lib/xorg/modules/libexa.so
2898011.669 Module exa: vendor="X.Org Foundation"
[2898011.669] compiled for 1.11.2, module version = 2.5.0
[2898011.669] ABI class: X.Org Video Driver, version 11.0
2898011.669 Depth 24 pixmap format is 32 bpp
2898012.125 IMX(0): physAddr=0xae000000 fbstart=0x2af6f000 fbmem=0x2af6f000 fboff=0x00000000
2898012.126 IMX(0): framebuffer: size=1152x864 bits=32 screenbytes=3981312 stride=4608
2898012.126 IMX(0): rgbOffset=16,8,0 rgbMask=0x00ff0000,0x0000ff00,0x000000ff
2898012.186 EXA(0): Driver allocated offscreen pixmaps
2898012.186 EXA(0): Driver registered support for the following operations:
2898012.186 Solid
2898012.186 Copy
2898012.186 Composite (RENDER acceleration)
2898012.186 UploadToScreen
2898012.186 DownloadFromScreen
2898012.187 IMX(0): Driver handles allocation of pixmaps
2898012.187 IMX(0): Offscreen pixmap area of 28880K bytes
2898012.189 IMX(0): IMX EXA acceleration setup successful
2898012.189 IMX(0): Backing store disabled
2898012.191 IMX(0): DPMS enabled

2898012.191 RandR enabled

It says that XRandR is enabled but sees only the highest available resolution as choosen by the kernel.

I'm able to select a lower resolution on console by echoing the wanted resolution to /sys


efikatv fb0 # cat /sys/class/graphics/fb0/modes
S:1152x864p-75
S:1280x1024p-60
V:1280x1024p-75
V:1024x768p-75
V:1024x768p-60
V:800x600p-75
V:800x600p-60
V:640x480p-75
V:640x480p-60
U:720x400p-70

D:1600x1200p-60

echo "V:800x600p-75" > /sys/class/graphics/fb0/mode

Did I do something wrong or is the X.Org driver not capable of different resolution?

Regards,
Stephan Haller

@blu

This comment has been minimized.

Copy link

commented Apr 17, 2012

Hi Stephan,

you did not do anything wrong and your observations are correct - the driver currently does not support modes other than the current videomode. Essentially, our xrandr is a stub which knows only about the videomode active at startup. We are in the process of implementing KMS support, but I can't give you a timeline as of now.

Regards,
Martin Krastev

@gmc-holle

This comment has been minimized.

Copy link
Author

commented Apr 18, 2012

Hi Martin,

These are bad but also very good news. Is there any WIP code available? (I think everybody is asking ;) It's also sad that Freescale's X.Org IMX driver of their BSP package cannot be used. Its crashes with segfault everytime. But it was also to scan all available modes and activates RandR explicitly. Do you anybody who got this code working? It would be an alternative as long as we have to wait for the new KMS driver.

Regards,
Stephan Haller

@blu

This comment has been minimized.

Copy link

commented Apr 22, 2012

Hi Stephan,

I am on kernel 2.6.31.14.27 here (patched to disable z430 MMU, which could be the source of the issues you have seen in .26), and I am unable to control the mode via /sys/class/graphics/fb0/mode - whether I sudo or not, the sys fs responds with permission denied. I think I have .12 lying somewhere around, so I can try it out later.

Regards,
Martin Krastev

@mwsealey

This comment has been minimized.

Copy link
Contributor

commented May 3, 2012

You might need to actually be root (not sudo, but "sudo su" then try writing it) since there's a subtle difference in permissions when it comes to the kernel special filesystems like proc or sysfs (since the kernel knows the difference between uid 1001 sudo and real uid 0).

WIP code for KMS is not available as of yet as it is not feature-rich (all it does is provide the modesetting, no video overlay or page flip or the required functionality to work on xf86-modesetting driver which is the correct way, so we have to test on fbdev in X) and runs on a kernel with no other features (i.e. no audio of any kind). We are planning on bumping to 3.4 when it is released and making a public experimental kernel with the missing features in-place.

@gmc-holle

This comment has been minimized.

Copy link
Author

commented May 4, 2012

No problem, I can wait for the new driver :) But do you see any possibility to enforce a resolution at system's start-up? Could setting the kernel parameter "video=..." help? I tried but either it won't work or I missed to passed the correct arguments to the parameter.

@blu

This comment has been minimized.

Copy link

commented May 15, 2012

Stephan, as a (quite) low-tech workaround, you should be able to restart Xorg in the desired mode (your 800x600 used in example) like this:

$ service gdm stop
$ echo "V:800x600p-75" > /sys/class/graphics/fb0/mode
$ service gdm start

Regards,
Martin Krastev

@gmc-holle

This comment has been minimized.

Copy link
Author

commented May 17, 2012

Hi Martin. Sorry that does not work as I wrote initially. I can choose any resolution on console by echoing the requested resolution to /sys/class/graphics/fb0/mode and it will change - but only on console. As soon as I start the X server (I do not use any login manager like gdm) it switches back to the highest resolution. If I set a specific resolution in /etc/X11/xorg.conf it will only affect the virtual size of X screen not the monitor resolution. Now since the hard-float drivers for debian has been release and I use them the speed is getting better. ;)

@gmc-holle

This comment has been minimized.

Copy link
Author

commented May 17, 2012

I couldn't rest so I tried again and .... I succeeded :) The problem was that echoing the resolution to sysfs did only change the resolution of the current console. But as soon as I start X the system switched to a different console (vt8 in this case) that was still in highest resolution. The trick is to echo the resolution to sysfs, get the detailed information about framebuffer after it switched to requested resolution, then to set up /etc/fb.modes and call fbset to set current configuration to all consoles. After these steps I can start X and it wil stay in the resolution I want :)

Here is the script I call after booting the system. Depending on the distribution you are using you might need to merge this script to /etc/rc.local. Gentoo uses a directory-based approach now.


efikatv ~ # cat /etc/local.d/99-change_resolution.start
#!/bin/sh

Resolution to set on all consoles

RESOLUTION="V:800x600p-60"
DEPTH=32

#############################################################

Set resolution on current console

echo "${RESOLUTION}" > /sys/class/graphics/fb0/mode

Get detailed timing information of current console and

set up /etc/fb.modes to set resolution on all consoles

rm /etc/fb.modes
fbset > /etc/fb.modes
sed -re "/^[[:space:]]*rgba/d" -i /etc/fb.modes

fbset -a -depth ${DEPTH} $(echo "${RESOLUTION}" | sed -re 's/[^0-9x-]//g')

Thanks for your patience and your help. You can close this issue if you want.

Regards,
Stephan Haller

PS: Now as I can set a lower resolution XBMC and LiveTV is working like a charm :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.