Hi, I'd know a way... the same way that the fbdev drivers use. cat /proc/cpuinfo | grep machine to see what i mean
FBDev has an advantage on Xfree for this, it runs inside the kernel and therefore knows what type of machine it's running on. Hope this helps Michel Dänzer wrote: > > Benjamin Herrenschmidt wrote: > > > > >On Mon, 26 Feb 2001, Michel Dänzer wrote: > > >> I just had an interesting idea: The flat panel code could never > > >determine the > > >> panel dimensions because our machines don't have a BIOS. So I > > specified them > > >> with > > >> > > >> Option "PanelWidth" "1024" > > >> Option "PanelHeight" "768" > > >> > > >> and it works without any of the options I have mentioned here a thousand > > >> times! (iBook users will have to use 800 and 600 of course) This kind of > > >> enables mode switching, but everyone should be aware that *this may > > >> damage your panel* . You've been warned. > > >> > > >> > > >> Now I just wonder if we could detect the panel dimensions somehow... > > > > > >From the OF device tree? And return it to userspace using a new fbdev > > ioctl()? > > > > Unfortunately, the OF ATI drivers won't give you anything useful in the > > device-tree (not even the PLL & clock values). There should probably be a > > way to probe the panel type, but I'm not too sure how. For the PLL & > > clock values, the only solution I have (suggested by ATI) would be to > > build a big table indexed by the OF name of the card that contains the > > ref clocks (the divider can be read from the registers) and eventually > > the min/max PLL values. A table based on the machine model can probably > > be used for the LCD size (but beware that wallstreet exist in both > > 800x600 passive matrix and 1024x768 active & passive matrix). I beleive > > new LVDS displays can be probed but I don't know how. > > > > You can't even rely on the resolution returned by the OF driver as, at > > least on my pismo, it's able to use a scaled mode for booting if asked to > > do so by the nvram settings. > > *sigh* > > > I tried the above options and indeed, it works. However, if I then allow > > X to use 800x600 (and other resolutions like 640x480), the scaler doesn't > > seem to be properly configured. It's readable, but the display is > > somewhat clipped and have a vertical band at the 3/4 of the screen that > > wraps part of it. (Difficult to explain what I see... doesn't look far > > from beeing correct however). > > Yup, seen that too - it used to be like this in 32 bit but better in 16 bit. > :( -- /Bastien Nocera http://hadess.net