Commit Graph

673 Commits

Author SHA1 Message Date
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 9948d8377d Merge branch 'master' into modesetting
Conflicts:

	src/i830.h
	src/i830_cursor.c
	src/i830_dri.c
	src/i830_driver.c
	src/i830_video.c
2006-11-16 19:47:24 -08:00
Keith Packard 45a27f80e1 Remove output options. Let outputs be connected to other crtcs.
Output options will be replaced by properties.
Permits outputs to be connected to arbitrary CRTCs (within hardware limits).
No cloning yet.
2006-11-16 13:38:35 -08:00
Keith Packard 9aea79d1e9 Inverted boolean sense when selecting pipe for CRT detection.
Pipes are available when they are not in use.
2006-11-16 11:40:26 -08:00
Eric Anholt 4889b9f333 Enable the LVDS if we find it and assign it to a pipe (oops). 2006-11-15 15:26:31 -08:00
Eric Anholt 854ff826c0 Disable setup of the second SDVO device until we fix it. 2006-11-14 09:14:24 -08:00
Eric Anholt d51555fba4 Fix clock range for single-channel LVDS. 2006-11-10 14:40:44 -08:00
Eric Anholt dd1dcfab0a Fill in some of the high bits of mode timings for SDVO. 2006-11-10 11:08:02 -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 0f5886689d Create RandR 1.2 objects in I830PreInit.
Creating the objects early will allow the driver to use
randr structures to select a reasonable configuration.
That part has not been done yet.
2006-11-08 23:19:59 -08:00
Keith Packard 81b7b489af Adapt to RandR updates that split object creation from screen association.
RandR DIX code is preparing for xf86 drivers that want to allocate RandR
objects at PreInit time. This patch adapts to that change without taking
advantage of it.
2006-11-08 21:38:00 -08:00
Keith Packard 81bace0c31 Merge branch 'modesetting-keithp' into modesetting
Conflicts in PipeSetMode were resolved to use the keithp changes
that pushed more modesetting stuff into the per-pipe function.

Switched availablePipes to num_pipes.

Used modesetting default output configuration.
2006-11-08 20:23:20 -08:00
Eric Anholt 713c5b0899 Change the output and pipe "is it on/off" field name to "enabled". 2006-11-08 19:55:31 -08:00
Eric Anholt ff77e9d84f Clean up i830_crt_detect_load() a bit more.
ADPA might not have been set right in some cases (DPMS-off monitor, for
example), and a wait for vsync that the bios does was missing.
2006-11-08 19:53:31 -08:00
Eric Anholt 9b267014b5 Go back to only setting up outputs that have a display connected. 2006-11-08 19:39:18 -08:00
Eric Anholt 35ab689bbd Fix i830DisableUnusedFunctions after pipe structure change.
Using "pipe" instead of the index "i" meant pipe(3) got referenced instead of
a nice small integer.  Oops.
2006-11-08 19:35:49 -08:00
Alan Hourihane b649f95ea6 Disable some debug message 2006-11-08 19:01:25 +00:00
Keith Packard f1ff01e31e Eliminate operatingDevices member and PIPE_* values.
operatingDevices and MonType1/MonType2 duplicate information already stored
in the device structures. Eliminate them and replace uses with direct
references to the appropriate other data.
(cherry picked from 3ab7f96932 commit)
2006-11-07 15:17:27 -08:00
Keith Packard 0b2d36d4f0 Use pI830->availablePipes instead of MAX_DISPLAY_PIPES everywhere
(cherry picked from e4bcec796e commit)
2006-11-07 15:13:23 -08:00
Eric Anholt d0ef9e99ac Restore PFIT_CONTROL before turning the LVDS back on in the restore method. 2006-11-06 18:30:46 -08:00
Eric Anholt 94a3731c2b Move PFIT_CONTROL disable for G965 up before post_set_mode.
Also, remove setting of some other random registers that appears to have
been spammed in at the same time, and don't try to disable on the I830, before
this register existed.
2006-11-06 18:28:55 -08:00
Keith Packard beb89163d7 DSPSURF must be page aligned. Place intra-screen offset in DSPBASE.
DSPASURF/DSPBSURF can only take page aligned values, ignoring
the lower order bits. So, place the offset for the output
within the frame buffer in the DSPABASE/DSPBBASE registers instead.
2006-11-05 19:06:45 -08:00
Keith Packard 997e8c9bb4 Don't allocate stuff in the first 256K of video memory (GATT?)
Letting the ring buffer or other objects be allocated within the lowest
portion of memory appears to trash some memory mapping data; I'm assuming
this is the GATT table on the 965. Just marking this out of bounds for
allocation fixes this problem.
2006-11-05 18:56:33 -08:00
Keith Packard 5a355c7261 Fix CRT output on 965 chipset.
A few more register settings are needed to get CRT output working on the
965 chipset, in particular the the SDVO/UDI clock multiplier register
needed to get set to the default value (3). No, I really don't know what
this does, but it does get the CRT running at a wide range of sizes.
2006-11-05 18:51:28 -08:00
Keith Packard 68c3185046 Avoid crashing when disabling sdvo output. XXX 2006-11-05 13:30:32 -08:00
Keith Packard 15ef08046b Move remaining pipe mode setting logic to i830PipeSetMode 2006-11-05 13:29:56 -08:00
Keith Packard 7fcb555735 Rename availablePipes to num_pipes 2006-11-04 00:52:21 -08:00
Keith Packard 3ab7f96932 Eliminate operatingDevices member and PIPE_* values.
operatingDevices and MonType1/MonType2 duplicate information already stored
in the device structures. Eliminate them and replace uses with direct
references to the appropriate other data.
2006-11-04 00:46:18 -08:00
Keith Packard e4bcec796e Use pI830->availablePipes instead of MAX_DISPLAY_PIPES everywhere 2006-11-03 23:29:12 -08:00
Keith Packard b7262a9a91 Finish removing persistant vbe data 2006-11-03 23:24:07 -08:00
Keith Packard 4625073244 Oops, martian memset of randr modes pointer 2006-11-03 23:23:38 -08:00
Keith Packard 719ad68515 Use VBE only temporarily to fetch BIOS rom image
(cherry picked from 6a9386651785afc70a29e355255e8295b321f28e commit)
2006-11-03 21:48:45 -08:00
Eric Anholt 27df2ff790 Report pipe status (and status mismatches) in i830DescribeOutputConfiguration() 2006-11-03 16:39:49 -08:00
Eric Anholt ecbe73b940 Merge branch 'modesetting-origin' into modesetting
Conflicts:

	src/i830_display.c
2006-11-03 15:59:59 -08:00
Eric Anholt 561af00797 Add support for load-based CRT detection. 2006-11-03 15:57:34 -08:00
Eric Anholt e416b426d8 Print out modelines as info, not error (which had been used for debugging). 2006-11-03 15:25:41 -08:00
Eric Anholt 282a9e073e Don't memset the modes pointer on init, which was dereferencing NULL. 2006-11-03 13:46:09 -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 0510671a6c Fix a pasteo in I965 register restore. 2006-11-03 10:58:46 -08:00
Keith Packard 2c9ab6e059 set the v_sync_off_high to zero. XXX should check docs 2006-11-02 13:44:59 -08:00
Keith Packard 56f6d4f1bb Disable the panel fitter when not using it. Cleans up SDVO DVI output.
The panel fitter appears to exist on the 965 hardware (at least) and
causes troubles with DVI output over SDVO when enabled. This patch
checks to see if the panel fitter is pointing at the pipe being configured
and disables it unconditionally in that case. The LVDS driver will configure
it correctly if necessary afterwards.
2006-11-02 13:44:59 -08:00
Keith Packard f22d9bcc25 Add another couple of new registers 2006-11-02 13:44:59 -08:00
Eric Anholt a9eac38bcd Remove duplicated register defs that were just added. 2006-11-02 13:24:54 -08:00
Eric Anholt 7887c76062 Add airlied's I2C code, ifdeffed out.
I've gone back to compare our behavior to it several times, so I'll just keep
the code in tree for now.
2006-11-02 13:19:06 -08:00
Eric Anholt 87b15cfbf7 Remove dead specifiedMonitor field. 2006-11-02 13:16:44 -08:00
Keith Packard 2636d68663 Dump more registers for debug purposes 2006-11-02 11:57:11 -08:00
Keith Packard 786ec54c4c Add a few more registers from the 965 spec 2006-11-02 11:56:50 -08:00
Keith Packard 85e32ad2da ch7xxxSaveRegs receives real type instead of void * 2006-11-02 11:56:12 -08:00
Eric Anholt ffbd6ca09b Remove dead VESARec struct. 2006-11-01 13:05:44 -08:00
Eric Anholt 97c3a1b242 Remove the refresh rate appended to some mode names.
This gets the SDVO and CRT outputs I have to have at least 1 common mode
according to RandR.
2006-11-01 13:04:08 -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 f30d7f912f Update for the move of RandR phyiscal size information. 2006-11-01 11:50:51 -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 cc3728be24 Add compat definitions for M_T_PREFERRED and M_T_DRIVER for older X Servers. 2006-10-31 15:00:36 -08:00
Eric Anholt a71f283650 Connect output detection up to RandR. 2006-10-31 14:46:23 -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 9fd719fce2 Move SDVOB_PRESERVE_MASK next to SDVOC_PRESERVE_MASK. 2006-10-31 14:29:44 -08:00
Eric Anholt 4f5d4d8870 i830SetLVDSPanelPower is now a static function in i830_lvds.c, so remove it. 2006-10-31 13:37:23 -08:00
Eric Anholt 49bbdf16c0 Fix many inconsistencies in the SDVO code compared to the spec.
Also, fix some struct padding  so that the right bits are sent out.
2006-10-31 11:42:03 -08:00
Eric Anholt e7d546cac0 Remove some dead code from BIOS modesetting. 2006-10-30 11:24:43 -08:00
Eric Anholt 2ca57040b0 Remove GetBIOSVersion().
This info hardly useful now that we don't use the BIOS for mode setting.
2006-10-30 11:19:19 -08:00
Eric Anholt 837b2f6320 Warning fix. 2006-10-30 11:17:55 -08:00
Eric Anholt bca9e6ccbd Remove SetPipeAccess and now-unnecessary VBE reinit. 2006-10-30 11:17:27 -08:00
Eric Anholt 819a47b27c Use the new fields for SDVO pixel multiply on the G965.
This should fix display at resolutions/refresh rates in a different multiplier
class than the console display (generally, high resolution modes).
2006-10-30 11:00:20 -08:00
Eric Anholt 71545db461 Return and use valid status bits for i830_sdvo_get_trained_inputs(). 2006-10-30 09:46:10 -08:00
Eric Anholt c357eca10c Clean up whitespace in i830_randr.c. 2006-10-30 09:44:55 -08:00
Wang Zhenyu fbb376bd1a Bug 8594: Fix Xv hang with G965 2006-10-30 14:15:12 +08:00
Thomas Hellstrom c0ee50c4ee Add support for the new DRM memory manager.
Some code are duplicated with the new libdrm.
Once this code has been released with xserver,
it can be removed.

See the man page for new options and backwards
3D driver compatibility.
2006-10-27 19:13:33 +02:00
Eric Anholt 25e6e49782 Major cleanup of 3D invariant state, fixing hangs with rotation and render.
Now, the generic invariant state is always set while the X Server is active,
and happens automatically when the X Server grabs the DRI lock.  More 3D state
is moved to the generic code.

Then, the 3D consumers (video, rotation, render) set last_3d to their enum
entry, and can update their own invariant state when another consumer was
active.
2006-10-26 15:47:49 -07:00
Eric Anholt 0bdcce2e45 Note alignment requirement for i915 3D (texturing). 2006-10-26 14:30:46 -07:00
Eric Anholt c3666a968b Don't write unused values beyond the end of scale_units array. 2006-10-26 14:30:25 -07:00
Eric Anholt 3ab9f5a4a8 Move vbeInfo out of the driver struct to the one place it's used. 2006-10-25 16:11:06 -07:00
Eric Anholt df14838eb5 Remove dead memsize reporting.
The calculation no longer made sense, as we don't use the BIOS for mode
selection.
2006-10-25 16:11:06 -07:00
Eric Anholt 3a6104ab89 Remove disabled I830DetectMonitorChange().
This used to be called when switching back in to X.  It might make some sense
to detect monitors at this time (it happens to occur at resume time, when
monitors are likely to have changed), but it should probably live in either
userland policy with RandR 1.2 or RandR 1.2 XFree86-DDX generic code.
2006-10-25 16:11:06 -07:00
Eric Anholt 88c12f577f Move LVDS initialization and blacklisting damage to the LVDS support file. 2006-10-25 16:11:05 -07:00
Eric Anholt 2631014e9d Clean up the SDVO code.
The main change is to send SDVO commands using data passed into the send
command function, and receive responses into memory passed into the read
response function, rather than stuff things in/out through dev_priv->sdvo_regs.
This lets us use structures to represent some arguments, which results in a
nice cleanup (and 100% fewer arguments named magicN as a side effect).

Also, the mode set path is changed to not do any preferred input timing
work.  We weren't doing anything legitimate with the results, since we didn't
modify the CRTC timing appropriately, so now we just stuff the CRTC timing into
both and hope for the best.  This should probably be revisited later.
2006-10-25 12:21:57 -07:00
Eric Anholt ddb986e54f Nuke trailing whitespace in SDVO code not already cleaned up. 2006-10-25 12:21:57 -07: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 a91c0cbab5 Add work-in-progress integrated TV-out support.
This is the TV connector on board for the 915GM and 945GM.

It is currently not hooked up to output initialization as it's entirely
untested.  However, I think this is a reasonable starting point for getting
TV-out actually working.
2006-10-23 14:30:38 -07:00
Alan Hourihane 7d67324fa3 Add some MergedFB checks for accelerator limitations 2006-10-23 17:29:17 +01:00
Michel Dänzer 5ac927d6f0 Don't crash if SetCursorPosition is called with pScrn->currentMode == NULL.
This allows the driver to work with servers that don't have the fix for this
that was only recently pushed to git.
2006-10-17 13:28:54 +02:00
Eric Anholt 8149681f2e Add a per-output mode-valid method.
This is currently disconnected, but will be used in more overhaul work.
This should be where any output limitations, such as clocks, resolution,
scaling limits, or other options, are validated.  Other limitations, such as
chipset resolution limits, CRTC clock limits, etc. should be elsewhere.
2006-10-16 16:51:04 -07:00
Keith Packard c5cca4c20a Advertise textured video adapter first 2006-10-13 15:31:43 -07:00
Alan Hourihane adae75ef2f Make VIDEO_DEBUG into a configure option 2006-10-13 17:10:27 +01:00
Alan Hourihane 1d4cfaa391 Bump to 1.7.2 2006-10-13 13:55:10 +01:00
Alan Hourihane cd9e51cd3a Ugh. Turn off debugging. 2006-10-13 13:54:31 +01:00
Alan Hourihane 334aa062c3 Bump to 1.7.1 2006-10-13 12:59:30 +01:00
Alan Hourihane 8045a7a0af Fix bug #8553 & #8542 - suspend/resume regression from 1.5 driver 2006-10-13 12:53:53 +01:00
Alan Hourihane 6596333b07 Fix some warnings 2006-10-13 12:48:16 +01:00
Eric Anholt 1838671476 Only disable the output when marked disabled.
Also, remove a couple of dead variables.
2006-10-10 12:41:01 -07:00
Eric Anholt 2591c1fcf1 Fix LVDS restore path, and move pipe assignment for outputs to the right place. 2006-10-09 14:20:49 -07:00
Eric Anholt 09e3d10b0f Add a function for describing the output connection configuration. 2006-10-09 13:09:39 -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
Adam Jackson 53c28b3980 Expand the check for AOpen Mini-PC.
Just match on subsystem vendor, don't bother inspecting the subsystem device
ID, since apparently they're all busted.
2006-10-07 11:18:26 -04: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
Alan Hourihane c7a23908a0 Fix server regeneration problem mapping the aperture 2006-10-06 13:35:39 +01:00
Keith Packard d649fb0d96 Don't require MonitorLayout when two monitors are plugged in.
With randr12 working, we can just leave the second monitor off for now.
2006-10-05 22:46:07 -07:00