diff options
author | marha <marha@users.sourceforge.net> | 2011-02-25 08:27:07 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-02-25 08:27:07 +0000 |
commit | 27b0ed125725f09242054563bb65ac20cfaa17ff (patch) | |
tree | 6fe92374761ae87d8541d117605db27f3486aee1 /xorg-server/hw/xfree86 | |
parent | e8d899178e9ebe174e6b4a53297d3dfced8003f0 (diff) | |
parent | 8268836508edd4ba2a3045c9ba937397df7bf2c5 (diff) | |
download | vcxsrv-27b0ed125725f09242054563bb65ac20cfaa17ff.tar.gz vcxsrv-27b0ed125725f09242054563bb65ac20cfaa17ff.tar.bz2 vcxsrv-27b0ed125725f09242054563bb65ac20cfaa17ff.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86Helper.c | 6 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86Module.h | 424 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86sbusBus.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Crtc.c | 149 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Crtc.h | 119 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Cursors.c | 4 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86RandR12.c | 387 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Rotate.c | 44 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/bsd/bsd_init.c | 6 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/xf86_OSlib.h | 846 |
10 files changed, 781 insertions, 1206 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c index 8f61c4c72..147464410 100644 --- a/xorg-server/hw/xfree86/common/xf86Helper.c +++ b/xorg-server/hw/xfree86/common/xf86Helper.c @@ -1038,12 +1038,7 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) RegionInit(&pWin->winSize, &box, 1);
RegionInit(&pWin->borderSize, &box, 1);
if (WasViewable)
- {
- PixmapPtr pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
- box.x2 = pPixmap->drawable.width;
- box.y2 = pPixmap->drawable.height;
RegionReset(&pWin->borderClip, &box);
- }
pWin->drawable.width = pScreen->width;
pWin->drawable.height = pScreen->height;
RegionBreak(&pWin->clipList);
@@ -1121,6 +1116,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable) */
if (!xf86Resetting)
xf86SetRootClip (pScreen, TRUE);
+
}
else
{
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h index 49a98bd05..1322b8046 100644 --- a/xorg-server/hw/xfree86/common/xf86Module.h +++ b/xorg-server/hw/xfree86/common/xf86Module.h @@ -1,212 +1,212 @@ -/* - * 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). - */ - -/* - * This file contains the parts of the loader interface that are visible - * to modules. This is the only loader-related header that modules should - * include. - * - * It should include a bare minimum of other headers. - * - * Longer term, the module/loader code should probably live directly under - * Xserver/. - * - * XXX This file arguably belongs in xfree86/loader/. - */ - -#ifndef _XF86MODULE_H -#define _XF86MODULE_H - -#include "misc.h" -#ifndef NULL -#define NULL ((void *)0) -#endif - -typedef enum { - LD_RESOLV_IFDONE = 0, /* only check if no more - delays pending */ - LD_RESOLV_NOW = 1, /* finish one delay step */ - LD_RESOLV_FORCE = 2 /* force checking... */ -} LoaderResolveOptions; - -#define DEFAULT_LIST ((char *)-1) - -/* This indicates a special module that doesn't have the usual entry point */ -#define EXTERN_MODULE ((pointer)-1) - -/* Built-in ABI classes. These definitions must not be changed. */ -#define ABI_CLASS_NONE NULL -#define ABI_CLASS_ANSIC "X.Org ANSI C Emulation" -#define ABI_CLASS_VIDEODRV "X.Org Video Driver" -#define ABI_CLASS_XINPUT "X.Org XInput driver" -#define ABI_CLASS_EXTENSION "X.Org Server Extension" -#define ABI_CLASS_FONT "X.Org Font Renderer" - -#define ABI_MINOR_MASK 0x0000FFFF -#define ABI_MAJOR_MASK 0xFFFF0000 -#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK) -#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16) -#define SET_ABI_VERSION(maj, min) \ - ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK)) - -/* - * ABI versions. Each version has a major and minor revision. Modules - * using lower minor revisions must work with servers of a higher minor - * revision. There is no compatibility between different major revisions. - * Whenever the ABI_ANSIC_VERSION is changed, the others must also be - * changed. The minor revision mask is 0x0000FFFF and the major revision - * mask is 0xFFFF0000. - */ -#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 2) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0) -#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) - -#define MODINFOSTRING1 0xef23fdc5 -#define MODINFOSTRING2 0x10dc023a - -#ifndef MODULEVENDORSTRING -#define MODULEVENDORSTRING "X.Org Foundation" -#endif - -/* Error return codes for errmaj. New codes must only be added at the end. */ -typedef enum { - LDR_NOERROR = 0, - LDR_NOMEM, /* memory allocation failed */ - LDR_NOENT, /* Module file does not exist */ - LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */ - LDR_NOSPACE, /* internal module array full */ - LDR_NOMODOPEN, /* module file could not be opened (check errmin) */ - LDR_UNKTYPE, /* file is not a recognized module type */ - LDR_NOLOAD, /* type specific loader failed */ - LDR_ONCEONLY, /* Module should only be loaded once (not an error) */ - LDR_NOPORTOPEN, /* could not open port (check errmin) */ - LDR_NOHARDWARE, /* could not query/initialize the hardware device */ - LDR_MISMATCH, /* the module didn't match the spec'd requirments */ - LDR_BADUSAGE, /* LoadModule is called with bad arguments */ - LDR_INVALID, /* The module doesn't have a valid ModuleData object */ - LDR_BADOS, /* The module doesn't support the OS */ - LDR_MODSPECIFIC /* A module-specific error in the SetupProc */ -} LoaderErrorCode; - -/* - * Some common module classes. The moduleclass can be used to identify - * that modules loaded are of the correct type. This is a finer - * classification than the ABI classes even though the default set of - * classes have the same names. For example, not all modules that require - * the video driver ABI are themselves video drivers. - */ -#define MOD_CLASS_NONE NULL -#define MOD_CLASS_VIDEODRV "X.Org Video Driver" -#define MOD_CLASS_XINPUT "X.Org XInput Driver" -#define MOD_CLASS_FONT "X.Org Font Renderer" -#define MOD_CLASS_EXTENSION "X.Org Server Extension" - -/* This structure is expected to be returned by the initfunc */ -typedef struct { - const char * modname; /* name of module, e.g. "foo" */ - const char * vendor; /* vendor specific string */ - CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */ - CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */ - CARD32 xf86version; /* contains XF86_VERSION_CURRENT */ - CARD8 majorversion; /* module-specific major version */ - CARD8 minorversion; /* module-specific minor version */ - CARD16 patchlevel; /* module-specific patch level */ - const char * abiclass; /* ABI class that the module uses */ - CARD32 abiversion; /* ABI version */ - const char * moduleclass; /* module class description */ - CARD32 checksum[4]; /* contains a digital signature of the */ - /* version info structure */ -} XF86ModuleVersionInfo; - -/* - * This structure can be used to callers of LoadModule and LoadSubModule to - * specify version and/or ABI requirements. - */ -typedef struct { - CARD8 majorversion; /* module-specific major version */ - CARD8 minorversion; /* moudle-specific minor version */ - CARD16 patchlevel; /* module-specific patch level */ - const char * abiclass; /* ABI class that the module uses */ - CARD32 abiversion; /* ABI version */ - const char * moduleclass; /* module class */ -} XF86ModReqInfo; - -/* values to indicate unspecified fields in XF86ModReqInfo. */ -#define MAJOR_UNSPEC 0xFF -#define MINOR_UNSPEC 0xFF -#define PATCH_UNSPEC 0xFFFF -#define ABI_VERS_UNSPEC 0xFFFFFFFF - -#define MODULE_VERSION_NUMERIC(maj, min, patch) \ - ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF)) -#define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF) -#define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF) -#define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF) - -#define INITARGS void - -typedef void (*InitExtension)(INITARGS); - -typedef struct { - InitExtension initFunc; - const char * name; - Bool *disablePtr; - InitExtension setupFunc; - const char ** initDependencies; -} ExtensionModule; - -extern _X_EXPORT ExtensionModule *ExtensionModuleList; - -/* Prototypes for Loader functions that are exported to modules */ -extern _X_EXPORT pointer LoadSubModule(pointer, const char *, const char **, - const char **, pointer, const XF86ModReqInfo *, - int *, int *); -extern _X_EXPORT void UnloadSubModule(pointer); -extern _X_EXPORT void UnloadModule (pointer); -extern _X_EXPORT pointer LoaderSymbol(const char *); -extern _X_EXPORT char **LoaderListDirs(const char **, const char **); -extern _X_EXPORT void LoaderFreeDirList(char **); -extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int); -extern _X_EXPORT void LoadExtension(ExtensionModule *, Bool); -extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, int *teeny); -extern _X_EXPORT Bool LoaderShouldIgnoreABI(void); -extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass); - -typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *); -typedef void (*ModuleTearDownProc)(pointer); -#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*) -#define MODULETEARDOWNPROTO(func) void func(pointer) - -typedef struct { - XF86ModuleVersionInfo * vers; - ModuleSetupProc setup; - ModuleTearDownProc teardown; -} XF86ModuleData; - -#endif /* _XF86STR_H */ +/*
+ * 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).
+ */
+
+/*
+ * This file contains the parts of the loader interface that are visible
+ * to modules. This is the only loader-related header that modules should
+ * include.
+ *
+ * It should include a bare minimum of other headers.
+ *
+ * Longer term, the module/loader code should probably live directly under
+ * Xserver/.
+ *
+ * XXX This file arguably belongs in xfree86/loader/.
+ */
+
+#ifndef _XF86MODULE_H
+#define _XF86MODULE_H
+
+#include "misc.h"
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+typedef enum {
+ LD_RESOLV_IFDONE = 0, /* only check if no more
+ delays pending */
+ LD_RESOLV_NOW = 1, /* finish one delay step */
+ LD_RESOLV_FORCE = 2 /* force checking... */
+} LoaderResolveOptions;
+
+#define DEFAULT_LIST ((char *)-1)
+
+/* This indicates a special module that doesn't have the usual entry point */
+#define EXTERN_MODULE ((pointer)-1)
+
+/* Built-in ABI classes. These definitions must not be changed. */
+#define ABI_CLASS_NONE NULL
+#define ABI_CLASS_ANSIC "X.Org ANSI C Emulation"
+#define ABI_CLASS_VIDEODRV "X.Org Video Driver"
+#define ABI_CLASS_XINPUT "X.Org XInput driver"
+#define ABI_CLASS_EXTENSION "X.Org Server Extension"
+#define ABI_CLASS_FONT "X.Org Font Renderer"
+
+#define ABI_MINOR_MASK 0x0000FFFF
+#define ABI_MAJOR_MASK 0xFFFF0000
+#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK)
+#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16)
+#define SET_ABI_VERSION(maj, min) \
+ ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK))
+
+/*
+ * ABI versions. Each version has a major and minor revision. Modules
+ * using lower minor revisions must work with servers of a higher minor
+ * revision. There is no compatibility between different major revisions.
+ * Whenever the ABI_ANSIC_VERSION is changed, the others must also be
+ * changed. The minor revision mask is 0x0000FFFF and the major revision
+ * mask is 0xFFFF0000.
+ */
+#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(10, 0)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 2)
+#define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0)
+#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
+
+#define MODINFOSTRING1 0xef23fdc5
+#define MODINFOSTRING2 0x10dc023a
+
+#ifndef MODULEVENDORSTRING
+#define MODULEVENDORSTRING "X.Org Foundation"
+#endif
+
+/* Error return codes for errmaj. New codes must only be added at the end. */
+typedef enum {
+ LDR_NOERROR = 0,
+ LDR_NOMEM, /* memory allocation failed */
+ LDR_NOENT, /* Module file does not exist */
+ LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */
+ LDR_NOSPACE, /* internal module array full */
+ LDR_NOMODOPEN, /* module file could not be opened (check errmin) */
+ LDR_UNKTYPE, /* file is not a recognized module type */
+ LDR_NOLOAD, /* type specific loader failed */
+ LDR_ONCEONLY, /* Module should only be loaded once (not an error) */
+ LDR_NOPORTOPEN, /* could not open port (check errmin) */
+ LDR_NOHARDWARE, /* could not query/initialize the hardware device */
+ LDR_MISMATCH, /* the module didn't match the spec'd requirments */
+ LDR_BADUSAGE, /* LoadModule is called with bad arguments */
+ LDR_INVALID, /* The module doesn't have a valid ModuleData object */
+ LDR_BADOS, /* The module doesn't support the OS */
+ LDR_MODSPECIFIC /* A module-specific error in the SetupProc */
+} LoaderErrorCode;
+
+/*
+ * Some common module classes. The moduleclass can be used to identify
+ * that modules loaded are of the correct type. This is a finer
+ * classification than the ABI classes even though the default set of
+ * classes have the same names. For example, not all modules that require
+ * the video driver ABI are themselves video drivers.
+ */
+#define MOD_CLASS_NONE NULL
+#define MOD_CLASS_VIDEODRV "X.Org Video Driver"
+#define MOD_CLASS_XINPUT "X.Org XInput Driver"
+#define MOD_CLASS_FONT "X.Org Font Renderer"
+#define MOD_CLASS_EXTENSION "X.Org Server Extension"
+
+/* This structure is expected to be returned by the initfunc */
+typedef struct {
+ const char * modname; /* name of module, e.g. "foo" */
+ const char * vendor; /* vendor specific string */
+ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
+ CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */
+ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* module-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class description */
+ CARD32 checksum[4]; /* contains a digital signature of the */
+ /* version info structure */
+} XF86ModuleVersionInfo;
+
+/*
+ * This structure can be used to callers of LoadModule and LoadSubModule to
+ * specify version and/or ABI requirements.
+ */
+typedef struct {
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* moudle-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class */
+} XF86ModReqInfo;
+
+/* values to indicate unspecified fields in XF86ModReqInfo. */
+#define MAJOR_UNSPEC 0xFF
+#define MINOR_UNSPEC 0xFF
+#define PATCH_UNSPEC 0xFFFF
+#define ABI_VERS_UNSPEC 0xFFFFFFFF
+
+#define MODULE_VERSION_NUMERIC(maj, min, patch) \
+ ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
+#define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
+#define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
+#define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF)
+
+#define INITARGS void
+
+typedef void (*InitExtension)(INITARGS);
+
+typedef struct {
+ InitExtension initFunc;
+ const char * name;
+ Bool *disablePtr;
+ InitExtension setupFunc;
+ const char ** initDependencies;
+} ExtensionModule;
+
+extern _X_EXPORT ExtensionModule *ExtensionModuleList;
+
+/* Prototypes for Loader functions that are exported to modules */
+extern _X_EXPORT pointer LoadSubModule(pointer, const char *, const char **,
+ const char **, pointer, const XF86ModReqInfo *,
+ int *, int *);
+extern _X_EXPORT void UnloadSubModule(pointer);
+extern _X_EXPORT void UnloadModule (pointer);
+extern _X_EXPORT pointer LoaderSymbol(const char *);
+extern _X_EXPORT char **LoaderListDirs(const char **, const char **);
+extern _X_EXPORT void LoaderFreeDirList(char **);
+extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
+extern _X_EXPORT void LoadExtension(ExtensionModule *, Bool);
+extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, int *teeny);
+extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
+extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
+
+typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *);
+typedef void (*ModuleTearDownProc)(pointer);
+#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*)
+#define MODULETEARDOWNPROTO(func) void func(pointer)
+
+typedef struct {
+ XF86ModuleVersionInfo * vers;
+ ModuleSetupProc setup;
+ ModuleTearDownProc teardown;
+} XF86ModuleData;
+
+#endif /* _XF86STR_H */
diff --git a/xorg-server/hw/xfree86/common/xf86sbusBus.c b/xorg-server/hw/xfree86/common/xf86sbusBus.c index c0de88dda..6e6ab948f 100644 --- a/xorg-server/hw/xfree86/common/xf86sbusBus.c +++ b/xorg-server/hw/xfree86/common/xf86sbusBus.c @@ -709,6 +709,6 @@ xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec *GDev) XNFasprintf(&GDev->busID, "SBUS:%s", promPath);
free(promPath);
} else {
- XNFsprintf(&GDev->busID, "SBUS:fb%d", sBus->fbNum);
+ XNFasprintf(&GDev->busID, "SBUS:fb%d", sBus->fbNum);
}
}
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index d721b131f..1f2ce2acd 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -82,17 +82,6 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn, config->maxHeight = maxHeight;
}
-void
-xf86CrtcSetScanoutFormats(ScrnInfoPtr scrn,
- int num_formats,
- xf86CrtcScanoutFormat *formats)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- config->num_scanout_formats = num_formats;
- config->scanout_formats = formats;
-}
-
/*
* Crtc functions
*/
@@ -117,17 +106,12 @@ xf86CrtcCreate (ScrnInfoPtr scrn, pixman_transform_init_identity (&crtc->crtc_to_framebuffer);
pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer);
pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc);
- pixman_f_transform_init_identity (&crtc->f_screen_to_crtc);
- pixman_f_transform_init_identity (&crtc->user_sprite_position_transform);
- pixman_f_transform_init_identity (&crtc->f_crtc_to_cursor);
- pixman_f_transform_init_identity (&crtc->user_sprite_image_transform);
crtc->filter = NULL;
crtc->params = NULL;
crtc->nparams = 0;
crtc->filter_width = 0;
crtc->filter_height = 0;
crtc->transform_in_use = FALSE;
- crtc->sprite_transform_in_use = FALSE;
crtc->transformPresent = FALSE;
crtc->desiredTransformPresent = FALSE;
memset (&crtc->bounds, '\0', sizeof (crtc->bounds));
@@ -263,20 +247,20 @@ xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) * Sets the given video mode on the given crtc
*/
Bool
-xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set)
+xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ RRTransformPtr transform, int x, int y)
{
ScrnInfoPtr scrn = crtc->scrn;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
int i;
Bool ret = FALSE;
Bool didLock = FALSE;
- DisplayModePtr adjusted_mode = NULL;
+ DisplayModePtr adjusted_mode;
DisplayModeRec saved_mode;
int saved_x, saved_y;
Rotation saved_rotation;
RRTransformRec saved_transform;
Bool saved_transform_present;
- PixmapPtr saved_scanout_pixmap;
crtc->enabled = xf86CrtcInUse (crtc);
@@ -288,15 +272,13 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) return TRUE;
}
- /* See if nothing has changed */
- if (!set->flags)
- return TRUE;
+ adjusted_mode = xf86DuplicateMode(mode);
+
saved_mode = crtc->mode;
saved_x = crtc->x;
saved_y = crtc->y;
saved_rotation = crtc->rotation;
- saved_scanout_pixmap = crtc->scanoutPixmap;
if (crtc->transformPresent) {
RRTransformInit (&saved_transform);
RRTransformCopy (&saved_transform, &crtc->transform);
@@ -306,46 +288,21 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) /* Update crtc values up front so the driver can rely on them for mode
* setting.
*/
- if (set->flags & XF86CrtcSetMode)
- crtc->mode = *set->mode;
- if (set->flags & XF86CrtcSetOrigin) {
- crtc->x = set->x;
- crtc->y = set->y;
- }
- if (set->flags & XF86CrtcSetRotation)
- crtc->rotation = set->rotation;
- if (set->flags & XF86CrtcSetScanoutPixmap)
- crtc->scanoutPixmap = set->scanout_pixmap;
-
- if (set->flags & XF86CrtcSetTransform) {
- if (set->transform) {
- RRTransformCopy (&crtc->transform, set->transform);
- crtc->transformPresent = TRUE;
- } else
- crtc->transformPresent = FALSE;
- }
-
- if (crtc->funcs->set) {
- ret = crtc->funcs->set(crtc, set->flags);
- goto done;
- }
-
- if (set->flags == XF86CrtcSetOrigin && crtc->funcs->set_origin) {
- ret = xf86CrtcRotate(crtc);
- if (ret)
- crtc->funcs->set_origin(crtc, crtc->x, crtc->y);
- goto done;
- }
+ crtc->mode = *mode;
+ crtc->x = x;
+ crtc->y = y;
+ crtc->rotation = rotation;
+ if (transform) {
+ RRTransformCopy (&crtc->transform, transform);
+ crtc->transformPresent = TRUE;
+ } else
+ crtc->transformPresent = FALSE;
if (crtc->funcs->set_mode_major) {
- ret = crtc->funcs->set_mode_major(crtc, &crtc->mode,
- crtc->rotation,
- crtc->x, crtc->y);
+ ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
goto done;
}
- adjusted_mode = xf86DuplicateMode(&crtc->mode);
-
didLock = crtc->funcs->lock (crtc);
/* Pass our mode to the outputs and the CRTC to give them a chance to
* adjust it according to limitations or output properties, and also
@@ -357,12 +314,12 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) if (output->crtc != crtc)
continue;
- if (!output->funcs->mode_fixup(output, &crtc->mode, adjusted_mode)) {
+ if (!output->funcs->mode_fixup(output, mode, adjusted_mode)) {
goto done;
}
}
- if (!crtc->funcs->mode_fixup(crtc, &crtc->mode, adjusted_mode)) {
+ if (!crtc->funcs->mode_fixup(crtc, mode, adjusted_mode)) {
goto done;
}
@@ -385,12 +342,12 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) /* Set up the DPLL and any output state that needs to adjust or depend
* on the DPLL.
*/
- crtc->funcs->mode_set(crtc, &crtc->mode, adjusted_mode, crtc->x, crtc->y);
+ crtc->funcs->mode_set(crtc, mode, adjusted_mode, crtc->x, crtc->y);
for (i = 0; i < xf86_config->num_output; i++)
{
xf86OutputPtr output = xf86_config->output[i];
if (output->crtc == crtc)
- output->funcs->mode_set(output, &crtc->mode, adjusted_mode);
+ output->funcs->mode_set(output, mode, adjusted_mode);
}
/* Only upload when needed, to avoid unneeded delays. */
@@ -424,13 +381,10 @@ done: if (saved_transform_present)
RRTransformCopy (&crtc->transform, &saved_transform);
crtc->transformPresent = saved_transform_present;
- crtc->scanoutPixmap = saved_scanout_pixmap;
}
- if (adjusted_mode) {
- free(adjusted_mode->name);
- free(adjusted_mode);
- }
+ free(adjusted_mode->name);
+ free(adjusted_mode);
if (didLock)
crtc->funcs->unlock (crtc);
@@ -439,19 +393,35 @@ done: }
/**
+ * Sets the given video mode on the given crtc, but without providing
+ * a transform
+ */
+Bool
+xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ int x, int y)
+{
+ return xf86CrtcSetModeTransform (crtc, mode, rotation, NULL, x, y);
+}
+
+/**
* Pans the screen, does not change the mode
*/
void
xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y)
{
- xf86CrtcSetRec set;
+ ScrnInfoPtr scrn = crtc->scrn;
- if (x != crtc->x || y != crtc->y) {
- set.x = x;
- set.y = y;
- set.flags = XF86CrtcSetOrigin;
- (void) xf86CrtcSet(crtc, &set);
+ crtc->x = x;
+ crtc->y = y;
+ if (crtc->funcs->set_origin) {
+ if (!xf86CrtcRotate (crtc))
+ return;
+ crtc->funcs->set_origin (crtc, x, y);
+ if (scrn->ModeSet)
+ scrn->ModeSet(scrn);
}
+ else
+ xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y);
}
/*
@@ -1595,7 +1565,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) int min_clock = 0;
int max_clock = 0;
double clock;
- Bool add_default_modes = xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE);
+ Bool add_default_modes;
Bool debug_modes = config->debug_modes ||
xf86Initialising;
enum det_monrec_source sync_source = sync_default;
@@ -1641,6 +1611,14 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) }
output_modes = (*output->funcs->get_modes) (output);
+
+ /*
+ * If the user has a preference, respect it.
+ * Otherwise, don't second-guess the driver.
+ */
+ if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES,
+ &add_default_modes))
+ add_default_modes = (output_modes == NULL);
edid_monitor = output->MonInfo;
@@ -2642,7 +2620,6 @@ xf86SetDesiredModes (ScrnInfoPtr scrn) for (c = 0; c < config->num_crtc; c++)
{
xf86OutputPtr output = NULL;
- xf86CrtcSetRec set;
int o;
RRTransformPtr transform;
@@ -2686,15 +2663,8 @@ xf86SetDesiredModes (ScrnInfoPtr scrn) transform = &crtc->desiredTransform;
else
transform = NULL;
- set.mode = &crtc->desiredMode;
- set.rotation = crtc->desiredRotation;
- set.transform = transform;
- set.x = crtc->desiredX;
- set.y = crtc->desiredY;
- set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput |
- XF86CrtcSetOrigin | XF86CrtcSetTransform |
- XF86CrtcSetRotation);
- if (!xf86CrtcSet(crtc, &set))
+ if (!xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation,
+ transform, crtc->desiredX, crtc->desiredY))
return FALSE;
}
@@ -2798,7 +2768,6 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) xf86CrtcPtr crtc = config->crtc[c];
DisplayModePtr crtc_mode = NULL;
int o;
- xf86CrtcSetRec set;
if (!crtc->enabled)
continue;
@@ -2826,15 +2795,7 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) crtc->enabled = FALSE;
continue;
}
- set.mode = crtc_mode;
- set.rotation = rotation;
- set.transform = NULL;
- set.x = 0;
- set.y = 0;
- set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput |
- XF86CrtcSetOrigin | XF86CrtcSetTransform |
- XF86CrtcSetRotation);
- if (!xf86CrtcSet (crtc, &set))
+ if (!xf86CrtcSetModeTransform (crtc, crtc_mode, rotation, NULL, 0, 0))
ok = FALSE;
else
{
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.h b/xorg-server/hw/xfree86/modes/xf86Crtc.h index e4037142f..5dfcec280 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.h +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.h @@ -72,25 +72,6 @@ typedef enum _xf86OutputStatus { XF86OutputStatusUnknown
} xf86OutputStatus;
-typedef enum _xf86CrtcSetFlags {
- XF86CrtcSetMode = 1, /* mode */
- XF86CrtcSetOutput = 2, /* outputs */
- XF86CrtcSetOrigin = 4, /* x/y */
- XF86CrtcSetTransform = 8, /* transform */
- XF86CrtcSetRotation = 16, /* rotation */
- XF86CrtcSetProperty = 32, /* output property */
- XF86CrtcSetScanoutPixmap = 64, /* scanout pixmap */
-} xf86CrtcSetFlags;
-
-typedef struct _xf86CrtcSet {
- xf86CrtcSetFlags flags;
- DisplayModePtr mode;
- Rotation rotation;
- RRTransformPtr transform;
- int x, y;
- PixmapPtr scanout_pixmap;
-} xf86CrtcSetRec;
-
typedef struct _xf86CrtcFuncs {
/**
* Turns the crtc on/off, or sets intermediate power levels if available.
@@ -240,12 +221,6 @@ typedef struct _xf86CrtcFuncs { void
(*set_origin)(xf86CrtcPtr crtc, int x, int y);
- /**
- * General mode setting entry point that does everything
- */
- Bool
- (*set)(xf86CrtcPtr crtc, xf86CrtcSetFlags flags);
-
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
#define XF86_CRTC_VERSION 3
@@ -279,7 +254,6 @@ struct _xf86Crtc { Rotation rotation;
PixmapPtr rotatedPixmap;
void *rotatedData;
- PixmapPtr scanoutPixmap;
/**
* Position on screen
@@ -348,7 +322,6 @@ struct _xf86Crtc { int filter_width; /* ABI 2 */
int filter_height; /* ABI 2 */
Bool transform_in_use;
- Bool sprite_transform_in_use;
RRTransformRec transform; /* ABI 2 */
Bool transformPresent; /* ABI 2 */
RRTransformRec desiredTransform; /* ABI 2 */
@@ -388,22 +361,6 @@ struct _xf86Crtc { * Clear the shadow
*/
Bool shadowClear;
-
- /**
- * Sprite position transforms
- */
-
- /* Transform a screen coordinate to a crtc coordinate */
- struct pixman_f_transform f_screen_to_crtc;
-
- /* The user-specified portion of the screen to crtc conversion */
- struct pixman_f_transform user_sprite_position_transform;
-
- /* Transform a hardware cursor coordinate to a cursor coordinate */
- struct pixman_f_transform f_crtc_to_cursor;
-
- /* The user-specified portion of the cursor to hardware transform */
- struct pixman_f_transform user_sprite_image_transform;
};
typedef struct _xf86OutputFuncs {
@@ -650,37 +607,6 @@ struct _xf86Output { INT16 initialBorder[4];
};
-typedef enum _xf86SetConfigResponse {
- xf86SetConfigFailed, /* set_config failed */
- xf86SetConfigChecked, /* set_config validated the configuration */
- xf86SetConfigDone, /* set_config finished the work */
-} xf86SetConfigResponse;
-
-typedef struct _xf86CrtcSetConfig {
- xf86CrtcPtr crtc;
- int x, y;
- DisplayModeRec mode;
- Rotation rotation;
- int numOutputs;
- xf86OutputPtr *outputs;
- struct pict_f_transform sprite_position_transform;
- struct pict_f_transform sprite_image_transform;
-
- /* Probably want some internal structure for the pixmap so that
- * this can be set before the server is running
- */
- PixmapPtr pixmap;
- int pixmap_x, pixmap_y;
-} xf86CrtcSetConfigRec, *xf86CrtcSetConfigPtr;
-
-typedef struct _xf86CrtcScanoutFormat {
- int depth;
- int bitsPerPixel;
- int maxWidth, maxHeight;
- Rotation rotations;
- PictFormatShort format;
-} xf86CrtcScanoutFormat;
-
typedef struct _xf86CrtcConfigFuncs {
/**
* Requests that the driver resize the screen.
@@ -698,23 +624,6 @@ typedef struct _xf86CrtcConfigFuncs { (*resize)(ScrnInfoPtr scrn,
int width,
int height);
-
- xf86SetConfigResponse
- (*set_config) (ScrnInfoPtr scrn,
- RRScreenConfigPtr screen_config,
- xf86CrtcSetConfigPtr crtc_configs,
- int num_configs);
-
- /**
- * Create a scanout pixmap
- */
- PixmapPtr
- (*create_scanout_pixmap)(ScrnInfoPtr scrn,
- int width,
- int height,
- Rotation rotations,
- xf86CrtcScanoutFormat *format);
-
} xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr;
typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen);
@@ -774,11 +683,6 @@ typedef struct _xf86CrtcConfig { /* callback when crtc configuration changes */
xf86_crtc_notify_proc_ptr xf86_crtc_notify;
- /*
- * Supported scanout pixmap formats
- */
- int num_scanout_formats;
- xf86CrtcScanoutFormat *scanout_formats;
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
@@ -824,11 +728,6 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn, int minWidth, int minHeight,
int maxWidth, int maxHeight);
-extern _X_EXPORT void
-xf86CrtcSetScanoutFormats (ScrnInfoPtr scrn,
- int num_formats,
- xf86CrtcScanoutFormat *formats);
-
/*
* Crtc functions
*/
@@ -839,12 +738,18 @@ xf86CrtcCreate (ScrnInfoPtr scrn, extern _X_EXPORT void
xf86CrtcDestroy (xf86CrtcPtr crtc);
+
/**
- * Change a crtc configuration (modes, outputs, etc)
+ * Sets the given video mode on the given crtc
*/
extern _X_EXPORT Bool
-xf86CrtcSet (xf86CrtcPtr crtc, xf86CrtcSetRec *set);
+xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ RRTransformPtr transform, int x, int y);
+
+extern _X_EXPORT Bool
+xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ int x, int y);
extern _X_EXPORT void
xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y);
@@ -855,14 +760,6 @@ xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y); extern _X_EXPORT Bool
xf86CrtcRotate (xf86CrtcPtr crtc);
-
-/*
- * Update cursor transform matrices after user changes
- * This is just the cursor subset of xf86CrtcRotate
- */
-extern _X_EXPORT void
-xf86CrtcRotateCursor (xf86CrtcPtr crtc);
-
/*
* Clean up any rotation data, used when a crtc is turned off
* as well as when rotation is disabled.
diff --git a/xorg-server/hw/xfree86/modes/xf86Cursors.c b/xorg-server/hw/xfree86/modes/xf86Cursors.c index 3c2958743..5562f29cc 100644 --- a/xorg-server/hw/xfree86/modes/xf86Cursors.c +++ b/xorg-server/hw/xfree86/modes/xf86Cursors.c @@ -338,7 +338,7 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) /*
* Transform position of cursor on screen
*/
- if (crtc->sprite_transform_in_use)
+ if (crtc->transform_in_use)
{
ScreenPtr screen = scrn->pScreen;
xf86CursorScreenPtr ScreenPriv =
@@ -349,7 +349,7 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) v.v[0] = (x + ScreenPriv->HotX) + 0.5;
v.v[1] = (y + ScreenPriv->HotY) + 0.5;
v.v[2] = 1;
- pixman_f_transform_point (&crtc->f_screen_to_crtc, &v);
+ pixman_f_transform_point (&crtc->f_framebuffer_to_crtc, &v);
/* cursor will have 0.5 added to it already so floor is sufficent */
x = floor (v.v[0]);
y = floor (v.v[1]);
diff --git a/xorg-server/hw/xfree86/modes/xf86RandR12.c b/xorg-server/hw/xfree86/modes/xf86RandR12.c index 7bfb6fa47..2b19d82ad 100644 --- a/xorg-server/hw/xfree86/modes/xf86RandR12.c +++ b/xorg-server/hw/xfree86/modes/xf86RandR12.c @@ -180,14 +180,14 @@ xf86RandR13VerifyPanningArea (xf86CrtcPtr crtc, int screenWidth, int screenHeigh */
static void
-xf86ComputeCrtcPan (Bool sprite_transform_in_use,
+xf86ComputeCrtcPan (Bool transform_in_use,
struct pixman_f_transform *m,
double screen_x, double screen_y,
double crtc_x, double crtc_y,
int old_pan_x, int old_pan_y,
int *new_pan_x, int *new_pan_y)
{
- if (sprite_transform_in_use) {
+ if (transform_in_use) {
/*
* Given the current transform, M, the current position
* on the Screen, S, and the desired position on the CRTC,
@@ -374,8 +374,8 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y) c.v[0] = x;
c.v[1] = y;
c.v[2] = 1.0;
- if (crtc->sprite_transform_in_use) {
- pixman_f_transform_point(&crtc->f_screen_to_crtc, &c);
+ if (crtc->transform_in_use) {
+ pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &c);
} else {
c.v[0] -= crtc->x;
c.v[1] -= crtc->y;
@@ -402,8 +402,8 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y) }
}
if (panned)
- xf86ComputeCrtcPan (crtc->sprite_transform_in_use,
- &crtc->f_screen_to_crtc,
+ xf86ComputeCrtcPan (crtc->transform_in_use,
+ &crtc->f_framebuffer_to_crtc,
x, y, c.v[0], c.v[1],
newX, newY, &newX, &newY);
}
@@ -414,7 +414,7 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y) * XXX This computation only works when we do not have a transform
* in use.
*/
- if (!crtc->sprite_transform_in_use)
+ if (!crtc->transform_in_use)
{
/* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
@@ -659,12 +659,10 @@ xf86RandR12SetConfig (ScreenPtr pScreen, static Bool
xf86RandR12ScreenSetSize (ScreenPtr pScreen,
- CARD16 width,
- CARD16 height,
- CARD16 pixWidth,
- CARD16 pixHeight,
- CARD32 mmWidth,
- CARD32 mmHeight)
+ CARD16 width,
+ CARD16 height,
+ CARD32 mmWidth,
+ CARD32 mmHeight)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
@@ -672,8 +670,6 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, WindowPtr pRoot = pScreen->root;
PixmapPtr pScrnPix;
Bool ret = FALSE;
- Bool pixSizeChanged = FALSE;
- Bool winSizeChanged = FALSE;
int c;
if (xf86RandR12Key) {
@@ -681,85 +677,46 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, {
randrp->virtualX = pScrn->virtualX;
randrp->virtualY = pScrn->virtualY;
- pixSizeChanged = TRUE;
}
}
+ if (pRoot && pScrn->vtSema)
+ (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
- pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
- if (pixWidth != pScrnPix->drawable.width ||
- pixHeight != pScrnPix->drawable.height)
- pixSizeChanged = TRUE;
-
- if (width != pScreen->width || height != pScreen->height)
- winSizeChanged = TRUE;
-
- if (pixSizeChanged)
- {
- if (pRoot && pScrn->vtSema)
- (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
-
- /* Let the driver update virtualX and virtualY */
- if (!(*config->funcs->resize)(pScrn, pixWidth, pixHeight))
- goto finish;
- }
+ /* Let the driver update virtualX and virtualY */
+ if (!(*config->funcs->resize)(pScrn, width, height))
+ goto finish;
ret = TRUE;
-
- if (winSizeChanged)
- {
- /* Update panning information */
- for (c = 0; c < config->num_crtc; c++) {
- xf86CrtcPtr crtc = config->crtc[c];
- if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 ||
- crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
- if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
- crtc->panningTotalArea.x2 += width - pScreen->width;
- if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
- crtc->panningTotalArea.y2 += height - pScreen->height;
- if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1)
- crtc->panningTrackingArea.x2 += width - pScreen->width;
- if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1)
- crtc->panningTrackingArea.y2 += height - pScreen->height;
- xf86RandR13VerifyPanningArea (crtc, width, height);
- xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
- }
+ /* Update panning information */
+ for (c = 0; c < config->num_crtc; c++) {
+ xf86CrtcPtr crtc = config->crtc[c];
+ if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 ||
+ crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
+ if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
+ crtc->panningTotalArea.x2 += width - pScreen->width;
+ if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
+ crtc->panningTotalArea.y2 += height - pScreen->height;
+ if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1)
+ crtc->panningTrackingArea.x2 += width - pScreen->width;
+ if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1)
+ crtc->panningTrackingArea.y2 += height - pScreen->height;
+ xf86RandR13VerifyPanningArea (crtc, width, height);
+ xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
}
}
pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
- pScreen->width = width;
- pScreen->height = height;
- if (pRoot)
- {
- BoxRec box;
-
- pRoot->drawable.width = width;
- pRoot->drawable.height = height;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = width;
- box.y2 = height;
- RegionInit(&pRoot->winSize, &box, 1);
- RegionInit(&pRoot->borderSize, &box, 1);
- }
- pScrnPix->drawable.width = pixWidth;
- pScrnPix->drawable.height = pixHeight;
+ pScreen->width = pScrnPix->drawable.width = width;
+ pScreen->height = pScrnPix->drawable.height = height;
randrp->mmWidth = pScreen->mmWidth = mmWidth;
randrp->mmHeight = pScreen->mmHeight = mmHeight;
- if (winSizeChanged)
- {
- xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1);
- xf86SetViewport (pScreen, 0, 0);
- }
+ xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1);
+ xf86SetViewport (pScreen, 0, 0);
finish:
- if (pixSizeChanged)
- {
- if (pRoot && pScrn->vtSema)
- (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
- }
-
+ if (pRoot && pScrn->vtSema)
+ (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
#if RANDR_12_INTERFACE
if (xf86RandR12Key && pScreen->root && ret)
RRScreenSizeNotify (pScreen);
@@ -801,7 +758,7 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) xf86CrtcPtr crtc = config->crtc[c];
int crtc_width = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation);
int crtc_height = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation);
-
+
if (crtc->enabled) {
if (crtc_width > width)
width = crtc_width;
@@ -813,13 +770,13 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) height = crtc->panningTotalArea.y2;
}
}
-
+
if (width && height)
{
/*
* Compute physical size of screen
*/
- if (monitorResolution)
+ if (monitorResolution)
{
mmWidth = width * 25.4 / monitorResolution;
mmHeight = height * 25.4 / monitorResolution;
@@ -861,8 +818,6 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) xf86RandR12ScreenSetSize (pScreen,
width,
height,
- width,
- height,
mmWidth,
mmHeight);
}
@@ -1052,7 +1007,7 @@ xf86RandRModeMatches (RRModePtr randr_mode, if (memcmp (randr_mode->name, mode->name, len) != 0) return FALSE;
}
#endif
-
+
/* check for same timings */
if (randr_mode->mode.dotClock / 1000 != mode->Clock) return FALSE;
if (randr_mode->mode.width != mode->HDisplay) return FALSE;
@@ -1064,11 +1019,11 @@ xf86RandRModeMatches (RRModePtr randr_mode, if (randr_mode->mode.vSyncStart != mode->VSyncStart) return FALSE;
if (randr_mode->mode.vSyncEnd != mode->VSyncEnd) return FALSE;
if (randr_mode->mode.vTotal != mode->VTotal) return FALSE;
-
+
/* check for same flags (using only the XF86 valid flag bits) */
if ((randr_mode->mode.modeFlags & FLAG_BITS) != (mode->Flags & FLAG_BITS))
return FALSE;
-
+
/* everything matches */
return TRUE;
}
@@ -1108,7 +1063,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) randr_output = output->randr_output;
randr_outputs[numOutputs++] = randr_output;
/*
- * We make copies of modes, so pointer equality
+ * We make copies of modes, so pointer equality
* isn't sufficient
*/
for (j = 0; j < randr_output->numModes + randr_output->numUserModes; j++)
@@ -1116,7 +1071,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) RRModePtr m = (j < randr_output->numModes ?
randr_output->modes[j] :
randr_output->userModes[j-randr_output->numModes]);
-
+
if (xf86RandRModeMatches (m, mode))
{
randr_mode = m;
@@ -1126,9 +1081,9 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) }
}
ret = RRCrtcNotify (randr_crtc, randr_mode, x, y,
- rotation,
+ rotation,
crtc->transformPresent ? &crtc->transform : NULL,
- numOutputs, randr_outputs, crtc->scanoutPixmap);
+ numOutputs, randr_outputs);
free(randr_outputs);
return ret;
}
@@ -1145,13 +1100,13 @@ xf86RandRModeConvert (ScrnInfoPtr scrn, mode->status = MODE_OK;
mode->Clock = randr_mode->mode.dotClock / 1000;
-
+
mode->HDisplay = randr_mode->mode.width;
mode->HSyncStart = randr_mode->mode.hSyncStart;
mode->HSyncEnd = randr_mode->mode.hSyncEnd;
mode->HTotal = randr_mode->mode.hTotal;
mode->HSkew = randr_mode->mode.hSkew;
-
+
mode->VDisplay = randr_mode->mode.height;
mode->VSyncStart = randr_mode->mode.vSyncStart;
mode->VSyncEnd = randr_mode->mode.vSyncEnd;
@@ -1171,15 +1126,14 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, int y,
Rotation rotation,
int num_randr_outputs,
- RROutputPtr *randr_outputs,
- PixmapPtr scanout_pixmap)
+ RROutputPtr *randr_outputs)
{
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86CrtcPtr crtc = randr_crtc->devPrivate;
RRTransformPtr transform;
- xf86CrtcSetFlags flags = 0;
+ Bool changed = FALSE;
int o, ro;
xf86CrtcPtr *save_crtcs;
Bool save_enabled = crtc->enabled;
@@ -1189,37 +1143,34 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, save_crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr));
if ((randr_mode != NULL) != crtc->enabled)
- flags |= XF86CrtcSetMode;
+ changed = TRUE;
else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode))
- flags |= XF86CrtcSetMode;
-
+ changed = TRUE;
+
if (rotation != crtc->rotation)
- flags |= XF86CrtcSetRotation;
+ changed = TRUE;
transform = RRCrtcGetTransform (randr_crtc);
if ((transform != NULL) != crtc->transformPresent)
- flags |= XF86CrtcSetTransform;
+ changed = TRUE;
else if (transform && memcmp (&transform->transform, &crtc->transform.transform,
sizeof (transform->transform)) != 0)
- flags |= XF86CrtcSetTransform;
-
- if (scanout_pixmap != crtc->scanoutPixmap)
- flags |= XF86CrtcSetScanoutPixmap;
+ changed = TRUE;
if (x != crtc->x || y != crtc->y)
- flags |= XF86CrtcSetOrigin;
- for (o = 0; o < config->num_output; o++)
+ changed = TRUE;
+ for (o = 0; o < config->num_output; o++)
{
xf86OutputPtr output = config->output[o];
xf86CrtcPtr new_crtc;
save_crtcs[o] = output->crtc;
-
+
if (output->crtc == crtc)
new_crtc = NULL;
else
new_crtc = output->crtc;
- for (ro = 0; ro < num_randr_outputs; ro++)
+ for (ro = 0; ro < num_randr_outputs; ro++)
if (output->randr_output == randr_outputs[ro])
{
new_crtc = crtc;
@@ -1227,16 +1178,16 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, }
if (new_crtc != output->crtc)
{
- flags |= XF86CrtcSetOutput;
+ changed = TRUE;
output->crtc = new_crtc;
}
}
- for (ro = 0; ro < num_randr_outputs; ro++)
+ for (ro = 0; ro < num_randr_outputs; ro++)
if (randr_outputs[ro]->pendingProperties)
- flags |= XF86CrtcSetProperty;
+ changed = TRUE;
/* XXX need device-independent mode setting code through an API */
- if (flags)
+ if (changed)
{
crtc->enabled = randr_mode != NULL;
@@ -1244,17 +1195,9 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, {
DisplayModeRec mode;
RRTransformPtr transform = RRCrtcGetTransform (randr_crtc);
- xf86CrtcSetRec set;
xf86RandRModeConvert (pScrn, randr_mode, &mode);
- set.mode = &mode;
- set.rotation = rotation;
- set.transform = transform;
- set.x = x;
- set.y = y;
- set.scanout_pixmap = scanout_pixmap;
- set.flags = flags;
- if (!xf86CrtcSet(crtc, &set))
+ if (!xf86CrtcSetModeTransform (crtc, &mode, rotation, transform, x, y))
{
crtc->enabled = save_enabled;
for (o = 0; o < config->num_output; o++)
@@ -1435,7 +1378,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) if (nmode) {
rrmodes = malloc(nmode * sizeof (RRModePtr));
-
+
if (!rrmodes)
return FALSE;
nmode = 0;
@@ -1445,7 +1388,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) if ((pref != 0) == ((mode->type & M_T_PREFERRED) != 0)) {
xRRModeInfo modeInfo;
RRModePtr rrmode;
-
+
modeInfo.nameLength = strlen (mode->name);
modeInfo.width = mode->HDisplay;
modeInfo.dotClock = mode->Clock * 1000;
@@ -1469,7 +1412,7 @@ xf86RROutputSetModes (RROutputPtr randr_output, DisplayModePtr modes) }
}
}
-
+
ret = RROutputSetModes (randr_output, rrmodes, nmode, npreferred);
free(rrmodes);
return ret;
@@ -1489,13 +1432,13 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) int o, c, l;
RRCrtcPtr randr_crtc;
int nclone;
-
+
clones = malloc(config->num_output * sizeof (RROutputPtr));
crtcs = malloc(config->num_crtc * sizeof (RRCrtcPtr));
for (o = 0; o < config->num_output; o++)
{
xf86OutputPtr output = config->output[o];
-
+
ncrtc = 0;
for (c = 0; c < config->num_crtc; c++)
if (output->possible_crtcs & (1 << c))
@@ -1513,7 +1456,7 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) return FALSE;
}
- RROutputSetPhysicalSize(output->randr_output,
+ RROutputSetPhysicalSize(output->randr_output,
output->mm_width,
output->mm_height);
xf86RROutputSetModes (output->randr_output, output->probed_modes);
@@ -1539,7 +1482,7 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) for (l = 0; l < config->num_output; l++)
{
xf86OutputPtr clone = config->output[l];
-
+
if (l != o && (output->possible_clones & (1 << l)))
clones[nclone++] = clone->randr_output;
}
@@ -1580,7 +1523,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int c;
int o;
-
+
if (!RRInit ())
return FALSE;
@@ -1590,7 +1533,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen) for (c = 0; c < config->num_crtc; c++)
{
xf86CrtcPtr crtc = config->crtc[c];
-
+
crtc->randr_crtc = RRCrtcCreate (pScreen, crtc);
RRCrtcGammaSetSize (crtc->randr_crtc, 256);
}
@@ -1601,7 +1544,7 @@ xf86RandR12CreateObjects12 (ScreenPtr pScreen) {
xf86OutputPtr output = config->output[o];
- output->randr_output = RROutputCreate (pScreen, output->name,
+ output->randr_output = RROutputCreate (pScreen, output->name,
strlen (output->name),
output);
@@ -1624,7 +1567,7 @@ xf86RandR12CreateScreenResources12 (ScreenPtr pScreen) for (c = 0; c < config->num_crtc; c++)
xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
-
+
RRScreenSetSizeRange (pScreen, config->minWidth, config->minHeight,
config->maxWidth, config->maxHeight);
return TRUE;
@@ -1782,174 +1725,6 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) return Success;
}
-static RRScanoutPixmapInfo *
-xf86RRQueryScanoutPixmaps(ScreenPtr screen, int *n_info)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- RRScanoutPixmapInfo *info;
- int f;
-
- info = calloc(config->num_scanout_formats, sizeof (RRScanoutPixmapInfo));
- if (config->num_scanout_formats && !info) {
- *n_info = 0;
- return NULL;
- }
- for (f = 0; f < config->num_scanout_formats; f++) {
- info[f].maxWidth = config->scanout_formats[f].maxWidth;
- info[f].maxHeight = config->scanout_formats[f].maxHeight;
- info[f].depth = config->scanout_formats[f].depth;
- info[f].rotations = config->scanout_formats[f].rotations;
- info[f].format = PictureMatchFormat (screen, info[f].depth,
- config->scanout_formats[f].format);
- }
- *n_info = config->num_scanout_formats;
- return info;
-}
-
-static PixmapPtr
-xf86RRCreateScanoutPixmap(ScreenPtr screen,
- int width, int height, int depth,
- Rotation rotations,
- PictFormatPtr format)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int f;
-
- if (!config->funcs->create_scanout_pixmap)
- return NullPixmap;
-
- for (f = 0; f < config->num_scanout_formats; f++)
- if (config->scanout_formats[f].depth == depth &&
- (config->scanout_formats[f].format & 0xffffff) == format->format) {
- return (*config->funcs->create_scanout_pixmap) (scrn, width, height,
- rotations,
- &config->scanout_formats[f]);
- }
- return NullPixmap;
-}
-
-static void
-xf86RandR14SetCrtcSpriteTransform(ScreenPtr pScreen,
- RRCrtcPtr randr_crtc,
- struct pixman_f_transform *f_position_transform,
- struct pixman_f_transform *f_image_transform)
-{
- xf86CrtcPtr crtc = randr_crtc->devPrivate;
-
- crtc->user_sprite_position_transform = *f_position_transform;
- crtc->user_sprite_image_transform = *f_image_transform;
- xf86CrtcRotateCursor(crtc);
- xf86_reload_cursors(pScreen);
-}
-
-static Bool
-xf86RRConvertCrtcConfig(xf86CrtcSetConfigPtr xf86_config,
- RRCrtcConfigPtr rr_config)
-{
- RRCrtcPtr rr_crtc = rr_config->crtc;
- xf86CrtcPtr crtc = rr_crtc->devPrivate;
- ScrnInfoPtr scrn = xf86Screens[rr_crtc->pScreen->myNum];
- int o;
-
- xf86_config->crtc = crtc;
- xf86_config->x = rr_config->x;
- xf86_config->y = rr_config->y;
- xf86RandRModeConvert(scrn, rr_config->mode, &xf86_config->mode);
- xf86_config->rotation = rr_config->rotation;
- xf86_config->numOutputs = rr_config->numOutputs;
- xf86_config->outputs = calloc(rr_config->numOutputs, sizeof (xf86OutputPtr));
- if (!xf86_config->outputs)
- return FALSE;
- for (o = 0; o < rr_config->numOutputs; o++)
- xf86_config->outputs[o] = rr_config->outputs[o]->devPrivate;
- xf86_config->sprite_position_transform = rr_config->sprite_position_f_transform;
- xf86_config->sprite_image_transform = rr_config->sprite_image_f_transform;
- xf86_config->pixmap = rr_config->pixmap;
- xf86_config->pixmap_x = rr_config->pixmap_x;
- xf86_config->pixmap_y = rr_config->pixmap_y;
- return TRUE;
-}
-
-static void
-xf86FreeCrtcSetConfigs(xf86CrtcSetConfigPtr xf86_crtc_configs, int num_configs)
-{
- int i;
-
- for (i = 0; i < num_configs; i++)
- free(xf86_crtc_configs[i].outputs);
- free(xf86_crtc_configs);
-}
-
-static Bool
-xf86RRSetCrtcConfigs(ScreenPtr screen,
- RRScreenConfigPtr screen_config,
- RRCrtcConfigPtr crtc_configs,
- int num_configs)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- if (config->funcs->set_config) {
- xf86CrtcSetConfigPtr xf86_crtc_configs;
- int i;
- xf86SetConfigResponse response;
-
- /*
- * Convert RRCrtcConfigRecs to xf86CrtcSetConfigs
- */
- xf86_crtc_configs = calloc(num_configs, sizeof (xf86CrtcSetConfigRec));
- if (!xf86_crtc_configs)
- return FALSE;
- for (i = 0; i < num_configs; i++)
- if (!xf86RRConvertCrtcConfig(&xf86_crtc_configs[i], &crtc_configs[i])) {
- xf86FreeCrtcSetConfigs(xf86_crtc_configs, num_configs);
- return FALSE;
- }
-
- /*
- * Ask the driver to set the configuration
- */
- response = (*config->funcs->set_config)(scrn,
- screen_config,
- xf86_crtc_configs,
- num_configs);
- xf86FreeCrtcSetConfigs(xf86_crtc_configs, num_configs);
-
- /*
- * The driver is allowed to answer with one of three
- * responses:
- */
- switch (response) {
- case xf86SetConfigFailed:
-
- /* The configuration isn't usable, or some error
- * occurred while setting it. Everything has been
- * cleaned up and we're ready to return an error
- * back to the client
- */
- return FALSE;
- case xf86SetConfigDone:
-
- /* The configuration was acceptable, and the whole
- * mode setting experience is over. Nothing more to do
- * here.
- */
- return TRUE;
- case xf86SetConfigChecked:
-
- /* The configuration was acceptable, but the driver
- * didn't actually do anything. Go ask the DIX code
- * to do the mode setting operation using the simpler
- * interfaces
- */
- break;
- }
- }
- return miRRSetCrtcConfigs(screen, screen_config, crtc_configs, num_configs);
-}
-
static Bool
xf86RandR12EnterVT (int screen_index, int flags)
{
@@ -1958,7 +1733,6 @@ xf86RandR12EnterVT (int screen_index, int flags) XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
rrScrPrivPtr rp = rrGetScrPriv(pScreen);
Bool ret;
- int i;
if (randrp->orig_EnterVT) {
pScrn->EnterVT = randrp->orig_EnterVT;
@@ -1970,6 +1744,7 @@ xf86RandR12EnterVT (int screen_index, int flags) }
/* reload gamma */
+ int i;
for (i = 0; i < rp->numCrtcs; i++)
xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]);
@@ -1991,17 +1766,15 @@ xf86RandR12Init12 (ScreenPtr pScreen) rp->rrCrtcGetGamma = xf86RandR12CrtcGetGamma;
rp->rrOutputSetProperty = xf86RandR12OutputSetProperty;
rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
+#if RANDR_13_INTERFACE
rp->rrOutputGetProperty = xf86RandR13OutputGetProperty;
rp->rrGetPanning = xf86RandR13GetPanning;
rp->rrSetPanning = xf86RandR13SetPanning;
+#endif
rp->rrModeDestroy = xf86RandR12ModeDestroy;
rp->rrSetConfig = NULL;
pScrn->PointerMoved = xf86RandR12PointerMoved;
pScrn->ChangeGamma = xf86RandR12ChangeGamma;
- rp->rrSetCrtcSpriteTransform = xf86RandR14SetCrtcSpriteTransform;
- rp->rrSetCrtcConfigs = xf86RRSetCrtcConfigs;
- rp->rrQueryScanoutPixmaps = xf86RRQueryScanoutPixmaps;
- rp->rrCreateScanoutPixmap = xf86RRCreateScanoutPixmap;
randrp->orig_EnterVT = pScrn->EnterVT;
pScrn->EnterVT = xf86RandR12EnterVT;
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index 0181bc381..655857597 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -369,39 +369,6 @@ xf86CrtcFitsScreen (xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb) 0 <= b.y1 && b.y2 <= pScrn->virtualY);
}
-/*
- * A subset of xf86CrtcRotate that just deals with
- * cursor image/position transforms. Used when changing
- * the cursor transform
- */
-void
-xf86CrtcRotateCursor (xf86CrtcPtr crtc)
-{
- /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
- RRTransformPtr transform = NULL;
- PictTransform crtc_to_fb;
- struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc, f_screen_to_crtc, f_crtc_to_cursor;
-
- if (crtc->transformPresent)
- transform = &crtc->transform;
-
- (void) RRTransformCompute (crtc->x, crtc->y,
- crtc->mode.HDisplay, crtc->mode.VDisplay,
- crtc->rotation,
- transform,
- &crtc->user_sprite_position_transform,
- &crtc->user_sprite_image_transform,
-
- &crtc_to_fb,
- &f_crtc_to_fb,
- &f_fb_to_crtc,
- &f_screen_to_crtc,
- &f_crtc_to_cursor,
- &crtc->sprite_transform_in_use);
- crtc->f_screen_to_crtc = f_screen_to_crtc;
- crtc->f_crtc_to_cursor = f_crtc_to_cursor;
-}
-
Bool
xf86CrtcRotate (xf86CrtcPtr crtc)
{
@@ -410,7 +377,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
PictTransform crtc_to_fb;
- struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc, f_screen_to_crtc, f_crtc_to_cursor;
+ struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc;
xFixed *new_params = NULL;
int new_nparams = 0;
PictFilterPtr new_filter = NULL;
@@ -426,15 +393,10 @@ xf86CrtcRotate (xf86CrtcPtr crtc) crtc->mode.HDisplay, crtc->mode.VDisplay,
crtc->rotation,
transform,
- &crtc->user_sprite_position_transform,
- &crtc->user_sprite_image_transform,
&crtc_to_fb,
&f_crtc_to_fb,
- &f_fb_to_crtc,
- &f_screen_to_crtc,
- &f_crtc_to_cursor,
- &crtc->sprite_transform_in_use) &&
+ &f_fb_to_crtc) &&
xf86CrtcFitsScreen (crtc, &f_crtc_to_fb))
{
/*
@@ -543,8 +505,6 @@ xf86CrtcRotate (xf86CrtcPtr crtc) crtc->crtc_to_framebuffer = crtc_to_fb;
crtc->f_crtc_to_framebuffer = f_crtc_to_fb;
crtc->f_framebuffer_to_crtc = f_fb_to_crtc;
- crtc->f_screen_to_crtc = f_screen_to_crtc;
- crtc->f_crtc_to_cursor = f_crtc_to_cursor;
free(crtc->params);
crtc->params = new_params;
crtc->nparams = new_nparams;
diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c index 62618afd8..7775e5dff 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c +++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c @@ -50,11 +50,7 @@ static Bool ShareVTs = FALSE; #ifdef PCCONS_SUPPORT
/* Stock 0.1 386bsd pccons console driver interface */
-#ifndef __OpenBSD__
-# define PCCONS_CONSOLE_DEV1 "/dev/ttyv0"
-#else
-# define PCCONS_CONSOLE_DEV1 "/dev/ttyC0"
-#endif
+#define PCCONS_CONSOLE_DEV1 "/dev/ttyv0"
#define PCCONS_CONSOLE_DEV2 "/dev/vga"
#define PCCONS_CONSOLE_MODE O_RDWR|O_NDELAY
#endif
diff --git a/xorg-server/hw/xfree86/os-support/xf86_OSlib.h b/xorg-server/hw/xfree86/os-support/xf86_OSlib.h index 3b646da70..926e6a725 100644 --- a/xorg-server/hw/xfree86/os-support/xf86_OSlib.h +++ b/xorg-server/hw/xfree86/os-support/xf86_OSlib.h @@ -1,427 +1,419 @@ -/* - * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany - * Copyright 1992 by David Dawes <dawes@XFree86.org> - * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu> - * Copyright 1992 by Rich Murphey <Rich@Rice.edu> - * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu> - * Copyright 1992 by Orest Zborowski <obz@eskimo.com> - * Copyright 1993 by Vrije Universiteit, The Netherlands - * Copyright 1993 by David Wexelblat <dwex@XFree86.org> - * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de> - * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk> - * Copyright 1994-2003 by The XFree86 Project, Inc - * - * 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 names of the above listed copyright holders - * not be used in advertising or publicity pertaining to distribution of - * the software without specific, written prior permission. The above listed - * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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. - * - */ - -/* - * The ARM32 code here carries the following copyright: - * - * Copyright 1997 - * Digital Equipment Corporation. All rights reserved. - * This software is furnished under license and may be used and copied only in - * accordance with the following terms and conditions. Subject to these - * conditions, you may download, copy, install, use, modify and distribute - * this software in source and/or binary form. No title or ownership is - * transferred hereby. - * - * 1) Any source code used, modified or distributed must reproduce and retain - * this copyright notice and list of conditions as they appear in the - * source file. - * - * 2) No right is granted to use any trade name, trademark, or logo of Digital - * Equipment Corporation. Neither the "Digital Equipment Corporation" - * name nor any trademark or logo of Digital Equipment Corporation may be - * used to endorse or promote products derived from this software without - * the prior written permission of Digital Equipment Corporation. - * - * 3) This software is provided "AS-IS" and any express or implied warranties, - * including but not limited to, any implied warranties of merchantability, - * fitness for a particular purpose, or non-infringement are disclaimed. - * In no event shall DIGITAL be liable for any damages whatsoever, and in - * particular, DIGITAL shall not be liable for special, indirect, - * consequential, or incidental damages or damages for lost profits, loss - * of revenue or loss of use, whether such damages arise in contract, - * negligence, tort, under statute, in equity, at law or otherwise, even - * if advised of the possibility of such damage. - * - */ - -/* - * This is private, and should not be included by any drivers. Drivers - * may include xf86_OSproc.h to get prototypes for public interfaces. - */ - -#ifndef _XF86_OSLIB_H -#define _XF86_OSLIB_H - -#include <X11/Xos.h> -#include <X11/Xfuncproto.h> - -#include <stdio.h> -#include <ctype.h> -#include <stddef.h> - -/**************************************************************************/ -/* SYSV386 (SVR3, SVR4), including Solaris */ -/**************************************************************************/ -#if (defined(SYSV) || defined(SVR4)) && \ - (defined(sun) || defined(__i386__)) -# include <sys/ioctl.h> -# include <signal.h> -# include <termio.h> -# include <sys/stat.h> -# include <sys/types.h> - - -# include <errno.h> - -# if defined(_NEED_SYSI86) -# if !(defined (sun) && defined (SVR4)) -# include <sys/immu.h> -# include <sys/region.h> -# endif -# include <sys/proc.h> -# include <sys/tss.h> -# include <sys/sysi86.h> -# if defined(SVR4) && !defined(sun) -# include <sys/seg.h> -# endif /* SVR4 && !sun */ -/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */ -# if !defined(V86SC_IOPL) /* Solaris 7 or later? */ -# include <sys/v86.h> /* Nope */ -# endif -# if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) -# include <sys/psw.h> -# endif -# endif /* _NEED_SYSI86 */ - -# if defined(HAS_SVR3_MMAPDRV) -# include <sys/sysmacros.h> -# if !defined(_NEED_SYSI86) -# include <sys/immu.h> -# include <sys/region.h> -# endif -# include <sys/mmap.h> /* MMAP driver header */ -# endif - -# if !defined(sun) || defined(HAVE_SYS_VT_H) -# define HAS_USL_VTS -# endif -# if !defined(sun) -# include <sys/emap.h> -# endif -# if defined(HAS_USL_VTS) -# if !defined(sun) -# include <sys/at_ansi.h> -# endif -# include <sys/kd.h> -# include <sys/vt.h> -# endif - -# if defined(sun) -# include <sys/fbio.h> -# include <sys/kbd.h> -# include <sys/kbio.h> - -/* undefine symbols from <sys/kbd.h> we don't need that conflict with enum - definitions in parser/xf86tokens.h */ -# undef STRING -# undef LEFTALT -# undef RIGHTALT - -# define LED_CAP LED_CAPS_LOCK -# define LED_NUM LED_NUM_LOCK -# define LED_SCR LED_SCROLL_LOCK -# define LED_COMP LED_COMPOSE -# endif /* sun */ - -# if !defined(VT_ACKACQ) -# define VT_ACKACQ 2 -# endif /* !VT_ACKACQ */ - - -# if defined(SVR4) -# include <sys/mman.h> -# if !(defined(sun) && defined (SVR4)) -# define DEV_MEM "/dev/pmem" -# endif -# define CLEARDTR_SUPPORT -# define POSIX_TTY -# endif /* SVR4 */ - - -# if defined(sun) && defined(HAS_USL_VTS) -# define USE_VT_SYSREQ -# endif - -#endif /* (SYSV || SVR4) */ - -/**************************************************************************/ -/* Linux or Glibc-based system */ -/**************************************************************************/ -#if defined(__linux__) || defined(__GLIBC__) -# include <sys/ioctl.h> -# include <signal.h> -# include <stdlib.h> -# include <sys/types.h> -# include <assert.h> - -# ifdef __linux__ -# include <termio.h> -# else /* __GLIBC__ */ -# include <termios.h> -# endif -# ifdef __sparc__ -# include <sys/param.h> -# endif - -# include <errno.h> - -# include <sys/stat.h> - -# include <sys/mman.h> -# ifdef __linux__ -# define HAS_USL_VTS -# include <sys/kd.h> -# include <sys/vt.h> -# define LDGMAP GIO_SCRNMAP -# define LDSMAP PIO_SCRNMAP -# define LDNMAP LDSMAP -# define CLEARDTR_SUPPORT -# define USE_VT_SYSREQ -# endif - -# define POSIX_TTY - -#endif /* __linux__ || __GLIBC__ */ - -/**************************************************************************/ -/* 386BSD and derivatives, BSD/386 */ -/**************************************************************************/ - -#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__)) -# undef __386BSD__ -#endif - -#ifdef CSRG_BASED -# include <sys/ioctl.h> -# include <signal.h> - -# include <termios.h> -# define termio termios -# define POSIX_TTY - -# include <errno.h> - -# include <sys/types.h> -# include <sys/mman.h> -# include <sys/stat.h> - -# if defined(__bsdi__) -# include <sys/param.h> -# if (_BSDI_VERSION < 199510) -# include <i386/isa/vgaioctl.h> -# endif -# endif /* __bsdi__ */ - -#endif /* CSRG_BASED */ - -/**************************************************************************/ -/* Kernel of *BSD */ -/**************************************************************************/ -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) - -# include <sys/param.h> -# if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version) -# define __FreeBSD_kernel_version __FreeBSD_version -# endif - -# if !defined(LINKKIT) - /* Don't need this stuff for the Link Kit */ -# if defined(__bsdi__) -# include <i386/isa/pcconsioctl.h> -# define CONSOLE_X_MODE_ON PCCONIOCRAW -# define CONSOLE_X_MODE_OFF PCCONIOCCOOK -# define CONSOLE_X_BELL PCCONIOCBEEP -# else /* __bsdi__ */ -# if defined(__OpenBSD__) -# ifdef PCCONS_SUPPORT -# include <machine/pccons.h> -# undef CONSOLE_X_MODE_ON -# undef CONSOLE_X_MODE_OFF -# undef CONSOLE_X_BELL -# endif -# endif -# ifdef SYSCONS_SUPPORT -# define COMPAT_SYSCONS -# if defined(__NetBSD__) || defined(__OpenBSD__) -# include <machine/console.h> -# else -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000) -# include <sys/consio.h> -# include <sys/kbio.h> -# else -# include <machine/console.h> -# endif /* FreeBSD 4.1 RELEASE or lator */ -# else -# include <sys/console.h> -# endif -# endif -# endif /* SYSCONS_SUPPORT */ -# if defined(PCVT_SUPPORT) -# if !defined(SYSCONS_SUPPORT) - /* no syscons, so include pcvt specific header file */ -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -# include <machine/pcvt_ioctl.h> -# else -# if defined(__NetBSD__) || defined(__OpenBSD__) -# if !defined(WSCONS_SUPPORT) -# include <machine/pcvt_ioctl.h> -# endif /* WSCONS_SUPPORT */ -# else -# include <sys/pcvt_ioctl.h> -# endif /* __NetBSD__ */ -# endif /* __FreeBSD_kernel__ || __OpenBSD__ */ -# else /* pcvt and syscons: hard-code the ID magic */ -# define VGAPCVTID _IOWR('V',113, struct pcvtid) - struct pcvtid { - char name[16]; - int rmajor, rminor; - }; -# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */ -# endif /* PCVT_SUPPORT */ -# ifdef WSCONS_SUPPORT -# include <dev/wscons/wsconsio.h> -# include <dev/wscons/wsdisplay_usl_io.h> -# endif /* WSCONS_SUPPORT */ -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -# if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013) -# include <sys/mouse.h> -# else -# undef MOUSE_GETINFO -# include <machine/mouse.h> -# endif -# endif - /* Include these definitions in case ioctl_pc.h didn't get included */ -# ifndef CONSOLE_X_MODE_ON -# define CONSOLE_X_MODE_ON _IO('t',121) -# endif -# ifndef CONSOLE_X_MODE_OFF -# define CONSOLE_X_MODE_OFF _IO('t',122) -# endif -# ifndef CONSOLE_X_BELL -# define CONSOLE_X_BELL _IOW('t',123,int[2]) -# endif -# ifndef CONSOLE_X_TV_ON -# define CONSOLE_X_TV_ON _IOW('t',155,int) -# define XMODE_RGB 0 -# define XMODE_NTSC 1 -# define XMODE_PAL 2 -# define XMODE_SECAM 3 -# endif -# ifndef CONSOLE_X_TV_OFF -# define CONSOLE_X_TV_OFF _IO('t',156) -# endif -#ifndef CONSOLE_GET_LINEAR_INFO -# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info) -#endif -#ifndef CONSOLE_GET_IO_INFO -# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info) -#endif -#ifndef CONSOLE_GET_MEM_INFO -# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info) -#endif -# endif /* __bsdi__ */ -# endif /* !LINKKIT */ - -#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL) -#include <machine/sysarch.h> -#endif - -# define CLEARDTR_SUPPORT - -# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT) -# define USE_VT_SYSREQ -# endif - -#endif -/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */ - -/**************************************************************************/ -/* IRIX */ -/**************************************************************************/ - -/**************************************************************************/ -/* Generic */ -/**************************************************************************/ - -#include <sys/wait.h> /* May need to adjust this for other OSs */ - -/* - * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere, - * and it's safe, so just do it. - */ -#if !defined(O_NDELAY) && defined(O_NONBLOCK) -# define O_NDELAY O_NONBLOCK -#endif /* !O_NDELAY && O_NONBLOCK */ - -#if !defined(MAXHOSTNAMELEN) -# define MAXHOSTNAMELEN 32 -#endif /* !MAXHOSTNAMELEN */ - -#if defined(_POSIX_SOURCE) -# include <limits.h> -#else -# define _POSIX_SOURCE -# include <limits.h> -# undef _POSIX_SOURCE -#endif /* _POSIX_SOURCE */ - -#if !defined(PATH_MAX) -# if defined(MAXPATHLEN) -# define PATH_MAX MAXPATHLEN -# else -# define PATH_MAX 1024 -# endif /* MAXPATHLEN */ -#endif /* !PATH_MAX */ - - -#ifndef DEV_MEM -#define DEV_MEM "/dev/mem" -#endif - -#ifndef VT_SYSREQ_DEFAULT -#define VT_SYSREQ_DEFAULT FALSE -#endif - -#define SYSCALL(call) while(((call) == -1) && (errno == EINTR)) - -#define XF86_OS_PRIVS -#include "xf86_OSproc.h" - -#ifndef NO_COMPILER_H -#include "compiler.h" -#endif - -#endif /* _XF86_OSLIB_H */ +/*
+ * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1992 by David Dawes <dawes@XFree86.org>
+ * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
+ * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
+ * Copyright 1993 by Vrije Universiteit, The Netherlands
+ * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
+ * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
+ * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
+ * Copyright 1994-2003 by The XFree86 Project, Inc
+ *
+ * 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 names of the above listed copyright holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ * This software is furnished under license and may be used and copied only in
+ * accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * this software in source and/or binary form. No title or ownership is
+ * transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and retain
+ * this copyright notice and list of conditions as they appear in the
+ * source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied warranties,
+ * including but not limited to, any implied warranties of merchantability,
+ * fitness for a particular purpose, or non-infringement are disclaimed.
+ * In no event shall DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+/*
+ * This is private, and should not be included by any drivers. Drivers
+ * may include xf86_OSproc.h to get prototypes for public interfaces.
+ */
+
+#ifndef _XF86_OSLIB_H
+#define _XF86_OSLIB_H
+
+#include <X11/Xos.h>
+#include <X11/Xfuncproto.h>
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stddef.h>
+
+/**************************************************************************/
+/* SYSV386 (SVR3, SVR4), including Solaris */
+/**************************************************************************/
+#if (defined(SYSV) || defined(SVR4)) && \
+ (defined(sun) || defined(__i386__))
+# include <sys/ioctl.h>
+# include <signal.h>
+# include <termio.h>
+# include <sys/stat.h>
+# include <sys/types.h>
+
+
+# include <errno.h>
+
+# if defined(_NEED_SYSI86)
+# if !(defined (sun) && defined (SVR4))
+# include <sys/immu.h>
+# include <sys/region.h>
+# endif
+# include <sys/proc.h>
+# include <sys/tss.h>
+# include <sys/sysi86.h>
+# if defined(SVR4) && !defined(sun)
+# include <sys/seg.h>
+# endif /* SVR4 && !sun */
+/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
+# if !defined(V86SC_IOPL) /* Solaris 7 or later? */
+# include <sys/v86.h> /* Nope */
+# endif
+# if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
+# include <sys/psw.h>
+# endif
+# endif /* _NEED_SYSI86 */
+
+# if defined(HAS_SVR3_MMAPDRV)
+# include <sys/sysmacros.h>
+# if !defined(_NEED_SYSI86)
+# include <sys/immu.h>
+# include <sys/region.h>
+# endif
+# include <sys/mmap.h> /* MMAP driver header */
+# endif
+
+# if !defined(sun) || defined(HAVE_SYS_VT_H)
+# define HAS_USL_VTS
+# endif
+# if !defined(sun)
+# include <sys/emap.h>
+# endif
+# if defined(HAS_USL_VTS)
+# if !defined(sun)
+# include <sys/at_ansi.h>
+# endif
+# include <sys/kd.h>
+# include <sys/vt.h>
+# endif
+
+# if defined(sun)
+# include <sys/fbio.h>
+# include <sys/kbd.h>
+# include <sys/kbio.h>
+
+/* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
+ definitions in parser/xf86tokens.h */
+# undef STRING
+# undef LEFTALT
+# undef RIGHTALT
+
+# define LED_CAP LED_CAPS_LOCK
+# define LED_NUM LED_NUM_LOCK
+# define LED_SCR LED_SCROLL_LOCK
+# define LED_COMP LED_COMPOSE
+# endif /* sun */
+
+# if !defined(VT_ACKACQ)
+# define VT_ACKACQ 2
+# endif /* !VT_ACKACQ */
+
+
+# if defined(SVR4)
+# include <sys/mman.h>
+# if !(defined(sun) && defined (SVR4))
+# define DEV_MEM "/dev/pmem"
+# endif
+# define CLEARDTR_SUPPORT
+# define POSIX_TTY
+# endif /* SVR4 */
+
+
+# if defined(sun) && defined(HAS_USL_VTS)
+# define USE_VT_SYSREQ
+# endif
+
+#endif /* (SYSV || SVR4) */
+
+/**************************************************************************/
+/* Linux or Glibc-based system */
+/**************************************************************************/
+#if defined(__linux__) || defined(__GLIBC__)
+# include <sys/ioctl.h>
+# include <signal.h>
+# include <stdlib.h>
+# include <sys/types.h>
+# include <assert.h>
+
+# ifdef __linux__
+# include <termio.h>
+# else /* __GLIBC__ */
+# include <termios.h>
+# endif
+# ifdef __sparc__
+# include <sys/param.h>
+# endif
+
+# include <errno.h>
+
+# include <sys/stat.h>
+
+# include <sys/mman.h>
+# ifdef __linux__
+# define HAS_USL_VTS
+# include <sys/kd.h>
+# include <sys/vt.h>
+# define LDGMAP GIO_SCRNMAP
+# define LDSMAP PIO_SCRNMAP
+# define LDNMAP LDSMAP
+# define CLEARDTR_SUPPORT
+# define USE_VT_SYSREQ
+# endif
+
+# define POSIX_TTY
+
+#endif /* __linux__ || __GLIBC__ */
+
+/**************************************************************************/
+/* 386BSD and derivatives, BSD/386 */
+/**************************************************************************/
+
+#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
+# undef __386BSD__
+#endif
+
+#ifdef CSRG_BASED
+# include <sys/ioctl.h>
+# include <signal.h>
+
+# include <termios.h>
+# define termio termios
+# define POSIX_TTY
+
+# include <errno.h>
+
+# include <sys/types.h>
+# include <sys/mman.h>
+# include <sys/stat.h>
+
+# if defined(__bsdi__)
+# include <sys/param.h>
+# if (_BSDI_VERSION < 199510)
+# include <i386/isa/vgaioctl.h>
+# endif
+# endif /* __bsdi__ */
+
+#endif /* CSRG_BASED */
+
+/**************************************************************************/
+/* Kernel of *BSD */
+/**************************************************************************/
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
+
+# include <sys/param.h>
+# if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
+# define __FreeBSD_kernel_version __FreeBSD_version
+# endif
+
+# if !defined(LINKKIT)
+ /* Don't need this stuff for the Link Kit */
+# if defined(__bsdi__)
+# include <i386/isa/pcconsioctl.h>
+# define CONSOLE_X_MODE_ON PCCONIOCRAW
+# define CONSOLE_X_MODE_OFF PCCONIOCCOOK
+# define CONSOLE_X_BELL PCCONIOCBEEP
+# else /* __bsdi__ */
+# ifdef SYSCONS_SUPPORT
+# define COMPAT_SYSCONS
+# if defined(__NetBSD__) || defined(__OpenBSD__)
+# include <machine/console.h>
+# else
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
+# include <sys/consio.h>
+# include <sys/kbio.h>
+# else
+# include <machine/console.h>
+# endif /* FreeBSD 4.1 RELEASE or lator */
+# else
+# include <sys/console.h>
+# endif
+# endif
+# endif /* SYSCONS_SUPPORT */
+# if defined(PCVT_SUPPORT)
+# if !defined(SYSCONS_SUPPORT)
+ /* no syscons, so include pcvt specific header file */
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+# include <machine/pcvt_ioctl.h>
+# else
+# if defined(__NetBSD__) || defined(__OpenBSD__)
+# if !defined(WSCONS_SUPPORT)
+# include <machine/pcvt_ioctl.h>
+# endif /* WSCONS_SUPPORT */
+# else
+# include <sys/pcvt_ioctl.h>
+# endif /* __NetBSD__ */
+# endif /* __FreeBSD_kernel__ || __OpenBSD__ */
+# else /* pcvt and syscons: hard-code the ID magic */
+# define VGAPCVTID _IOWR('V',113, struct pcvtid)
+ struct pcvtid {
+ char name[16];
+ int rmajor, rminor;
+ };
+# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
+# endif /* PCVT_SUPPORT */
+# ifdef WSCONS_SUPPORT
+# include <dev/wscons/wsconsio.h>
+# include <dev/wscons/wsdisplay_usl_io.h>
+# endif /* WSCONS_SUPPORT */
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+# if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013)
+# include <sys/mouse.h>
+# else
+# undef MOUSE_GETINFO
+# include <machine/mouse.h>
+# endif
+# endif
+ /* Include these definitions in case ioctl_pc.h didn't get included */
+# ifndef CONSOLE_X_MODE_ON
+# define CONSOLE_X_MODE_ON _IO('t',121)
+# endif
+# ifndef CONSOLE_X_MODE_OFF
+# define CONSOLE_X_MODE_OFF _IO('t',122)
+# endif
+# ifndef CONSOLE_X_BELL
+# define CONSOLE_X_BELL _IOW('t',123,int[2])
+# endif
+# ifndef CONSOLE_X_TV_ON
+# define CONSOLE_X_TV_ON _IOW('t',155,int)
+# define XMODE_RGB 0
+# define XMODE_NTSC 1
+# define XMODE_PAL 2
+# define XMODE_SECAM 3
+# endif
+# ifndef CONSOLE_X_TV_OFF
+# define CONSOLE_X_TV_OFF _IO('t',156)
+# endif
+#ifndef CONSOLE_GET_LINEAR_INFO
+# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
+#endif
+#ifndef CONSOLE_GET_IO_INFO
+# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
+#endif
+#ifndef CONSOLE_GET_MEM_INFO
+# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
+#endif
+# endif /* __bsdi__ */
+# endif /* !LINKKIT */
+
+#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
+#include <machine/sysarch.h>
+#endif
+
+# define CLEARDTR_SUPPORT
+
+# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
+# define USE_VT_SYSREQ
+# endif
+
+#endif
+/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
+
+/**************************************************************************/
+/* IRIX */
+/**************************************************************************/
+
+/**************************************************************************/
+/* Generic */
+/**************************************************************************/
+
+#include <sys/wait.h> /* May need to adjust this for other OSs */
+
+/*
+ * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
+ * and it's safe, so just do it.
+ */
+#if !defined(O_NDELAY) && defined(O_NONBLOCK)
+# define O_NDELAY O_NONBLOCK
+#endif /* !O_NDELAY && O_NONBLOCK */
+
+#if !defined(MAXHOSTNAMELEN)
+# define MAXHOSTNAMELEN 32
+#endif /* !MAXHOSTNAMELEN */
+
+#if defined(_POSIX_SOURCE)
+# include <limits.h>
+#else
+# define _POSIX_SOURCE
+# include <limits.h>
+# undef _POSIX_SOURCE
+#endif /* _POSIX_SOURCE */
+
+#if !defined(PATH_MAX)
+# if defined(MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+# else
+# define PATH_MAX 1024
+# endif /* MAXPATHLEN */
+#endif /* !PATH_MAX */
+
+
+#ifndef DEV_MEM
+#define DEV_MEM "/dev/mem"
+#endif
+
+#ifndef VT_SYSREQ_DEFAULT
+#define VT_SYSREQ_DEFAULT FALSE
+#endif
+
+#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
+
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+
+#ifndef NO_COMPILER_H
+#include "compiler.h"
+#endif
+
+#endif /* _XF86_OSLIB_H */
|