Lots of names included BIOS for no apparent reason; as we try to eliminate
BIOS calls from the driver, these only serve to confuse us.
(cherry picked from 8e5d280d94ad3d3ba3c75871c17abec9da62ed34 commit)
For the Aopen Mini-PC, ignore the claimed attached 800x600 LVDS panel.
Likewise for the Apple Mac Mini, but done slightly differently since it
shares PCI IDs with the Macbook Pro.
The spread spectrum clock generator that improves EMI characteristics for
laptop screens lives in an external chip that is programmed over an i2c bus.
Without correct programming, attempts to use this mode for the LVDS can
result in a DC signal being sent to the panel.
Until we find programming information for this external chip, we should
leave this mode disabled.
This fixes a hang on the i945 during restore. It appears that saving/restoring
the VGA registers is not important, as we're correctly saving/restoring the
registers we touch within the driver anyway.
Now, mode names generated by DDC get names of the form "WIDTHxHEIGHTxREFRESH".
The matching for user Modes lines takes the user Modes as the prefix that
needs to match, rather than an exact string match or "WIDTHxHEIGHT" match. So
one can, for example, specify "1024x768" to get any old 1024x768, or
1024x768x60 to get one of the modes named 1024x768x60.
This is a mostly-untested merge of airlied's work. The I2C modules are intended
to be moved into the core server or a separate driver module when they're
functional and we're happy with the API.
This moves us to maintaining MonPtrs per pipe instead of using the EDID
structure "xf86MonPtr", which is closer to what we want to be looking at when
doing validation. The new validation isn't enough yet -- particularly, we
aren't importing and validating the custom modelines to the pipes when
applicable, but this will be easier than (for example) trying to make flat
panel modes pass xf86ValidateModes through various gross hacks.
Hotplug turn-on/off also happens at SwitchMode time now, instead of at randr
probe time.
This is the case on the Mac mini, which is an i945GM but has no LVDS attached.
Powering on with the power timing registers zeroed would probably be a bad idea,
even if there was a panel attached.
- Don't mess with pScrn->monitor->Modes, and instead make our own availModes.
- Don't re-program the pipe with the same values (no flicker at xrandr)
- Move a bunch of stuff that should be exposed through the public API (probably)
to i830_xf86Modes.c
- Use a table with established modes plus GTF to come up with modes from EDID,
instead of trying to walk and find one in pScrn->monitor->Modes. I think
this is correct.
- Reset clone state if we've detected new pipes, which should turn on the
cursor.
Now, DDC modes always end up being preferred to custom modelines, even if
smaller. This should probably be fixed by inserting custom modelines into
the probed mode list if they're valid according to the probed parameters of the
monitor.
Too much code is lifted from static functions in xf86Mode.c, and those should be
made unstatic if possible. Using xf86ValidateModes is also rather hacky, and
I want to break the function down, but this is a first step.