diff options
author | Keith Packard <keithp@dulcimer.keithp.com> | 2007-05-16 14:02:00 -0700 |
---|---|---|
committer | Keith Packard <keithp@dulcimer.keithp.com> | 2007-05-16 14:02:00 -0700 |
commit | c0daa0a982e7074af4b50653b4a45b0a6352b43d (patch) | |
tree | 784a6d552d5ff6e957d5a5fefac99f206f654c46 /src/i2c_vid.h | |
parent | b28817a87a1608e849e4a9a736dda43533a84b0c (diff) |
Change DVO module interface to pass more state across. Fix IVCH display.
The DVO module interface reflected most of the xf86Output API to the
underlying functions; finish that work given the changes that have since
occurred in the xf86Output API.
Move the LVDS-specific code into the IVCH module and make that work on the
Thinkpad X30 (an i830-based laptop). Panel scaling does not work yet.
Diffstat (limited to 'src/i2c_vid.h')
-rw-r--r-- | src/i2c_vid.h | 136 |
1 files changed, 131 insertions, 5 deletions
diff --git a/src/i2c_vid.h b/src/i2c_vid.h index 3be394d7..1a21fcad 100644 --- a/src/i2c_vid.h +++ b/src/i2c_vid.h @@ -1,16 +1,142 @@ -/* this needs to go in the server */ +/* + * Copyright © 2006 Eric Anholt + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + #ifndef I2C_VID_H #define I2C_VID_H +#include <randrstr.h> typedef struct _I830I2CVidOutputRec { + /** + * Initialize the device at startup time. + * Returns NULL if the device does not exist. + */ void *(*init)(I2CBusPtr b, I2CSlaveAddr addr); - xf86OutputStatus (*detect)(I2CDevPtr d); - ModeStatus (*mode_valid)(I2CDevPtr d, DisplayModePtr mode); - void (*mode_set)(I2CDevPtr d, DisplayModePtr mode); + + /** + * Setup the device for use, after the relevant output has been created + */ + Bool + (*setup) (I2CDevPtr d, xf86OutputPtr output); + + /** + * Called to allow the output a chance to create properties after the + * RandR objects have been created. + */ + void + (*create_resources)(I2CDevPtr d); + + /** + * Turns the output on/off, or sets intermediate power levels if available. + * + * Unsupported intermediate modes drop to the lower power setting. If the + * mode is DPMSModeOff, the output must be disabled, as the DPLL may be + * disabled afterwards. + */ void (*dpms)(I2CDevPtr d, int mode); - void (*dump_regs)(I2CDevPtr d); + + /** + * Saves the output's state for restoration on VT switch. + */ void (*save)(I2CDevPtr d); + + /** + * Restore's the output's state at VT switch. + */ void (*restore)(I2CDevPtr d); + + /** + * Callback for testing a video mode for a given output. + * + * This function should only check for cases where a mode can't be supported + * on the output specifically, and not represent generic CRTC limitations. + * + * \return MODE_OK if the mode is valid, or another MODE_* otherwise. + */ + int (*mode_valid)(I2CDevPtr d, DisplayModePtr mode); + + /** + * Callback to adjust the mode to be set in the CRTC. + * + * This allows an output to adjust the clock or even the entire set of + * timings, which is used for panels with fixed timings or for + * buses with clock limitations. + */ + Bool (*mode_fixup)(I2CDevPtr d, DisplayModePtr mode, DisplayModePtr adjusted_mode); + + /** + * Callback for preparing mode changes on an output + */ + void (*prepare)(I2CDevPtr d); + + /** + * Callback for committing mode changes on an output + */ + void (*commit)(I2CDevPtr d); + + /** + * Callback for setting up a video mode after fixups have been made. + * + * This is only called while the output is disabled. The dpms callback + * must be all that's necessary for the output, to turn the output on + * after this function is called. + */ + void (*mode_set)(I2CDevPtr d, DisplayModePtr mode, DisplayModePtr adjusted_mode); + + /** + * Probe for a connected output, and return detect_status. + */ + xf86OutputStatus (*detect)(I2CDevPtr d); + + /** + * Query the device for the modes it provides. + * + * This function may also update MonInfo, mm_width, and mm_height. + * + * \return singly-linked list of modes or NULL if no modes found. + */ + DisplayModePtr + (*get_modes)(I2CDevPtr d); + +#ifdef RANDR_12_INTERFACE + /** + * Callback when an output's property has changed. + */ + Bool + (*set_property)(I2CDevPtr d, Atom property, RRPropertyValuePtr value); +#endif + + /** + * Clean up driver-specific bits of the output + */ + void (*destroy) (I2CDevPtr d); + + /** + * Debugging hook to dump device registers to log file + */ + void (*dump_regs)(I2CDevPtr d); } I830I2CVidOutputRec, *I830I2CVidOutputPtr; +/* XXX change this name to avoid driver-specific prefix */ +DisplayModePtr +i830_dvo_get_current_mode (xf86OutputPtr output); + #endif |