From d137057fd13e83ec15ab416c7fe774741da06047 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 10 Jul 2012 14:56:29 +0200 Subject: fontconfig mesa xserver git update 10 Jul 2012 --- xorg-server/include/dix.h | 6 +- xorg-server/include/extension.h | 42 ++++++++- xorg-server/include/extinit.h | 163 ++++++++++++++++++++++++++++++++--- xorg-server/include/globals.h | 81 +---------------- xorg-server/include/misc.h | 14 +++ xorg-server/include/os.h | 3 + xorg-server/include/pixmap.h | 19 ++++ xorg-server/include/pixmapstr.h | 30 +++++++ xorg-server/include/screenint.h | 17 ++++ xorg-server/include/scrnintstr.h | 34 ++++++++ xorg-server/include/window.h | 4 +- xorg-server/include/xorg-server.h.in | 2 +- 12 files changed, 316 insertions(+), 99 deletions(-) (limited to 'xorg-server/include') diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h index 3d8b0e575..74123b51b 100644 --- a/xorg-server/include/dix.h +++ b/xorg-server/include/dix.h @@ -64,6 +64,8 @@ SOFTWARE. #define REQUEST(type) \ type *stuff = (type *)client->requestBuffer +#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) + #define REQUEST_SIZE_MATCH(req)\ if ((sizeof(req) >> 2) != client->req_len)\ return(BadLength) @@ -102,12 +104,12 @@ SOFTWARE. if ((pClient)->swapped) \ (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \ (pClient, (int)(size), pReply); \ - else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); } + else WriteToClient(pClient, (int)(size), (pReply)); } #define WriteSwappedDataToClient(pClient, size, pbuf) \ if ((pClient)->swapped) \ (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \ - else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf)); + else WriteToClient(pClient, (int)(size), (pbuf)); typedef struct _TimeStamp *TimeStampPtr; diff --git a/xorg-server/include/extension.h b/xorg-server/include/extension.h index c7f51b9d1..0f55d9038 100644 --- a/xorg-server/include/extension.h +++ b/xorg-server/include/extension.h @@ -44,10 +44,47 @@ SOFTWARE. ******************************************************************/ +/* + * 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). + */ + #ifndef EXTENSION_H #define EXTENSION_H -_XFUNCPROTOBEGIN +#include + +#include "dixstruct.h" + +typedef void (*InitExtension) (void); + +typedef struct { + InitExtension initFunc; + const char *name; + Bool *disablePtr; +} ExtensionModule; extern _X_EXPORT unsigned short StandardMinorOpcode(ClientPtr /*client */ ); @@ -60,5 +97,6 @@ extern _X_EXPORT void InitExtensions(int argc, char **argv); extern _X_EXPORT void CloseDownExtensions(void); -_XFUNCPROTOEND +extern _X_EXPORT void LoadExtension(ExtensionModule *ext, Bool external); + #endif /* EXTENSION_H */ diff --git a/xorg-server/include/extinit.h b/xorg-server/include/extinit.h index a048b7254..0a24db068 100644 --- a/xorg-server/include/extinit.h +++ b/xorg-server/include/extinit.h @@ -23,8 +23,29 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/******************************************************************** - * Interface of extinit.c +/* + * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. + * + * 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, FIT- + * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XFREE86 PROJECT 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 XFree86 Project 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 XFree86 Project. */ #ifndef EXTINIT_H @@ -32,14 +53,134 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "extnsionst.h" -extern void - XInputExtensionInit(void - ); +#ifdef COMPOSITE +extern Bool noCompositeExtension; +extern void CompositeExtensionInit(void); +#endif -extern _X_EXPORT void - AssignTypeAndName(DeviceIntPtr /* dev */ , - Atom /* type */ , - const char * /* name */ - ); +#ifdef DAMAGE +extern Bool noDamageExtension; +extern void DamageExtensionInit(void); +#endif -#endif /* EXTINIT_H */ +#if defined(DBE) +extern Bool noDbeExtension; +extern void DbeExtensionInit(void); +#endif + +#ifdef DMXEXT +extern void DMXExtensionInit(void); +#endif + +#if defined(DPMSExtension) +#include +extern Bool noDPMSExtension; +extern void DPMSExtensionInit(void); +#endif + +extern Bool noGEExtension; +extern void GEExtensionInit(void); + +#ifdef GLXEXT +extern _X_EXPORT Bool noGlxExtension; +extern void GlxExtensionInit(void); +#endif + +#ifdef PANORAMIX +#include +extern Bool noPanoramiXExtension; +extern void PanoramiXExtensionInit(void); +#endif + +#ifdef RANDR +extern Bool noRRExtension; +extern void RRExtensionInit(void); +#endif + +#if defined(XRECORD) +extern void RecordExtensionInit(void); +#endif + +extern Bool noRenderExtension; +extern void RenderExtensionInit(void); + +#if defined(RES) +#include +extern Bool noResExtension; +extern void ResExtensionInit(void); +#endif + +#if defined(SCREENSAVER) +#include +extern Bool noScreenSaverExtension; +extern void ScreenSaverExtensionInit(void); +#endif + +#include +extern void ShapeExtensionInit(void); + +#ifdef MITSHM +#include +#include +extern Bool noMITShmExtension; +extern void ShmExtensionInit(void); +#endif + +extern void SyncExtensionInit(void); + +extern void XCMiscExtensionInit(void); + +#ifdef XCSECURITY +#include +#include "securitysrv.h" +extern Bool noSecurityExtension; +extern void SecurityExtensionInit(void); +#endif + +#ifdef XF86BIGFONT +#include +extern Bool noXFree86BigfontExtension; +extern void XFree86BigfontExtensionInit(void); +#endif + +extern void BigReqExtensionInit(void); + +#ifdef XFIXES +extern Bool noXFixesExtension; +extern void XFixesExtensionInit(void); +#endif + +extern void XInputExtensionInit(void); +extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev, + Atom type, + const char *name); + +#include +extern void XkbExtensionInit(void); + +#if defined(XSELINUX) +#include "xselinux.h" +extern Bool noSELinuxExtension; +extern void SELinuxExtensionInit(void); +#endif + +#ifdef XTEST +#include +#include +extern void XTestExtensionInit(void); +#endif + +#ifdef INXQUARTZ +extern Bool noPseudoramiXExtension; +extern void PseudoramiXExtensionInit(void); +#endif + +#if defined(XV) +#include +#include +extern Bool noXvExtension; +extern void XvExtensionInit(void); +extern void XvMCExtensionInit(void); +#endif + +#endif diff --git a/xorg-server/include/globals.h b/xorg-server/include/globals.h index 6d3f3d708..7786987a4 100644 --- a/xorg-server/include/globals.h +++ b/xorg-server/include/globals.h @@ -5,6 +5,7 @@ #include #include "window.h" /* for WindowPtr */ +#include "extinit.h" /* Global X server variables that are visible to mi, dix, os, and ddx */ @@ -41,79 +42,7 @@ extern _X_EXPORT Bool DPMSCapableFlag; extern _X_EXPORT Bool PanoramiXExtensionDisabledHack; #endif -#ifdef COMPOSITE -extern _X_EXPORT Bool noCompositeExtension; -#endif - -#ifdef DAMAGE -extern _X_EXPORT Bool noDamageExtension; -#endif - -#ifdef DBE -extern _X_EXPORT Bool noDbeExtension; -#endif - -#ifdef DPMSExtension -extern _X_EXPORT Bool noDPMSExtension; -#endif - -#ifdef GLXEXT -extern _X_EXPORT Bool noGlxExtension; -#endif - -#ifdef SCREENSAVER -extern _X_EXPORT Bool noScreenSaverExtension; -#endif - -#ifdef MITSHM -extern _X_EXPORT Bool noMITShmExtension; -#endif - -#ifdef RANDR -extern _X_EXPORT Bool noRRExtension; -#endif - -extern _X_EXPORT Bool noRenderExtension; - -#ifdef XCSECURITY -extern _X_EXPORT Bool noSecurityExtension; -#endif - -#ifdef RES -extern _X_EXPORT Bool noResExtension; -#endif - -#ifdef XF86BIGFONT -extern _X_EXPORT Bool noXFree86BigfontExtension; -#endif - -#ifdef XFreeXDGA -extern _X_EXPORT Bool noXFree86DGAExtension; -#endif - -#ifdef XF86DRI -extern _X_EXPORT Bool noXFree86DRIExtension; -#endif - -#ifdef XF86VIDMODE -extern _X_EXPORT Bool noXFree86VidModeExtension; -#endif - -#ifdef XFIXES -extern _X_EXPORT Bool noXFixesExtension; -#endif - -#ifdef PANORAMIX -extern _X_EXPORT Bool noPanoramiXExtension; -#endif - -#ifdef INXQUARTZ -extern _X_EXPORT Bool noPseudoramiXExtension; -#endif - #ifdef XSELINUX -extern _X_EXPORT Bool noSELinuxExtension; - #define SELINUX_MODE_DEFAULT 0 #define SELINUX_MODE_DISABLED 1 #define SELINUX_MODE_PERMISSIVE 2 @@ -121,12 +50,4 @@ extern _X_EXPORT Bool noSELinuxExtension; extern _X_EXPORT int selinuxEnforcingState; #endif -#ifdef XV -extern _X_EXPORT Bool noXvExtension; -#endif - -#ifdef DRI2 -extern _X_EXPORT Bool noDRI2Extension; -#endif - #endif /* !_XSERV_GLOBAL_H_ */ diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h index 6bea82f33..7f7f221a8 100644 --- a/xorg-server/include/misc.h +++ b/xorg-server/include/misc.h @@ -232,6 +232,20 @@ pad_to_int32(const int bytes) return (((bytes) + 3) & ~3); } +/** + * Calculate padding needed to bring the number of bytes to an even + * multiple of 4. + * @param bytes The minimum number of bytes needed. + * @return The bytes of padding needed to arrive at the closest multiple of 4 + * that is equal or higher than bytes. + */ +static inline int +padding_for_int32(const int bytes) +{ + return ((-bytes) & 3); +} + + extern char **xstrtokenize(const char *str, const char *separators); extern void FormatUInt64(uint64_t num, char *string); extern void FormatUInt64Hex(uint64_t num, char *string); diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h index 34ca1f557..7701c3977 100644 --- a/xorg-server/include/os.h +++ b/xorg-server/include/os.h @@ -340,6 +340,9 @@ OsBlockSIGIO(void); extern _X_EXPORT void OsReleaseSIGIO(void); +extern void +OsResetSignals(void); + extern _X_EXPORT void OsAbort(void) _X_NORETURN; diff --git a/xorg-server/include/pixmap.h b/xorg-server/include/pixmap.h index 9bb5bb7b8..921a94d1e 100644 --- a/xorg-server/include/pixmap.h +++ b/xorg-server/include/pixmap.h @@ -49,6 +49,7 @@ SOFTWARE. #include "misc.h" #include "screenint.h" +#include "regionstr.h" /* types for Drawable */ #define DRAWABLE_WINDOW 0 @@ -73,6 +74,8 @@ SOFTWARE. typedef struct _Drawable *DrawablePtr; typedef struct _Pixmap *PixmapPtr; +typedef struct _PixmapDirtyUpdate *PixmapDirtyUpdatePtr; + typedef union _PixUnion { PixmapPtr pixmap; unsigned long pixel; @@ -109,4 +112,20 @@ extern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ , extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ ); +extern _X_EXPORT PixmapPtr +PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave); + +extern _X_EXPORT Bool +PixmapStartDirtyTracking(PixmapPtr src, + PixmapPtr slave_dst, + int x, int y); + +extern _X_EXPORT Bool +PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst); + +/* helper function, drivers can do this themselves if they can do it more + efficently */ +extern _X_EXPORT Bool +PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region); + #endif /* PIXMAP_H */ diff --git a/xorg-server/include/pixmapstr.h b/xorg-server/include/pixmapstr.h index 0800c62b2..2a1ef9b85 100644 --- a/xorg-server/include/pixmapstr.h +++ b/xorg-server/include/pixmapstr.h @@ -50,6 +50,7 @@ SOFTWARE. #include "screenint.h" #include "regionstr.h" #include "privates.h" +#include "damage.h" typedef struct _Drawable { unsigned char type; /* DRAWABLE_ */ @@ -80,6 +81,35 @@ typedef struct _Pixmap { short screen_y; #endif unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */ + + PixmapPtr master_pixmap; /* pointer to master copy of pixmap for pixmap sharing */ } PixmapRec; +typedef struct _PixmapDirtyUpdate { + PixmapPtr src, slave_dst; + int x, y; + DamagePtr damage; + struct xorg_list ent; +} PixmapDirtyUpdateRec; + +static inline void +PixmapBox(BoxPtr box, PixmapPtr pixmap) +{ + box->x1 = 0; + box->x2 = pixmap->drawable.width; + + box->y1 = 0; + box->y2 = pixmap->drawable.height; +} + + +static inline void +PixmapRegionInit(RegionPtr region, PixmapPtr pixmap) +{ + BoxRec box; + + PixmapBox(&box, pixmap); + RegionInit(region, &box, 1); +} + #endif /* PIXMAPSTRUCT_H */ diff --git a/xorg-server/include/screenint.h b/xorg-server/include/screenint.h index 8205f6363..e36b4d8d4 100644 --- a/xorg-server/include/screenint.h +++ b/xorg-server/include/screenint.h @@ -71,6 +71,23 @@ extern _X_EXPORT int AddGPUScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , extern _X_EXPORT void RemoveGPUScreen(ScreenPtr pScreen); +extern _X_EXPORT void +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new); +extern _X_EXPORT void +DetachUnboundGPU(ScreenPtr unbound); + +extern _X_EXPORT void +AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new); + +extern _X_EXPORT void +DetachOutputGPU(ScreenPtr output); + +extern _X_EXPORT void +AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new); + +extern _X_EXPORT void +DetachOffloadGPU(ScreenPtr slave); + typedef struct _ColormapRec *ColormapPtr; #endif /* SCREENINT_H */ diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h index bcac47558..df7407391 100644 --- a/xorg-server/include/scrnintstr.h +++ b/xorg-server/include/scrnintstr.h @@ -179,6 +179,8 @@ typedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ , #define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2 /* pixmap will contain a glyph */ #define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3 +/* pixmap will be shared */ +#define CREATE_PIXMAP_USAGE_SHARED 4 typedef PixmapPtr (*CreatePixmapProcPtr) (ScreenPtr /*pScreen */ , int /*width */ , @@ -339,6 +341,18 @@ typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ , typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int, int *, int *); + +typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **); + +typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *); + +typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr, + int x, int y); + +typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr); + +typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool); + typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; @@ -479,6 +493,26 @@ typedef struct _Screen { Bool canDoBGNoneRoot; Bool isGPU; + + struct xorg_list unattached_list; + struct xorg_list unattached_head; + + ScreenPtr current_master; + + struct xorg_list output_slave_list; + struct xorg_list output_head; + + SharePixmapBackingProcPtr SharePixmapBacking; + SetSharedPixmapBackingProcPtr SetSharedPixmapBacking; + + StartPixmapTrackingProcPtr StartPixmapTracking; + StopPixmapTrackingProcPtr StopPixmapTracking; + + struct xorg_list pixmap_dirty_list; + struct xorg_list offload_slave_list; + struct xorg_list offload_head; + + ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap; } ScreenRec; static inline RegionPtr diff --git a/xorg-server/include/window.h b/xorg-server/include/window.h index 7842b4d58..f8fc2a5fe 100644 --- a/xorg-server/include/window.h +++ b/xorg-server/include/window.h @@ -214,10 +214,8 @@ extern _X_EXPORT void ResizeChildrenWinSize(WindowPtr /*pWin */ , int /*dw */ , int /*dh */ ); -extern _X_EXPORT void ShapeExtensionInit(void); - extern _X_EXPORT void SendShapeNotify(WindowPtr /* pWin */ , - int /* which */ ); + int /* which */); extern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ ); diff --git a/xorg-server/include/xorg-server.h.in b/xorg-server/include/xorg-server.h.in index c0761f78a..81935be5c 100644 --- a/xorg-server/include/xorg-server.h.in +++ b/xorg-server/include/xorg-server.h.in @@ -197,7 +197,7 @@ #undef WSCONS_SUPPORT /* Loadable XFree86 server awesomeness */ -#undef XFree86LOADER +#define XFree86LOADER /* Use libpciaccess */ #undef XSERVER_LIBPCIACCESS -- cgit v1.2.3