xserver-multidpi/hw/xfree86/common/xf86str.h

819 lines
25 KiB
C
Raw Normal View History

2003-11-14 17:48:57 +01:00
/*
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
2003-11-14 17:48:57 +01:00
*/
/*
* This file contains definitions of the public XFree86 data structures/types.
* Any data structures that video drivers need to access should go here.
*/
#ifndef _XF86STR_H
#define _XF86STR_H
#include "misc.h"
2003-11-14 17:48:57 +01:00
#include "input.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "colormapst.h"
2003-11-14 17:48:57 +01:00
#include "xf86Module.h"
#include "xf86Opt.h"
#include "displaymode.h"
/**
* Integer type that is of the size of the addressable memory (machine size).
* On most platforms \c uintptr_t will suffice. However, on some mixed
* 32-bit / 64-bit platforms, such as 32-bit binaries on 64-bit PowerPC, this
* must be 64-bits.
2003-11-14 17:48:57 +01:00
*/
#include <inttypes.h>
#if defined(__powerpc__)
typedef uint64_t memType;
#else
typedef uintptr_t memType;
#endif
2003-11-14 17:48:57 +01:00
/* Video mode flags */
typedef enum {
V_PHSYNC = 0x0001,
V_NHSYNC = 0x0002,
V_PVSYNC = 0x0004,
V_NVSYNC = 0x0008,
V_INTERLACE = 0x0010,
V_DBLSCAN = 0x0020,
V_CSYNC = 0x0040,
V_PCSYNC = 0x0080,
V_NCSYNC = 0x0100,
V_HSKEW = 0x0200, /* hskew provided */
V_BCAST = 0x0400,
V_PIXMUX = 0x1000,
V_DBLCLK = 0x2000,
V_CLKDIV2 = 0x4000
2003-11-14 17:48:57 +01:00
} ModeFlags;
typedef enum {
INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
2003-11-14 17:48:57 +01:00
} CrtcAdjustFlags;
/* Flags passed to ChipValidMode() */
typedef enum {
MODECHECK_INITIAL = 0,
MODECHECK_FINAL = 1
2003-11-14 17:48:57 +01:00
} ModeCheckFlags;
/*
* The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN.
* Preferred will bubble a mode to the top within a set.
*/
#define M_T_BUILTIN 0x01 /* built-in mode */
#define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
#define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */
#define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C)
2003-11-14 17:48:57 +01:00
/* built-in mode - configure CRTC and clock */
#define M_T_PREFERRED 0x08 /* preferred mode within a set */
#define M_T_DEFAULT 0x10 /* (VESA) default modes */
#define M_T_USERDEF 0x20 /* One of the modes from the config file */
#define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */
#define M_T_USERPREF 0x80 /* mode preferred by the user config */
2003-11-14 17:48:57 +01:00
/* The monitor description */
#define MAX_HSYNC 8
#define MAX_VREFRESH 8
typedef struct {
float hi, lo;
} range;
2003-11-14 17:48:57 +01:00
typedef struct {
CARD32 red, green, blue;
} rgb;
2003-11-14 17:48:57 +01:00
typedef struct {
float red, green, blue;
} Gamma;
2003-11-14 17:48:57 +01:00
/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
#define GAMMA_MAX 10.0
#define GAMMA_MIN (1.0 / GAMMA_MAX)
#define GAMMA_ZERO (GAMMA_MIN / 100.0)
typedef struct {
const char *id;
const char *vendor;
const char *model;
int nHsync;
range hsync[MAX_HSYNC];
int nVrefresh;
range vrefresh[MAX_VREFRESH];
DisplayModePtr Modes; /* Start of the monitor's mode list */
DisplayModePtr Last; /* End of the monitor's mode list */
Gamma gamma; /* Gamma of the monitor */
int widthmm;
int heightmm;
void *options;
void *DDC;
Bool reducedblanking; /* Allow CVT reduced blanking modes? */
int maxPixClock; /* in kHz, like mode->Clock */
2003-11-14 17:48:57 +01:00
} MonRec, *MonPtr;
/* the list of clock ranges */
typedef struct x_ClockRange {
struct x_ClockRange *next;
int minClock; /* (kHz) */
int maxClock; /* (kHz) */
int clockIndex; /* -1 for programmable clocks */
Bool interlaceAllowed;
Bool doubleScanAllowed;
int ClockMulFactor;
int ClockDivFactor;
int PrivFlags;
2003-11-14 17:48:57 +01:00
} ClockRange, *ClockRangePtr;
/*
* The driverFunc. xorgDriverFuncOp specifies the action driver should
* perform. If requested option is not supported function should return
* FALSE. pointer can be used to pass arguments to the function or
* to return data to the caller.
*/
typedef struct _ScrnInfoRec *ScrnInfoPtr;
/* do not change order */
typedef enum {
RR_GET_INFO,
RR_SET_CONFIG,
RR_GET_MODE_MM,
GET_REQUIRED_HW_INTERFACES = 10,
SUPPORTS_SERVER_FDS = 11,
} xorgDriverFuncOp;
typedef Bool xorgDriverFuncProc(ScrnInfoPtr, xorgDriverFuncOp, void *);
/* RR_GET_INFO, RR_SET_CONFIG */
typedef struct {
int rotation;
int rate;
int width;
int height;
} xorgRRConfig;
typedef union {
short RRRotations;
xorgRRConfig RRConfig;
} xorgRRRotation, *xorgRRRotationPtr;
/* RR_GET_MODE_MM */
typedef struct {
DisplayModePtr mode;
int virtX;
int virtY;
int mmWidth;
int mmHeight;
} xorgRRModeMM, *xorgRRModeMMPtr;
/* GET_REQUIRED_HW_INTERFACES */
#define HW_IO 1
#define HW_MMIO 2
#define HW_SKIP_CONSOLE 4
#define NEED_IO_ENABLED(x) (x & HW_IO)
typedef CARD32 xorgHWFlags;
2003-11-14 17:48:57 +01:00
/*
* The driver list struct. This contains the information required for each
* driver before a ScrnInfoRec has been allocated.
*/
struct _DriverRec;
typedef struct {
int driverVersion;
const char *driverName;
void (*Identify) (int flags);
Bool (*Probe) (struct _DriverRec * drv, int flags);
const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype);
void *module;
int refCount;
} DriverRec1;
struct _SymTabRec;
struct _PciChipsets;
struct pci_device;
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
struct xf86_platform_device;
2003-11-14 17:48:57 +01:00
typedef struct _DriverRec {
int driverVersion;
const char *driverName;
void (*Identify) (int flags);
Bool (*Probe) (struct _DriverRec * drv, int flags);
const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype);
void *module;
int refCount;
xorgDriverFuncProc *driverFunc;
const struct pci_id_match *supported_devices;
Bool (*PciProbe) (struct _DriverRec * drv, int entity_num,
struct pci_device * dev, intptr_t match_data);
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
Bool (*platformProbe) (struct _DriverRec * drv, int entity_num, int flags,
struct xf86_platform_device * dev, intptr_t match_data);
2003-11-14 17:48:57 +01:00
} DriverRec, *DriverPtr;
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
/*
* platform probe flags
*/
#define PLATFORM_PROBE_GPU_SCREEN 1
/*
* AddDriver flags
*/
#define HaveDriverFuncs 1
2003-11-14 17:48:57 +01:00
/*
* These are the private bus types. New types can be added here. Types
* required for the public interface should be added to xf86str.h, with
* function prototypes added to xf86.h.
*/
/* Tolerate prior #include <linux/input.h> */
#if defined(linux)
2003-11-14 17:48:57 +01:00
#undef BUS_NONE
#undef BUS_PCI
#undef BUS_SBUS
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
#undef BUS_PLATFORM
2003-11-14 17:48:57 +01:00
#undef BUS_last
#endif
typedef enum {
BUS_NONE,
BUS_PCI,
BUS_SBUS,
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
BUS_PLATFORM,
BUS_last /* Keep last */
2003-11-14 17:48:57 +01:00
} BusType;
typedef struct {
int fbNum;
2003-11-14 17:48:57 +01:00
} SbusBusId;
typedef struct _bus {
BusType type;
union {
struct pci_device *pci;
SbusBusId sbus;
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
struct xf86_platform_device *plat;
2003-11-14 17:48:57 +01:00
} id;
} BusRec, *BusPtr;
typedef enum {
DAC_BPP8 = 0,
DAC_BPP16,
DAC_BPP24,
DAC_BPP32,
MAXDACSPEEDS
} DacSpeedIndex;
2003-11-14 17:48:57 +01:00
typedef struct {
const char *identifier;
const char *vendor;
const char *board;
const char *chipset;
const char *ramdac;
const char *driver;
struct _confscreenrec *myScreenSection;
Bool claimed;
int dacSpeeds[MAXDACSPEEDS];
int numclocks;
int clock[MAXCLOCKS];
const char *clockchip;
const char *busID;
Bool active;
Bool inUse;
int videoRam;
unsigned long BiosBase; /* Base address of video BIOS */
unsigned long MemBase; /* Frame buffer base address */
unsigned long IOBase;
int chipID;
int chipRev;
void *options;
int irq;
int screen; /* For multi-CRTC cards */
2003-11-14 17:48:57 +01:00
} GDevRec, *GDevPtr;
typedef struct {
int frameX0;
int frameY0;
int virtualX;
int virtualY;
int depth;
int fbbpp;
rgb weight;
rgb blackColour;
rgb whiteColour;
int defaultVisual;
const char **modes;
void *options;
2003-11-14 17:48:57 +01:00
} DispRec, *DispPtr;
typedef struct _confxvportrec {
const char *identifier;
void *options;
2003-11-14 17:48:57 +01:00
} confXvPortRec, *confXvPortPtr;
typedef struct _confxvadaptrec {
const char *identifier;
int numports;
confXvPortPtr ports;
void *options;
2003-11-14 17:48:57 +01:00
} confXvAdaptorRec, *confXvAdaptorPtr;
#define MAX_GPUDEVICES 4
2003-11-14 17:48:57 +01:00
typedef struct _confscreenrec {
const char *id;
int screennum;
int defaultdepth;
int defaultbpp;
int defaultfbbpp;
MonPtr monitor;
GDevPtr device;
int numdisplays;
DispPtr displays;
int numxvadaptors;
confXvAdaptorPtr xvadaptors;
void *options;
int num_gpu_devices;
GDevPtr gpu_devices[MAX_GPUDEVICES];
2003-11-14 17:48:57 +01:00
} confScreenRec, *confScreenPtr;
typedef enum {
PosObsolete = -1,
PosAbsolute = 0,
PosRightOf,
PosLeftOf,
PosAbove,
PosBelow,
PosRelative
} PositionType;
typedef struct _screenlayoutrec {
confScreenPtr screen;
const char *topname;
confScreenPtr top;
const char *bottomname;
confScreenPtr bottom;
const char *leftname;
confScreenPtr left;
const char *rightname;
confScreenPtr right;
PositionType where;
int x;
int y;
const char *refname;
confScreenPtr refscreen;
2003-11-14 17:48:57 +01:00
} screenLayoutRec, *screenLayoutPtr;
typedef struct _InputInfoRec InputInfoRec;
2003-11-14 17:48:57 +01:00
typedef struct _serverlayoutrec {
const char *id;
screenLayoutPtr screens;
GDevPtr inactives;
InputInfoRec **inputs; /* NULL terminated */
void *options;
2003-11-14 17:48:57 +01:00
} serverLayoutRec, *serverLayoutPtr;
typedef struct _confdribufferrec {
int count;
int size;
2003-11-14 17:48:57 +01:00
enum {
XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
} flags;
2003-11-14 17:48:57 +01:00
} confDRIBufferRec, *confDRIBufferPtr;
typedef struct _confdrirec {
int group;
int mode;
int bufs_count;
confDRIBufferRec *bufs;
2003-11-14 17:48:57 +01:00
} confDRIRec, *confDRIPtr;
2003-11-14 17:48:57 +01:00
/* These values should be adjusted when new fields are added to ScrnInfoRec */
#define NUM_RESERVED_INTS 16
#define NUM_RESERVED_POINTERS 14
#define NUM_RESERVED_FUNCS 10
2003-11-14 17:48:57 +01:00
/* let clients know they can use this */
#define XF86_SCRN_HAS_PREFER_CLONE 1
typedef void *(*funcPointer) (void);
2003-11-14 17:48:57 +01:00
/* flags for depth 24 pixmap options */
typedef enum {
Pix24DontCare = 0,
Pix24Use24,
Pix24Use32
} Pix24Flags;
/* Power management events: so far we only support APM */
typedef enum {
XF86_APM_UNKNOWN = -1,
XF86_APM_SYS_STANDBY,
XF86_APM_SYS_SUSPEND,
XF86_APM_CRITICAL_SUSPEND,
XF86_APM_USER_STANDBY,
XF86_APM_USER_SUSPEND,
XF86_APM_STANDBY_RESUME,
XF86_APM_NORMAL_RESUME,
XF86_APM_CRITICAL_RESUME,
XF86_APM_LOW_BATTERY,
XF86_APM_POWER_STATUS_CHANGE,
XF86_APM_UPDATE_TIME,
XF86_APM_CAPABILITY_CHANGED,
XF86_APM_STANDBY_FAILED,
XF86_APM_SUSPEND_FAILED
} pmEvent;
typedef enum {
PM_WAIT,
PM_CONTINUE,
PM_FAILED,
PM_NONE
} pmWait;
typedef struct _PciChipsets {
/**
* Key used to match this device with its name in an array of
* \c SymTabRec.
*/
2003-11-14 17:48:57 +01:00
int numChipset;
/**
* This value is quirky. Depending on the driver, it can take on one of
* three meanings. In drivers that have exactly one vendor ID (e.g.,
* radeon, mga, i810) the low 16-bits are the device ID.
*
* In drivers that can have multiple vendor IDs (e.g., the glint driver
* can have either 3dlabs' ID or TI's ID, the i740 driver can have either
* Intel's ID or Real3D's ID, etc.) the low 16-bits are the device ID and
* the high 16-bits are the vendor ID.
*
* In drivers that don't have a specific vendor (e.g., vga) contains the
* device ID for either the generic VGA or generic 8514 devices. This
* turns out to be the same as the subclass and programming interface
* value (e.g., the full 24-bit class for the VGA device is 0x030000 (or
* 0x000101) and for 8514 is 0x030001).
*/
2003-11-14 17:48:57 +01:00
int PCIid;
/* dummy place holders for drivers to build against old/new servers */
#define RES_UNDEFINED NULL
#define RES_EXCLUSIVE_VGA NULL
#define RES_SHARED_VGA NULL
void *dummy;
2003-11-14 17:48:57 +01:00
} PciChipsets;
/* Entity properties */
typedef void (*EntityProc) (int entityIndex, void *private);
2003-11-14 17:48:57 +01:00
typedef struct _entityInfo {
int index;
BusRec location;
int chipset;
Bool active;
GDevPtr device;
DriverPtr driver;
} EntityInfoRec, *EntityInfoPtr;
/* DGA */
typedef struct {
int num; /* A unique identifier for the mode (num > 0) */
DisplayModePtr mode;
int flags; /* DGA_CONCURRENT_ACCESS, etc... */
int imageWidth; /* linear accessible portion (pixels) */
int imageHeight;
int pixmapWidth; /* Xlib accessible portion (pixels) */
int pixmapHeight; /* both fields ignored if no concurrent access */
int bytesPerScanline;
int byteOrder; /* MSBFirst, LSBFirst */
int depth;
int bitsPerPixel;
unsigned long red_mask;
unsigned long green_mask;
unsigned long blue_mask;
short visualClass;
int viewportWidth;
int viewportHeight;
int xViewportStep; /* viewport position granularity */
int yViewportStep;
int maxViewportX; /* max viewport origin */
int maxViewportY;
int viewportFlags; /* types of page flipping possible */
int offset; /* offset into physical memory */
unsigned char *address; /* server's mapped framebuffer */
int reserved1;
int reserved2;
2003-11-14 17:48:57 +01:00
} DGAModeRec, *DGAModePtr;
typedef struct {
DGAModePtr mode;
PixmapPtr pPix;
2003-11-14 17:48:57 +01:00
} DGADeviceRec, *DGADevicePtr;
/*
* Flags for driver Probe() functions.
*/
#define PROBE_DEFAULT 0x00
#define PROBE_DETECT 0x01
#define PROBE_TRYHARD 0x02
/*
* Driver entry point types
*/
typedef Bool xf86ProbeProc(DriverPtr, int);
typedef Bool xf86PreInitProc(ScrnInfoPtr, int);
api: rework the X server driver API to avoid global arrays. This is a squash merge containing all the API changes, as well as the video ABI bump. Its been squashed to make bisection easier. Full patch log below: commit b202738bbf0c5a1c1172767119c2c71f1e7f8070 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon May 14 15:16:11 2012 -0700 xfree86: Bump video ABI to 13.0 The ABI was broken by changes to convert from screen index numbers to ScreenPtr / ScrnInfoPtr in various structures and function signatures. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3 Author: Dave Airlie <airlied@redhat.com> Date: Thu May 24 10:56:57 2012 +0100 xf86: xf86ClearEntityListForScreen should take a pScrn When adding GPU screens this make life easier. (also fix comment, as pointed out by Alan) Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dave Airlie <airlied@redhat.com> commit afee8b5ab4501597ecc1ade34124d7ca227ab055 Author: Dave Airlie <airlied@redhat.com> Date: Thu May 24 07:07:32 2012 +0100 xf86i2c: add pscrn for drivers to use This just adds a pScrn pointer into the struct for the drivers to use instead of scrnIndex. Mostly scrnIndex is used for logging, but some drivers use it to lookup xf86Screens, so let them stash a pScrn instead. Removing the scrnIndex is a bit more involved and I'm not sure its worth the effort. Doing i2c in the X server is legacy code as far as I'm concerned. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit ea5092f1f679691d187f1eee9427e6057beec56e Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 19:25:20 2012 +0100 dix/gc: consolidate GC object creation in one place The standard GC create and scratch GC create were 90% the same really, and I have a need in the future for creating GC objects without the other bits, so wanted to avoid a third copy. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 10:24:06 2012 +0100 xf86: add a define to denote the new non-index interfaces are being used This can be used by drivers to provide compatible APIs. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 15:09:12 2012 +0100 dix: make Create/Free scratch pixmaps take a ScreenPtr While technically an API/ABI change I doubt anyone uses it, but it helps in splitting screens up. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:57:55 2012 +0100 xf86/xv: remove scrnIndexfrom xf86FindXvOptions. Move this interface to taking an ScrnInfoPtr. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:53:59 2012 +0100 xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2) stop passing indices into this function. v2: drop flags argument. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 58824e414f35682435f15bfe6c4b656bd90b9235 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:48:09 2012 +0100 xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:18:59 2012 +0100 xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2) Instead of passing an index, pass the actual ScreenPtr. This allows more moving towards not abusing xf86Screens + screenInfo. v2: drop the blockData/wakeupData args as per ajax's suggestion., fix docs. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 790d003de20fb47674420a24dadd92412d78620d Author: Dave Airlie <airlied@gmail.com> Date: Wed Apr 11 09:53:14 2012 +0100 xf86/common: remove some more pScrn->pScreen uses remove some more conversions that appeared after api cleanups. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:34:53 2012 +0100 ddc: change API to take ScrnInfoPtr (v2) This removes all xf86Screens usage from ddc code, it modifies the API for some functions to avoid taking indices. v2: address Alan's comments about dropping DDC2Init parameter. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit fe3f57b6eaf6860a33876a54f9439f69578f03a5 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:31:26 2012 +0100 vbe: don't use index for VBEInterpretPanelID (API) Remove use of xf86screens from vbe module. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit abf1965f4ed91529036d3fdb470d6a3ce6f29675 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:25:11 2012 +0100 int10/vbe: don't use xf86Screens. (ABI) (v3) Pass the ScrnInfoPtr instead of the index in the int10 struct. This saves us using it to dereference xf86Screens. v2: address Alan's comment to fix struct alignment. v3: squash in all the int10 fixes, test the vm86 code builds, after comments by Keith. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 23cca612b4fb5efc33683c7624b803b457387e3d Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:30:18 2012 +0100 xserver: drop index argument to ScreenInit (ABI/API) (v2) This drops the index argument, its the same as pScreen->myNum, and its the last major index abuse I can find. v2: address Alan's review - update docs, fix xwin/xnest/darwin Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:23:01 2012 +0100 xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API) This migrates PointerMoved from an index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:20:46 2012 +0100 xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API) This migrates the PMEvent from index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:18:30 2012 +0100 xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API) This migrates the SetDGAMode callback from an index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit baf5e4818a74f2b68c3dfdcc56f54322351039a0 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:14:11 2012 +0100 xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2) This migrates the ChangeGamma interface to avoid passing a index. v2: fix xf86RandR12.c + xf86cmap.c call Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 51e5f90ada929d6b23176090badbb42fdb3fa550 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:11:09 2012 +0100 xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API) The EXA interface migrates to ScreenPtr, and the xf86 interface migrated to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 94f1f21d17e86f96d4a54292a399160950087675 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:02:11 2012 +0100 xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API) This migrates the ValidMode to passing a ScrnInfoPtr instead of an index. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3f8f18198fed4f39ec805b508a3482e91eea26b2 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:59:46 2012 +0100 xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2) This migrate the SwitchMode interface to take a ScrnInfoPtr instead of an index. v2: drop flags. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit d06a038a5c49328ab3a8d969d24f9fcd22c63202 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:50:37 2012 +0100 xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2) This converts AdjustFrame code paths to passing a ScrnInfoPtr instead of an integer index. v2: drop flags args. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:41:27 2012 +0100 xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2) Another index->pScrn conversion. v2: drop flags arg. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:35:41 2012 +0100 xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2) This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr instead of an index into xf86Screens. This allows dropping more public dereferences of the xf86Screens and screenInfo. v2: drop flags args as suggested by Keith, fix docs. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 06729dbbc804a20242e6499f446acb5d94023c3c Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:04:59 2012 +0100 xserver: remove index from CloseScreen (API/ABI breakage) This drops the index from the CloseScreen callback, its always been useless really, since the pScreen contains it. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
typedef Bool xf86ScreenInitProc(ScreenPtr, int, char **);
typedef Bool xf86SwitchModeProc(ScrnInfoPtr, DisplayModePtr);
typedef void xf86AdjustFrameProc(ScrnInfoPtr, int, int);
typedef Bool xf86EnterVTProc(ScrnInfoPtr);
typedef void xf86LeaveVTProc(ScrnInfoPtr);
typedef void xf86FreeScreenProc(ScrnInfoPtr);
typedef ModeStatus xf86ValidModeProc(ScrnInfoPtr, DisplayModePtr, Bool, int);
typedef void xf86EnableDisableFBAccessProc(ScrnInfoPtr, Bool);
typedef int xf86SetDGAModeProc(ScrnInfoPtr, int, DGADevicePtr);
typedef int xf86ChangeGammaProc(ScrnInfoPtr, Gamma);
typedef void xf86PointerMovedProc(ScrnInfoPtr, int, int);
typedef Bool xf86PMEventProc(ScrnInfoPtr, pmEvent, Bool);
typedef void xf86DPMSSetProc(ScrnInfoPtr, int, int);
typedef void xf86LoadPaletteProc(ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
typedef void xf86SetOverscanProc(ScrnInfoPtr, int);
typedef void xf86ModeSetProc(ScrnInfoPtr);
2003-11-14 17:48:57 +01:00
/*
* ScrnInfoRec
*
* There is one of these for each screen, and it holds all the screen-specific
* information.
*
* Note: the size and layout must be kept the same across versions. New
* fields are to be added in place of the "reserved*" fields. No fields
* are to be dependent on compile-time defines.
*/
typedef struct _ScrnInfoRec {
int driverVersion;
const char *driverName; /* canonical name used in */
/* the config file */
ScreenPtr pScreen; /* Pointer to the ScreenRec */
int scrnIndex; /* Number of this screen */
Bool configured; /* Is this screen valid */
int origIndex; /* initial number assigned to
* this screen before
* finalising the number of
* available screens */
2003-11-14 17:48:57 +01:00
/* Display-wide screenInfo values needed by this screen */
int imageByteOrder;
int bitmapScanlineUnit;
int bitmapScanlinePad;
int bitmapBitOrder;
int numFormats;
PixmapFormatRec formats[MAXFORMATS];
PixmapFormatRec fbFormat;
int bitsPerPixel; /* fb bpp */
Pix24Flags pixmap24; /* pixmap pref for depth 24 */
int depth; /* depth of default visual */
MessageType depthFrom; /* set from config? */
MessageType bitsPerPixelFrom; /* set from config? */
rgb weight; /* r/g/b weights */
rgb mask; /* rgb masks */
rgb offset; /* rgb offsets */
int rgbBits; /* Number of bits in r/g/b */
Gamma gamma; /* Gamma of the monitor */
int defaultVisual; /* default visual class */
int maxHValue; /* max horizontal timing */
int maxVValue; /* max vertical timing value */
int virtualX; /* Virtual width */
int virtualY; /* Virtual height */
int xInc; /* Horizontal timing increment */
MessageType virtualFrom; /* set from config? */
int displayWidth; /* memory pitch */
int frameX0; /* viewport position */
int frameY0;
int frameX1;
int frameY1;
int zoomLocked; /* Disallow mode changes */
DisplayModePtr modePool; /* list of compatible modes */
DisplayModePtr modes; /* list of actual modes */
DisplayModePtr currentMode; /* current mode
* This was previously
* overloaded with the modes
* field, which is a pointer
* into a circular list */
confScreenPtr confScreen; /* Screen config info */
MonPtr monitor; /* Monitor information */
DispPtr display; /* Display information */
int *entityList; /* List of device entities */
int numEntities;
int widthmm; /* physical display dimensions
* in mm */
int heightmm;
int xDpi; /* width DPI */
int yDpi; /* height DPI */
const char *name; /* Name to prefix messages */
void *driverPrivate; /* Driver private area */
DevUnion *privates; /* Other privates can hook in
* here */
DriverPtr drv; /* xf86DriverList[] entry */
void *module; /* Pointer to module head */
int colorKey;
int overlayFlags;
2003-11-14 17:48:57 +01:00
/* Some of these may be moved out of here into the driver private area */
const char *chipset; /* chipset name */
const char *ramdac; /* ramdac name */
const char *clockchip; /* clock name */
Bool progClock; /* clock is programmable */
int numClocks; /* number of clocks */
int clock[MAXCLOCKS]; /* list of clock frequencies */
int videoRam; /* amount of video ram (kb) */
unsigned long biosBase; /* Base address of video BIOS */
unsigned long memPhysBase; /* Physical address of FB */
unsigned long fbOffset; /* Offset of FB in the above */
int memClk; /* memory clock */
Bool flipPixels; /* swap default black/white */
void *options;
int chipID;
int chipRev;
2003-11-14 17:48:57 +01:00
/* Allow screens to be enabled/disabled individually */
Bool vtSema;
2003-11-14 17:48:57 +01:00
/* hw cursor moves at SIGIO time */
Bool silkenMouse;
2003-11-14 17:48:57 +01:00
/* Storage for clockRanges and adjustFlags for use with the VidMode ext */
ClockRangePtr clockRanges;
int adjustFlags;
/* initial rightof support disable */
int preferClone;
2003-11-14 17:48:57 +01:00
/*
* These can be used when the minor ABI version is incremented.
* The NUM_* parameters must be reduced appropriately to keep the
* structure size and alignment unchanged.
*/
int reservedInt[NUM_RESERVED_INTS];
2003-11-14 17:48:57 +01:00
int *entityInstanceList;
struct pci_device *vgaDev;
void *reservedPtr[NUM_RESERVED_POINTERS];
2003-11-14 17:48:57 +01:00
/*
* Driver entry points.
*
*/
xf86ProbeProc *Probe;
xf86PreInitProc *PreInit;
xf86ScreenInitProc *ScreenInit;
xf86SwitchModeProc *SwitchMode;
xf86AdjustFrameProc *AdjustFrame;
xf86EnterVTProc *EnterVT;
xf86LeaveVTProc *LeaveVT;
xf86FreeScreenProc *FreeScreen;
xf86ValidModeProc *ValidMode;
xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
xf86SetDGAModeProc *SetDGAMode;
xf86ChangeGammaProc *ChangeGamma;
xf86PointerMovedProc *PointerMoved;
xf86PMEventProc *PMEvent;
xf86DPMSSetProc *DPMSSet;
xf86LoadPaletteProc *LoadPalette;
xf86SetOverscanProc *SetOverscan;
xorgDriverFuncProc *DriverFunc;
xf86ModeSetProc *ModeSet;
2003-11-14 17:48:57 +01:00
/*
* This can be used when the minor ABI version is incremented.
* The NUM_* parameter must be reduced appropriately to keep the
* structure size and alignment unchanged.
*/
funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
2003-11-14 17:48:57 +01:00
Bool is_gpu;
uint32_t capabilities;
2003-11-14 17:48:57 +01:00
} ScrnInfoRec;
typedef struct {
Bool (*OpenFramebuffer) (ScrnInfoPtr pScrn,
char **name,
unsigned char **mem,
int *size, int *offset, int *extra);
void (*CloseFramebuffer) (ScrnInfoPtr pScrn);
Bool (*SetMode) (ScrnInfoPtr pScrn, DGAModePtr pMode);
void (*SetViewport) (ScrnInfoPtr pScrn, int x, int y, int flags);
int (*GetViewport) (ScrnInfoPtr pScrn);
void (*Sync) (ScrnInfoPtr);
void (*FillRect) (ScrnInfoPtr pScrn,
int x, int y, int w, int h, unsigned long color);
void (*BlitRect) (ScrnInfoPtr pScrn,
int srcx, int srcy, int w, int h, int dstx, int dsty);
void (*BlitTransRect) (ScrnInfoPtr pScrn,
int srcx, int srcy,
int w, int h,
int dstx, int dsty, unsigned long color);
2003-11-14 17:48:57 +01:00
} DGAFunctionRec, *DGAFunctionPtr;
typedef struct _SymTabRec {
int token; /* id of the token */
const char *name; /* token name */
2003-11-14 17:48:57 +01:00
} SymTabRec, *SymTabPtr;
/* flags for xf86LookupMode */
typedef enum {
LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
LOOKUP_LIST_ORDER, /* Pick first useful mode in list */
LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */
LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */
2003-11-14 17:48:57 +01:00
} LookupModeFlags;
#define NoDepth24Support 0x00
#define Support24bppFb 0x01 /* 24bpp framebuffer supported */
#define Support32bppFb 0x02 /* 32bpp framebuffer supported */
#define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */
#define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */
#define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */
#define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */
2003-11-14 17:48:57 +01:00
/* For DPMS */
typedef void (*DPMSSetProcPtr) (ScrnInfoPtr, int, int);
2003-11-14 17:48:57 +01:00
/* Input handler proc */
typedef void (*InputHandlerProc) (int fd, void *data);
2003-11-14 17:48:57 +01:00
/* These are used by xf86GetClocks */
#define CLK_REG_SAVE -1
#define CLK_REG_RESTORE -2
/*
* misc constants
*/
#define INTERLACE_REFRESH_WEIGHT 1.5
#define SYNC_TOLERANCE 0.01 /* 1 percent */
#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
2003-11-14 17:48:57 +01:00
#define OVERLAY_8_32_DUALFB 0x00000001
#define OVERLAY_8_24_DUALFB 0x00000002
#define OVERLAY_8_16_DUALFB 0x00000004
#define OVERLAY_8_32_PLANAR 0x00000008
/* Values of xf86Info.mouseFlags */
#define MF_CLEAR_DTR 1
#define MF_CLEAR_RTS 2
/* Action Events */
typedef enum {
ACTION_TERMINATE = 0, /* Terminate Server */
ACTION_NEXT_MODE = 10, /* Switch to next video mode */
2003-11-14 17:48:57 +01:00
ACTION_PREV_MODE,
ACTION_SWITCHSCREEN = 100, /* VT switch */
2003-11-14 17:48:57 +01:00
ACTION_SWITCHSCREEN_NEXT,
ACTION_SWITCHSCREEN_PREV,
2003-11-14 17:48:57 +01:00
} ActionEvent;
#endif /* _XF86STR_H */