Commit Graph

64 Commits

Author SHA1 Message Date
Keith Packard ff64bc7397 Merge branch 'restructure-outputs' into modesetting.
Outputs and Crtcs now have a driver-independent representation which should
permit generic code to control RandR 1.2 and startup configuration.
2006-11-30 14:09:31 -08:00
Keith Packard 16e01b117b Oops. Don't try to use xf86RandR names, use xf86RandR12 instead.
Attempts to override functions in core server fail, so use
new names instead.
2006-11-30 11:55:29 -08:00
Keith Packard 27ca1c17aa Rename I830 randr functions to xf86 as they are becoming generic.
Change function names, create separate i830_randr.h header file
to contain definitions.
2006-11-30 11:39:37 -08:00
Eric Anholt 9e4e7d4fa2 Conditionally compile old-server compatibility code in.
This also replaces calls to compat code with the real names of the functions,
and slips #defines to an i830-namespaced version in when doing compat.
The current server version (7.1.99.2) is still left as requiring compat code,
since the version hasn't been bumped yet.

This also fixes some failures to call the compat code, and some failures to
actually compile the compat code.  Oops.
2006-11-28 16:37:46 -08:00
Eric Anholt dbb8135e10 Remove printing of the XFree86 screen mode list, and some other detritus. 2006-11-28 13:21:31 -08:00
Eric Anholt e8fb40ab10 Replace custom DDC mode list code with a copy of the X Server's.
The X Server now has most of the mode helper functions we want, and we can
start removing compilation of our copies when the server is new enough.
2006-11-28 11:17:21 -08:00
Keith Packard e8d1db3263 Move crtc/output config to sub-structure.
Place crtc/output in separate structure at head
of driver private structure. Use this from the config code
to make it driver-independent. Still lots of effectively driver
independent code that continues to use driver dependent stuff,
but that will change.
2006-11-27 12:01:47 -08:00
Keith Packard 2529863a1a Start output/crtc restructuring work. It compiles.
Outputs and Crtcs are now split between 'generic'
and 'driver specific' pieces in the hope that more code
will be able to migrate to the xf86-generic layer.

Right now, the code remains tangled together, significant
work remains to tease the pieces apart. First the code
needs to be made to actually work as-is though.
2006-11-26 16:44:17 -08:00
Keith Packard c4508c1cad RandR-based initial output configuration.
Using pre-init computed RandR information, make reasonable
default choices for the output configuration at startup time.
Either some preferred size or a size which yields 96dpi is chosen,
from which other monitors are set to a similar size. The largest
size sets the screen size.

This needs to be extended to respect config file settings, but
those have not been defined yet.
2006-11-16 21:09:23 -08:00
Eric Anholt 3955f044cf Expose the DDC-probed EDID data as the EDID_DATA output property. 2006-11-09 20:28:46 -08:00
Keith Packard 9681602177 Create I830PipeRec to hold pipe-specific data. Remove unused I830 members.
I830 contained six parallel arrays for pipe-specific data; these
have been moved to a I830PipeRec structure instead.

I830 also contained several unused members:

   unsigned int bios_version;
   Bool newPipeSwitch;
   Bool fakeSwitch;
   int fixedPipe;

These have been removed, along with the code that set them.
2006-11-03 12:55:25 -08:00
Eric Anholt 7971c40155 Attempt to pull monitor physical size information out of DDC EDID data. 2006-11-01 12:42:56 -08:00
Eric Anholt fb94c12109 Move mode lists from per-pipe to per-output.
This should let RandR do the right thing in exposing the modes to userland.

As a side effect of getting this working, the SDVO pixel clock range code
was fixed and the mode valid tests for various outputs got extended.  Also,
LVDS grew a get_modes for the fixed panel mode.

Note that we now no longer do automatic enabling of outputs at xrandr -s 0,
hotkey, or VT switch.  That will be left to generic RandR code later.  Also,
generic modes and user-defined modes are once again not validated into the
lists, so this is a regression there.
2006-11-01 12:23:50 -08:00
Eric Anholt 7195dfabd5 Give each output a get_modes function and expose those modes through RandR.
The get_modes should return the probed modes only.  The driver should then
append to the list (for example, compatible modes listed in other outputs,
or standard VESA modes) to create the list to expose through RandR.  That
isn't done yet.
2006-10-31 17:10:08 -08:00
Eric Anholt 68cef9f4e0 Move output connection detection to a per-output method.
This will be used by RandR, and should let us clean up some of the initial
display configuration, hopefully.

Also, analog hotplug-based detection is now enabled on G965.
2006-10-31 14:32:00 -08:00
Eric Anholt e7d546cac0 Remove some dead code from BIOS modesetting. 2006-10-30 11:24:43 -08:00
Eric Anholt cd2f0d948a Clean up SDVO code, moving the private structure internal and cleaning up caps.
All the SDVO code should now be in lower case rather than StudlyCaps.

This also adjusts the I2C setup to create a bus per SDVO output we set up.
The previous setup with shared buses was failing in some circumstances, which
is probably due to the lack of refcounting in xf86i2c.c.
2006-10-25 12:21:57 -07:00
Keith Packard cd9c6e2914 Merge branch 'modesetting-origin' into modesetting 2006-10-24 16:53:46 -07:00
Eric Anholt eec5580cef Merge branch 'overhaul' into modesetting 2006-10-23 14:52:55 -07:00
Eric Anholt 317cc119c5 Move per-output mode setting code to per-output methods.
This is not a very clean interface, as a number of outputs require tweaks to
the DPLL registers.  When possible, the DPLLs are just adjusted in the
per-output post_set_mode, which happens just after the DPLL is enabled.
However, this seems better than the previous method of having all outputs
programmed in the same function.
2006-10-09 11:49:37 -07:00
Keith Packard bf3820f1f5 Compute LVDS resolution from server DPI and native panel size.
I was unable to find the native LVDS panel physical size in the BDB
information. I would prefer to report accurate information through RandR if
possible though.
2006-10-06 21:57:26 -07:00
Eric Anholt 9bb7736ab3 Remove checks for output privates in various bits of code.
Now, the output is only set up if it fully initializes, so it will never exist
if the private it requires doesn't.
2006-10-05 16:16:45 -07:00
Keith Packard 5a06000248 Add mode origins for randr 2006-10-04 18:43:07 -07:00
Eric Anholt 1407a42c73 Merge branch 'randr-1.2' into modesetting 2006-09-27 13:33:23 -07:00
Keith Packard c34490bbda Construct default monitor description for hotplug non-DDC monitor.
When detecting a monitor that doesn't support DDC, construct a default
monitor with "sensible" values instead of using whatever the builtin LCD
screen uses. Clearly we need a way to set the monitor parameters when we
cannot detect them.
2006-09-23 12:00:43 +01:00
Eric Anholt c52242c227 Remove some dead code related to clock ranges. 2006-09-22 10:52:03 -07:00
Keith Packard f6500e94fe Update driver for RandR 1.2 X server API.
This is not entirely what I'd like to see, but it's at least functional.

Limitations:
	Can't disable/enable crtcs
	Can't move outputs on/off crtcs

But, it does handle monitor hot-plug, detecting changes in VGA and SDVO
status on-the fly. Which makes for good demo material.
2006-09-20 22:38:55 -07:00
Adam Jackson e5c572f841 Fix a braino in mode list pruning.
Interpreting the size of the display in centimeters as the size in pixels,
and then clipping the modes list based on that, rarely does what you want.
2006-08-02 20:47:12 -04:00
Eric Anholt 6a92a77964 Don't try to probe on more pipes than we really have. 2006-07-14 14:20:41 -07:00
Adam Jackson de470aaf5c In I830xf86SortModes, catch cases where two modes are equal in only one
dimension, by comparing the areas of the modes.  Otherwise, 800x600 would
sort before 1024x600 if it was added later.
2006-07-13 19:10:11 -04:00
Adam Jackson 22843830eb Fix a thinko; would only inject the FP native mode if a mode list was already
found, which is never the case when there's no xorg.conf.
2006-07-13 17:20:17 -04:00
Eric Anholt b65f18b05a Bug #7443: Respect the user's Modes configuration, and make it more useful.
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.
2006-07-11 13:30:24 -07:00
Eric Anholt 5a2e04bd1b Fix crash with DDC when there are no user modes to add. 2006-07-11 10:21:51 -07:00
Eric Anholt f5a01a2ef0 Make DVO code light up my sil164-based DVI output, when already set up by BIOS. 2006-07-10 17:19:19 -07:00
Eric Anholt 23a0ee73bc Fix modelist with a configured monitor to not begin with all unvalidated modes. 2006-07-10 17:16:18 -07:00
Eric Anholt e1064f52b0 Don't try to probe modes on an SDVO device with NULL sdvo_drv. 2006-07-05 16:00:03 -07:00
Eric Anholt 48f27ac621 Replace i830InjectModes with i830DuplicateModes usage.
The remaining functionality of DuplicateModes was OBE, and the name was bad.
2006-06-28 15:07:01 +02:00
Eric Anholt ce5bd108c5 Validate and insert user and VESA standard modes for DDC or configured fallback.
This isn't really tested because I lack a good CRT to test against currently.
2006-06-28 14:21:49 +02:00
Eric Anholt 367f69f8e7 Replace xf86ValidateModes usage with a set of custom validators and pruning.
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.
2006-06-28 13:10:02 +02:00
Eric Anholt 56f7aedd0a Fix randr current mode reporting and mode loss/mis-configuration on re-randr. 2006-06-27 00:37:56 +02:00
Eric Anholt 7104b915da Clean up warnings. 2006-06-26 15:11:13 +02:00
Eric Anholt f113e9002c Fix the plane/pipe disabling and turn off missing outputs when no longer DDCed. 2006-06-26 12:54:30 +02:00
Eric Anholt d2c18d8d79 Fix DDC probing after last (untested) commit. 2006-06-26 10:15:11 +02:00
Eric Anholt 52e8231a19 Major cleanup of mode reprobing:
- 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.
2006-06-26 07:46:28 +02:00
Eric Anholt f5e5f8aedd WIP to allow re-probing and validation of modes for new heads at "xrandr" time.
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.
2006-06-23 23:29:55 -07:00
Eric Anholt 89791914d2 Split probed modes out per pipe, and union them into the available modes.
This is the first stage of getting runtime monitor attachment.  The old i830
GTF code is returned to use to provide suitable modelines for xf86ValidateModes
in the LVDS case, even though the LVDS doesn't care about the modeline and just
always programs its fixed values.
2006-06-23 18:21:17 -07:00
Eric Anholt bb48105216 Move FP mode validation next to other mode validation code. 2006-06-22 09:38:27 -07:00
Keith Packard 34f6a8204f Get sDVO output working on mac mini.
Add lots of register debugging to track delta from BIOS settings.
Fix various mode settings to mirror BIOS sDVO values.
Disable analog/lvds output on pipe with sDVO.
Borrow Dave Airlie's I830xf86ValidateDDCModes code.
Fix various sDVO I2C messages to mirror Dave's code.
2006-06-04 00:15:06 -07:00
Keith Packard c26f0737e2 Merge in master to modesetting 2006-04-10 19:41:41 -07:00
Alan Hourihane 39bdfbb4c2 x86_64 warning fixes 2006-04-10 11:26:06 -07:00