xf86Crtc.h revision 45e9809aff7304721fddb95654901b32195c9c7a
9384cec630155c229c70dfb8a445c6ccf433045aJohann 'Myrkraverk' Oskarsson * Copyright © 2006 Keith Packard
e50226eccc6dfcba3cc6f0df38438900e3df225cYuri Pankov * Permission to use, copy, modify, distribute, and sell this software and its
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * documentation for any purpose is hereby granted without fee, provided that
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * the above copyright notice appear in all copies and that both that copyright
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * notice and this permission notice appear in supporting documentation, and
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * that the name of the copyright holders not be used in advertising or
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * publicity pertaining to distribution of the software without specific,
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * written prior permission. The copyright holders make no representations
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * about the suitability of this software for any purpose. It is provided "as
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * is" without express or implied warranty.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * OF THIS SOFTWARE.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore/* Compat definitions for older X Servers. */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoretypedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amoretypedef struct _xf86Output xf86OutputRec, *xf86OutputPtr;
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore/* define a standard for connector types */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Turns the crtc on/off, or sets intermediate power levels if available.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Unsupported intermediate modes drop to the lower power setting. If the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * mode is DPMSModeOff, the crtc must be disabled sufficiently for it to
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * be safe to call mode_set.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Saves the crtc's state for restoration on VT switch.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Restore's the crtc's state at VT switch.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Lock CRTC prior to mode setting, mostly for DRI.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Returns whether unlock is needed
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Unlock CRTC after mode setting, mostly for DRI
e50226eccc6dfcba3cc6f0df38438900e3df225cYuri Pankov * Callback to adjust the mode to be set in the CRTC.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * This allows a CRTC to adjust the clock or even the entire set of
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * timings, which is used for panels with fixed timings or for
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * buses with clock limitations.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Prepare CRTC for an upcoming mode set.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Callback for setting up a video mode after fixups have been made.
e50226eccc6dfcba3cc6f0df38438900e3df225cYuri Pankov int x, int y);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Commit mode changes to a CRTC
e50226eccc6dfcba3cc6f0df38438900e3df225cYuri Pankov /* Set the color ramps for the CRTC to the given values. */
e50226eccc6dfcba3cc6f0df38438900e3df225cYuri Pankov (*gamma_set)(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Allocate the shadow area, delay the pixmap creation until needed
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*shadow_allocate) (xf86CrtcPtr crtc, int width, int height);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Create shadow pixmap for rotation support
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*shadow_create) (xf86CrtcPtr crtc, void *data, int width, int height);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Destroy shadow pixmap
e50226eccc6dfcba3cc6f0df38438900e3df225cYuri Pankov (*shadow_destroy) (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Set cursor colors
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*set_cursor_colors) (xf86CrtcPtr crtc, int bg, int fg);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Set cursor position
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*set_cursor_position) (xf86CrtcPtr crtc, int x, int y);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Show cursor
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Hide cursor
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Load monochrome image
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Load ARGB image
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Clean up driver-specific bits of the crtc
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Less fine-grained mode setting entry point for kernel modesetting
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*set_mode_major)(xf86CrtcPtr crtc, DisplayModePtr mode,
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Callback for panning. Doesn't change the mode.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Added in ABI version 2
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore (*set_origin)(xf86CrtcPtr crtc, int x, int y);
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * ABI versioning
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Associated ScrnInfo
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Desired state of this CRTC
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Set when this CRTC should be driving one or more outputs
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Active mode
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * This reflects the mode as set in the CRTC currently
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * It will be cleared when the VT is not active or
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * during server startup
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Position on screen
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Locates this CRTC within the frame buffer
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Desired mode
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * This is set to the requested mode, independent of
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * whether the VT is active. In particular, it receives
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * the startup configured mode and saves the active mode
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * on VT switch.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore /** crtc-specific functions */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Driver private
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Holds driver-private information
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * When RandR 1.2 is available, this
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * points at the associated crtc object
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Current cursor is ARGB
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Track whether cursor is within CRTC range
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Track state of cursor associated with this CRTC
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Current transformation matrix
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore /* framebuffer_to_crtc was removed in ABI 2 */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore struct pict_f_transform f_crtc_to_framebuffer; /* ABI 2 */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore struct pict_f_transform f_framebuffer_to_crtc; /* ABI 2 */
9384cec630155c229c70dfb8a445c6ccf433045aJohann 'Myrkraverk' Oskarsson int filter_height; /* ABI 2 */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore RRTransformRec desiredTransform; /* ABI 2 */
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Bounding box in screen space
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * TotalArea: total panning area, larger than CRTC's size
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * TrackingArea: Area of the pointer for which the CRTC is panned
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * border: Borders of the displayed CRTC area which induces panning if the pointer reaches them
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Added in ABI version 2
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Current gamma, especially useful after initial config.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Added in ABI version 3
429d0af29b3b9031688dd2fb16ecefb28f060e2eGarrett D'Amore * Actual state of this CRTC
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * Set to TRUE after modesetting, set to FALSE if no outputs are connected
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * Added in ABI version 3
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * Clear the shadow
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Called to allow the output a chance to create properties after the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * RandR objects have been created.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Turns the output on/off, or sets intermediate power levels if available.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Unsupported intermediate modes drop to the lower power setting. If the
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * mode is DPMSModeOff, the output must be disabled, as the DPLL may be
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * disabled afterwards.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Saves the output's state for restoration on VT switch.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Restore's the output's state at VT switch.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Callback for testing a video mode for a given output.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * This function should only check for cases where a mode can't be supported
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * on the output specifically, and not represent generic CRTC limitations.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * \return MODE_OK if the mode is valid, or another MODE_* otherwise.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Callback to adjust the mode to be set in the CRTC.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * This allows an output to adjust the clock or even the entire set of
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * timings, which is used for panels with fixed timings or for
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * buses with clock limitations.
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * Callback for preparing mode changes on an output
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * Callback for committing mode changes on an output
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * Callback for setting up a video mode after fixups have been made.
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * This is only called while the output is disabled. The dpms callback
c530934a778b6ba8ad55ddb0e3bbee8faa6260b0Garrett D'Amore * must be all that's necessary for the output, to turn the output on
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * after this function is called.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Probe for a connected output, and return detect_status.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Query the device for the modes it provides.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * This function may also update MonInfo, mm_width, and mm_height.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * \return singly-linked list of modes or NULL if no modes found.
9384cec630155c229c70dfb8a445c6ccf433045aJohann 'Myrkraverk' Oskarsson (*get_modes)(xf86OutputPtr output);
9384cec630155c229c70dfb8a445c6ccf433045aJohann 'Myrkraverk' Oskarsson * Callback when an output's property has changed.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Callback to get an updated property value
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Callback to get current CRTC for a given output
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Clean up driver-specific bits of the output
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * ABI versioning
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Associated ScrnInfo
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Currently connected crtc (if any)
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * If this output is not in use, this field will be NULL.
84441f85b19f6b8080883f30109e58e43c893709Garrett D'Amore * Possible CRTCs for this output as a mask of crtc indices
int subpixel_order;
char *name;
void *driver_private;
#ifdef RANDR_12_INTERFACE
void *randr_output;
typedef struct _xf86CrtcConfigFuncs {
int width,
int height);
typedef struct _xf86CrtcConfig {
int num_output;
int compat_output;
int num_crtc;
unsigned int dga_flags;
unsigned long dga_address;
int dga_nmode;
#define XF86_CRTC_CONFIG_PTR(p) ((xf86CrtcConfigPtr) ((p)->privates[xf86CrtcConfigPrivateIndex].ptr))
if (!compat_output)
return NULL;
if (!compat_crtc)
return NULL;
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
const char *name);
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
#ifdef RANDR_13_INTERFACE
# define ScreenInitRetType int
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
#ifdef XFreeXDGA
extern _X_EXPORT void
extern _X_EXPORT char *
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void
extern _X_EXPORT void