Merge remote branch 'ajax/for-keithp'

This commit is contained in:
Keith Packard 2010-11-30 13:30:59 -08:00
commit 02449ee24b
64 changed files with 570 additions and 1551 deletions

View File

@ -53,6 +53,12 @@ Equipment Corporation.
#include "servermd.h" #include "servermd.h"
#include "resource.h" #include "resource.h"
#include "picturestr.h" #include "picturestr.h"
#ifdef XFIXES
#include "xfixesint.h"
#endif
#ifdef COMPOSITE
#include "compint.h"
#endif
#include "modinit.h" #include "modinit.h"
#include "protocol-versions.h" #include "protocol-versions.h"
@ -581,6 +587,13 @@ void PanoramiXExtensionInit(int argc, char *argv[])
ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor; ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor;
PanoramiXRenderInit (); PanoramiXRenderInit ();
#ifdef XFIXES
PanoramiXFixesInit ();
#endif
#ifdef COMPOSITE
PanoramiXCompositeInit ();
#endif
} }
extern Bool CreateConnectionBlock(void); extern Bool CreateConnectionBlock(void);
@ -882,6 +895,9 @@ static void PanoramiXResetProc(ExtensionEntry* extEntry)
int i; int i;
PanoramiXRenderReset (); PanoramiXRenderReset ();
#ifdef XFIXES
PanoramiXFixesReset ();
#endif
screenInfo.numScreens = PanoramiXNumScreens; screenInfo.numScreens = PanoramiXNumScreens;
for (i = 256; i--; ) for (i = 256; i--; )
ProcVector[i] = SavedProcVector[i]; ProcVector[i] = SavedProcVector[i];

View File

@ -26,6 +26,7 @@ extern _X_EXPORT unsigned long XRT_WINDOW;
extern _X_EXPORT unsigned long XRT_PIXMAP; extern _X_EXPORT unsigned long XRT_PIXMAP;
extern _X_EXPORT unsigned long XRT_GC; extern _X_EXPORT unsigned long XRT_GC;
extern _X_EXPORT unsigned long XRT_COLORMAP; extern _X_EXPORT unsigned long XRT_COLORMAP;
extern _X_EXPORT unsigned long XRT_PICTURE;
/* /*
* Drivers are allowed to wrap this function. Each wrapper can decide that the * Drivers are allowed to wrap this function. Each wrapper can decide that the

View File

@ -535,13 +535,6 @@ CompositeExtensionInit (void)
if (GetPictureScreenIfSet(pScreen) == NULL) if (GetPictureScreenIfSet(pScreen) == NULL)
return; return;
} }
#ifdef PANORAMIX
/* Xinerama's rewriting of window drawing before Composite gets to it
* breaks Composite.
*/
if (!noPanoramiXExtension)
return;
#endif
CompositeClientWindowType = CreateNewResourceType CompositeClientWindowType = CreateNewResourceType
(FreeCompositeClientWindow, "CompositeClientWindow"); (FreeCompositeClientWindow, "CompositeClientWindow");
@ -582,3 +575,358 @@ CompositeExtensionInit (void)
/* Initialization succeeded */ /* Initialization succeeded */
noCompositeExtension = FALSE; noCompositeExtension = FALSE;
} }
#ifdef PANORAMIX
#include "panoramiXsrv.h"
int (*PanoramiXSaveCompositeVector[CompositeNumberRequests]) (ClientPtr);
static int
PanoramiXCompositeRedirectWindow (ClientPtr client)
{
PanoramiXRes *win;
int rc = 0, j;
REQUEST(xCompositeRedirectWindowReq);
REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
client, DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
FOR_NSCREENS_FORWARD(j) {
stuff->window = win->info[j].id;
rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
if (rc != Success) break;
}
return rc;
}
static int
PanoramiXCompositeRedirectSubwindows (ClientPtr client)
{
PanoramiXRes *win;
int rc = 0, j;
REQUEST(xCompositeRedirectSubwindowsReq);
REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
client, DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
FOR_NSCREENS_FORWARD(j) {
stuff->window = win->info[j].id;
rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
if (rc != Success) break;
}
return rc;
}
static int
PanoramiXCompositeUnredirectWindow (ClientPtr client)
{
PanoramiXRes *win;
int rc = 0, j;
REQUEST(xCompositeUnredirectWindowReq);
REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
client, DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
FOR_NSCREENS_FORWARD(j) {
stuff->window = win->info[j].id;
rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
if (rc != Success) break;
}
return rc;
}
static int
PanoramiXCompositeUnredirectSubwindows (ClientPtr client)
{
PanoramiXRes *win;
int rc = 0, j;
REQUEST(xCompositeUnredirectSubwindowsReq);
REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
client, DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
FOR_NSCREENS_FORWARD(j) {
stuff->window = win->info[j].id;
rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
if (rc != Success) break;
}
return rc;
}
static int
PanoramiXCompositeNameWindowPixmap (ClientPtr client)
{
WindowPtr pWin;
CompWindowPtr cw;
PixmapPtr pPixmap;
int rc;
PanoramiXRes *win, *newPix;
int i;
REQUEST(xCompositeNameWindowPixmapReq);
REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
client, DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
LEGAL_NEW_RESOURCE (stuff->pixmap, client);
if(!(newPix = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPix->type = XRT_PIXMAP;
newPix->u.pix.shared = FALSE;
newPix->info[0].id = stuff->pixmap;
for (i = 1; i < PanoramiXNumScreens; i++)
newPix->info[i].id = FakeClientID (client->index);
FOR_NSCREENS(i) {
rc = dixLookupResourceByType ((void **) &pWin, win->info[i].id,
RT_WINDOW, client, DixGetAttrAccess);
if (rc != Success)
{
client->errorValue = stuff->window;
free (newPix);
return rc;
}
if (!pWin->viewable)
{
free (newPix);
return BadMatch;
}
cw = GetCompWindow (pWin);
if (!cw)
{
free (newPix);
return BadMatch;
}
pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin);
if (!pPixmap)
{
free (newPix);
return BadMatch;
}
if (!AddResource (newPix->info[i].id, RT_PIXMAP,
(pointer) pPixmap))
return BadAlloc;
++pPixmap->refcnt;
}
if (!AddResource (stuff->pixmap, XRT_PIXMAP, (pointer) newPix))
return BadAlloc;
return Success;
}
static int
PanoramiXCompositeGetOverlayWindow (ClientPtr client)
{
REQUEST(xCompositeGetOverlayWindowReq);
xCompositeGetOverlayWindowReply rep;
WindowPtr pWin;
ScreenPtr pScreen;
CompScreenPtr cs;
CompOverlayClientPtr pOc;
int rc;
PanoramiXRes *win, *overlayWin = NULL;
int i;
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
client, DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
cs = GetCompScreen(screenInfo.screens[0]);
if (!cs->pOverlayWin)
{
if(!(overlayWin = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
overlayWin->type = XRT_WINDOW;
overlayWin->u.win.root = FALSE;
}
FOR_NSCREENS_BACKWARD(i) {
rc = dixLookupResourceByType((pointer *)&pWin, win->info[i].id,
RT_WINDOW, client, DixGetAttrAccess);
if (rc != Success)
{
client->errorValue = stuff->window;
return rc;
}
pScreen = pWin->drawable.pScreen;
/*
* Create an OverlayClient structure to mark this client's
* interest in the overlay window
*/
pOc = compCreateOverlayClient(pScreen, client);
if (pOc == NULL)
return BadAlloc;
/*
* Make sure the overlay window exists
*/
cs = GetCompScreen(pScreen);
if (cs->pOverlayWin == NULL)
if (!compCreateOverlayWindow(pScreen))
{
FreeResource (pOc->resource, RT_NONE);
return BadAlloc;
}
rc = XaceHook(XACE_RESOURCE_ACCESS, client,
cs->pOverlayWin->drawable.id,
RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL,
DixGetAttrAccess);
if (rc != Success)
{
FreeResource (pOc->resource, RT_NONE);
return rc;
}
}
if (overlayWin)
{
FOR_NSCREENS(i) {
cs = GetCompScreen(screenInfo.screens[i]);
overlayWin->info[i].id = cs->pOverlayWin->drawable.id;
}
AddResource(overlayWin->info[0].id, XRT_WINDOW, overlayWin);
}
cs = GetCompScreen(screenInfo.screens[0]);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.overlayWin = cs->pOverlayWin->drawable.id;
if (client->swapped)
{
int n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.overlayWin, n);
}
(void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
return Success;
}
static int
PanoramiXCompositeReleaseOverlayWindow (ClientPtr client)
{
REQUEST(xCompositeReleaseOverlayWindowReq);
WindowPtr pWin;
ScreenPtr pScreen;
CompOverlayClientPtr pOc;
PanoramiXRes *win;
int i, rc;
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
client, DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
FOR_NSCREENS_BACKWARD(i) {
if ((rc = dixLookupResourceByType((void **)&pWin, win->info[i].id,
XRT_WINDOW, client,
DixUnknownAccess))) {
client->errorValue = stuff->window;
return rc;
}
pScreen = pWin->drawable.pScreen;
/*
* Has client queried a reference to the overlay window
* on this screen? If not, generate an error.
*/
pOc = compFindOverlayClient (pWin->drawable.pScreen, client);
if (pOc == NULL)
return BadMatch;
/* The delete function will free the client structure */
FreeResource (pOc->resource, RT_NONE);
}
return Success;
}
void
PanoramiXCompositeInit (void)
{
int i;
for (i = 0; i < CompositeNumberRequests; i++)
PanoramiXSaveCompositeVector[i] = ProcCompositeVector[i];
/*
* Stuff in Xinerama aware request processing hooks
*/
ProcCompositeVector[X_CompositeRedirectWindow] =
PanoramiXCompositeRedirectWindow;
ProcCompositeVector[X_CompositeRedirectSubwindows] =
PanoramiXCompositeRedirectSubwindows;
ProcCompositeVector[X_CompositeUnredirectWindow] =
PanoramiXCompositeUnredirectWindow;
ProcCompositeVector[X_CompositeUnredirectSubwindows] =
PanoramiXCompositeUnredirectSubwindows;
ProcCompositeVector[X_CompositeNameWindowPixmap] =
PanoramiXCompositeNameWindowPixmap;
ProcCompositeVector[X_CompositeGetOverlayWindow] =
PanoramiXCompositeGetOverlayWindow;
ProcCompositeVector[X_CompositeReleaseOverlayWindow] =
PanoramiXCompositeReleaseOverlayWindow;
}
void
PanoramiXCompositeReset (void)
{
int i;
for (i = 0; i < CompositeNumberRequests; i++)
ProcCompositeVector[i] = PanoramiXSaveCompositeVector[i];
}
#endif

View File

@ -326,4 +326,7 @@ int
compConfigNotify(WindowPtr pWin, int x, int y, int w, int h, compConfigNotify(WindowPtr pWin, int x, int y, int w, int h,
int bw, WindowPtr pSib); int bw, WindowPtr pSib);
void PanoramiXCompositeInit (void);
void PanoramiXCompositeReset (void);
#endif /* _COMPINT_H_ */ #endif /* _COMPINT_H_ */

View File

@ -48,6 +48,10 @@
#include "compint.h" #include "compint.h"
#include "xace.h" #include "xace.h"
#ifdef PANORAMIX
#include "panoramiXsrv.h"
#endif
/* /*
* Delete the given overlay client list element from its screen list. * Delete the given overlay client list element from its screen list.
*/ */
@ -128,10 +132,19 @@ compCreateOverlayWindow (ScreenPtr pScreen)
WindowPtr pWin; WindowPtr pWin;
XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */ XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */
int result; int result;
int w = pScreen->width;
int h = pScreen->height;
#ifdef PANORAMIX
if (!noPanoramiXExtension)
{
w = PanoramiXPixWidth;
h = PanoramiXPixHeight;
}
#endif
pWin = cs->pOverlayWin = pWin = cs->pOverlayWin =
CreateWindow (cs->overlayWid, pRoot, CreateWindow (cs->overlayWid, pRoot, 0, 0, w, h, 0,
0, 0, pScreen->width, pScreen->height, 0,
InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0], InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
pRoot->drawable.depth, pRoot->drawable.depth,
serverClient, pScreen->rootVisual, &result); serverClient, pScreen->rootVisual, &result);

View File

@ -47,6 +47,10 @@
#include "compint.h" #include "compint.h"
#ifdef PANORAMIX
#include "panoramiXsrv.h"
#endif
#ifdef COMPOSITE_DEBUG #ifdef COMPOSITE_DEBUG
static int static int
compCheckWindow (WindowPtr pWin, pointer data) compCheckWindow (WindowPtr pWin, pointer data)
@ -172,16 +176,26 @@ updateOverlayWindow(ScreenPtr pScreen)
CompScreenPtr cs; CompScreenPtr cs;
WindowPtr pWin; /* overlay window */ WindowPtr pWin; /* overlay window */
XID vlist[2]; XID vlist[2];
int w = pScreen->width;
int h = pScreen->height;
#ifdef PANORAMIX
if (!noPanoramiXExtension)
{
w = PanoramiXPixWidth;
h = PanoramiXPixHeight;
}
#endif
cs = GetCompScreen(pScreen); cs = GetCompScreen(pScreen);
if ((pWin = cs->pOverlayWin) != NULL) { if ((pWin = cs->pOverlayWin) != NULL) {
if ((pWin->drawable.width == pScreen->width) && if ((pWin->drawable.width == w) &&
(pWin->drawable.height == pScreen->height)) (pWin->drawable.height == h))
return Success; return Success;
/* Let's resize the overlay window. */ /* Let's resize the overlay window. */
vlist[0] = pScreen->width; vlist[0] = w;
vlist[1] = pScreen->height; vlist[1] = h;
return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin)); return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
} }

View File

@ -1980,7 +1980,7 @@ if test "x$DMX" = xyes; then
fi fi
DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
XDMX_CFLAGS="$DMXMODULES_CFLAGS" XDMX_CFLAGS="$DMXMODULES_CFLAGS"
XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $OS_LIB $FIXES_LIB" XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
XDMX_SYS_LIBS="$DMXMODULES_LIBS" XDMX_SYS_LIBS="$DMXMODULES_LIBS"
AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_CFLAGS])
AC_SUBST([XDMX_LIBS]) AC_SUBST([XDMX_LIBS])
@ -2230,7 +2230,6 @@ hw/xfree86/os-support/misc/Makefile
hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/linux/Makefile
hw/xfree86/os-support/sco/Makefile hw/xfree86/os-support/sco/Makefile
hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/solaris/Makefile
hw/xfree86/os-support/sysv/Makefile
hw/xfree86/parser/Makefile hw/xfree86/parser/Makefile
hw/xfree86/ramdac/Makefile hw/xfree86/ramdac/Makefile
hw/xfree86/shadowfb/Makefile hw/xfree86/shadowfb/Makefile
@ -2238,7 +2237,6 @@ hw/xfree86/vbe/Makefile
hw/xfree86/vgahw/Makefile hw/xfree86/vgahw/Makefile
hw/xfree86/x86emu/Makefile hw/xfree86/x86emu/Makefile
hw/xfree86/xaa/Makefile hw/xfree86/xaa/Makefile
hw/xfree86/xf8_16bpp/Makefile
hw/xfree86/utils/Makefile hw/xfree86/utils/Makefile
hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/cvt/Makefile
hw/xfree86/utils/gtf/Makefile hw/xfree86/utils/gtf/Makefile

View File

@ -68,7 +68,6 @@ libglx_la_SOURCES = \
indirect_program.c \ indirect_program.c \
indirect_table.h \ indirect_table.h \
indirect_texture_compression.c \ indirect_texture_compression.c \
g_disptab.h \
glxbyteorder.h \ glxbyteorder.h \
glxcmds.c \ glxcmds.c \
glxcmdsswap.c \ glxcmdsswap.c \

View File

@ -1,52 +0,0 @@
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_g_disptab_h_
#define _GLX_g_disptab_h_
/*
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, 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 including the dates of first publication and
* either this permission notice or a reference to
* http://oss.sgi.com/projects/FreeB/
* 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
* SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
* shall not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization from
* Silicon Graphics, Inc.
*/
extern int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
#endif /* _GLX_g_disptab_h_ */

View File

@ -38,7 +38,6 @@
#include "glxserver.h" #include "glxserver.h"
#include <GL/glxtokens.h> #include <GL/glxtokens.h>
#include <unpack.h> #include <unpack.h>
#include "g_disptab.h"
#include <pixmapstr.h> #include <pixmapstr.h>
#include <windowstr.h> #include <windowstr.h>
#include "glxutil.h" #include "glxutil.h"
@ -2061,238 +2060,6 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
} }
} }
extern RESTYPE __glXSwapBarrierRes;
int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
XID drawable = req->drawable;
int barrier = req->barrier;
DrawablePtr pDraw;
int screen, rc;
__GLXscreen *pGlxScreen;
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
pGlxScreen = glxGetScreen(pDraw->pScreen);
if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) {
screen = pDraw->pScreen->myNum;
if (pGlxScreen->swapBarrierFuncs) {
int ret = pGlxScreen->swapBarrierFuncs->bindSwapBarrierFunc(screen, drawable, barrier);
if (ret == Success) {
if (barrier)
/* add source for cleanup when drawable is gone */
AddResource(drawable, __glXSwapBarrierRes, (pointer)(intptr_t)screen);
else
/* delete source */
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
}
return ret;
}
}
client->errorValue = drawable;
return __glXError(GLXBadDrawable);
}
int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryMaxSwapBarriersSGIXReq *req =
(xGLXQueryMaxSwapBarriersSGIXReq *) pc;
xGLXQueryMaxSwapBarriersSGIXReply reply;
int screen = req->screen;
__GLXscreen *pGlxScreen;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->swapBarrierFuncs)
reply.max = pGlxScreen->swapBarrierFuncs->queryMaxSwapBarriersFunc(screen);
else
reply.max = 0;
reply.length = 0;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
}
WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
(char *) &reply);
return Success;
}
#define GLX_BAD_HYPERPIPE_SGIX 92
int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc;
xGLXQueryHyperpipeNetworkSGIXReply reply;
int screen = req->screen;
void *rdata = NULL;
int length=0;
int npipes=0;
int n= 0;
__GLXscreen *pGlxScreen;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->hyperpipeFuncs) {
rdata =
(pGlxScreen->hyperpipeFuncs->queryHyperpipeNetworkFunc(screen, &npipes, &n));
}
length = __GLX_PAD(n) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = length;
reply.n = n;
reply.npipes = npipes;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.n);
__GLX_SWAP_INT(&reply.npipes);
}
WriteToClient(client, sz_xGLXQueryHyperpipeNetworkSGIXReply,
(char *) &reply);
WriteToClient(client, length << 2, (char *)rdata);
return Success;
}
int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyHyperpipeConfigSGIXReq * req =
(xGLXDestroyHyperpipeConfigSGIXReq *) pc;
xGLXDestroyHyperpipeConfigSGIXReply reply;
int screen = req->screen;
int success = GLX_BAD_HYPERPIPE_SGIX;
int hpId ;
__GLXscreen *pGlxScreen;
hpId = req->hpId;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->hyperpipeFuncs) {
success = pGlxScreen->hyperpipeFuncs->destroyHyperpipeConfigFunc(screen, hpId);
}
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = __GLX_PAD(0) >> 2;
reply.n = 0;
reply.success = success;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
}
WriteToClient(client,
sz_xGLXDestroyHyperpipeConfigSGIXReply,
(char *) &reply);
return Success;
}
int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryHyperpipeConfigSGIXReq * req =
(xGLXQueryHyperpipeConfigSGIXReq *) pc;
xGLXQueryHyperpipeConfigSGIXReply reply;
int screen = req->screen;
void *rdata = NULL;
int length;
int npipes=0;
int n= 0;
int hpId;
__GLXscreen *pGlxScreen;
hpId = req->hpId;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->hyperpipeFuncs) {
rdata = pGlxScreen->hyperpipeFuncs->queryHyperpipeConfigFunc(screen, hpId,&npipes, &n);
}
length = __GLX_PAD(n) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = length;
reply.n = n;
reply.npipes = npipes;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.n);
__GLX_SWAP_INT(&reply.npipes);
}
WriteToClient(client, sz_xGLXQueryHyperpipeConfigSGIXReply,
(char *) &reply);
WriteToClient(client, length << 2, (char *)rdata);
return Success;
}
int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXHyperpipeConfigSGIXReq * req =
(xGLXHyperpipeConfigSGIXReq *) pc;
xGLXHyperpipeConfigSGIXReply reply;
int screen = req->screen;
void *rdata;
int npipes=0, networkId;
int hpId=-1;
__GLXscreen *pGlxScreen;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
networkId = (int)req->networkId;
npipes = (int)req->npipes;
rdata = (void *)(req +1);
if (pGlxScreen->hyperpipeFuncs) {
pGlxScreen->hyperpipeFuncs->hyperpipeConfigFunc(screen,networkId,
&hpId, &npipes,
(void *) rdata);
}
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = __GLX_PAD(0) >> 2;
reply.n = 0;
reply.npipes = npipes;
reply.hpId = hpId;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.npipes);
__GLX_SWAP_INT(&reply.hpId);
}
WriteToClient(client, sz_xGLXHyperpipeConfigSGIXReply,
(char *) &reply);
return Success;
}
/************************************************************************/ /************************************************************************/
/* /*

View File

@ -37,7 +37,6 @@
#include "glxutil.h" #include "glxutil.h"
#include <GL/glxtokens.h> #include <GL/glxtokens.h>
#include <unpack.h> #include <unpack.h>
#include "g_disptab.h"
#include <pixmapstr.h> #include <pixmapstr.h>
#include <windowstr.h> #include <windowstr.h>
#include "glxext.h" #include "glxext.h"

View File

@ -56,7 +56,6 @@
#include "glxutil.h" #include "glxutil.h"
#include "glxdricommon.h" #include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -48,7 +48,6 @@
#include "glxutil.h" #include "glxutil.h"
#include "glxdricommon.h" #include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -48,7 +48,6 @@
#include "glxutil.h" #include "glxutil.h"
#include "glxdricommon.h" #include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -39,7 +39,6 @@
#include <registry.h> #include <registry.h>
#include "privates.h" #include "privates.h"
#include <os.h> #include <os.h>
#include "g_disptab.h"
#include "unpack.h" #include "unpack.h"
#include "glxutil.h" #include "glxutil.h"
#include "glxext.h" #include "glxext.h"
@ -58,7 +57,6 @@ __GLXcontext *__glXContextList;
*/ */
RESTYPE __glXContextRes; RESTYPE __glXContextRes;
RESTYPE __glXDrawableRes; RESTYPE __glXDrawableRes;
RESTYPE __glXSwapBarrierRes;
/* /*
** Reply for most singles. ** Reply for most singles.
@ -228,19 +226,6 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
return GL_TRUE; return GL_TRUE;
} }
extern RESTYPE __glXSwapBarrierRes;
static int SwapBarrierGone(int screen, XID drawable)
{
__GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->swapBarrierFuncs) {
pGlxScreen->swapBarrierFuncs->bindSwapBarrierFunc(screen, drawable, 0);
}
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
return True;
}
/************************************************************************/ /************************************************************************/
/* /*
@ -358,9 +343,7 @@ void GlxExtensionInit(void)
"GLXContext"); "GLXContext");
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone, __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone,
"GLXDrawable"); "GLXDrawable");
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone, if (!__glXContextRes || !__glXDrawableRes)
"GLXSwapBarrier");
if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes)
return; return;
if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState))) if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState)))

View File

@ -175,8 +175,6 @@ static char GLXServerExtensions[] =
"GLX_SGI_make_current_read " "GLX_SGI_make_current_read "
#ifndef __APPLE__ #ifndef __APPLE__
"GLX_SGIS_multisample " "GLX_SGIS_multisample "
"GLX_SGIX_hyperpipe "
"GLX_SGIX_swap_barrier "
#endif #endif
"GLX_SGIX_fbconfig " "GLX_SGIX_fbconfig "
"GLX_SGIX_pbuffer " "GLX_SGIX_pbuffer "
@ -184,31 +182,6 @@ static char GLXServerExtensions[] =
"GLX_INTEL_swap_event" "GLX_INTEL_swap_event"
; ;
/*
* If your DDX driver wants to register support for swap barriers or hyperpipe
* topology, it should call __glXHyperpipeInit() or __glXSwapBarrierInit()
* with a dispatch table of functions to handle the requests. In the XFree86
* DDX, for example, you would call these near the bottom of the driver's
* ScreenInit method, after DRI has been initialized.
*
* This should be replaced with a better method when we teach the server how
* to load DRI drivers.
*/
void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs)
{
__GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
pGlxScreen->hyperpipeFuncs = funcs;
}
void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs)
{
__GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
pGlxScreen->swapBarrierFuncs = funcs;
}
static Bool static Bool
glxCloseScreen (int index, ScreenPtr pScreen) glxCloseScreen (int index, ScreenPtr pScreen)
{ {

View File

@ -35,21 +35,6 @@
* Silicon Graphics, Inc. * Silicon Graphics, Inc.
*/ */
typedef struct {
void * (* queryHyperpipeNetworkFunc)(int, int *, int *);
void * (* queryHyperpipeConfigFunc)(int, int, int *, int *);
int (* destroyHyperpipeConfigFunc)(int, int);
void * (* hyperpipeConfigFunc)(int, int, int *, int *, void *);
} __GLXHyperpipeExtensionFuncs;
typedef struct {
int (* bindSwapBarrierFunc)(int, XID, int);
int (* queryMaxSwapBarriersFunc)(int);
} __GLXSwapBarrierExtensionFuncs;
void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs);
void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs);
typedef struct __GLXconfig __GLXconfig; typedef struct __GLXconfig __GLXconfig;
struct __GLXconfig { struct __GLXconfig {
__GLXconfig *next; __GLXconfig *next;
@ -144,9 +129,6 @@ struct __GLXscreen {
int (*swapInterval) (__GLXdrawable *drawable, int (*swapInterval) (__GLXdrawable *drawable,
int interval); int interval);
__GLXHyperpipeExtensionFuncs *hyperpipeFuncs;
__GLXSwapBarrierExtensionFuncs *swapBarrierFuncs;
ScreenPtr pScreen; ScreenPtr pScreen;
/* Linked list of valid fbconfigs for this screen. */ /* Linked list of valid fbconfigs for this screen. */

View File

@ -30,7 +30,6 @@
#include "glxext.h" #include "glxext.h"
#include "indirect_dispatch.h" #include "indirect_dispatch.h"
#include "indirect_reqsize.h" #include "indirect_reqsize.h"
#include "g_disptab.h"
#include "indirect_table.h" #include "indirect_table.h"
/*****************************************************************/ /*****************************************************************/

View File

@ -35,7 +35,6 @@
#include "glxserver.h" #include "glxserver.h"
#include "glxutil.h" #include "glxutil.h"
#include "unpack.h" #include "unpack.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -1011,8 +1011,6 @@ void dmxValidatePicture(PicturePtr pPicture, Mask mask)
attribs.poly_edge = pPicture->polyEdge; attribs.poly_edge = pPicture->polyEdge;
if (mask & CPPolyMode) if (mask & CPPolyMode)
attribs.poly_mode = pPicture->polyMode; attribs.poly_mode = pPicture->polyMode;
if (mask & CPDither)
attribs.dither = pPicture->dither;
if (mask & CPComponentAlpha) if (mask & CPComponentAlpha)
attribs.component_alpha = pPicture->componentAlpha; attribs.component_alpha = pPicture->componentAlpha;

View File

@ -283,8 +283,6 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
if (dmxShadowFB && !shadowInit(pScreen, dmxShadowUpdateProc, NULL)) if (dmxShadowFB && !shadowInit(pScreen, dmxShadowUpdateProc, NULL))
return FALSE; return FALSE;
miInitializeBackingStore(pScreen);
if (dmxShadowFB) { if (dmxShadowFB) {
miDCInitialize(pScreen, &dmxPointerCursorFuncs); miDCInitialize(pScreen, &dmxPointerCursorFuncs);
} else { } else {

View File

@ -1022,12 +1022,6 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
fbInitValidateTree (pScreen); fbInitValidateTree (pScreen);
#endif #endif
#if 0
pScreen->backingStoreSupport = Always;
miInitializeBackingStore (pScreen);
#endif
/* /*
* Wrap CloseScreen, the order now is: * Wrap CloseScreen, the order now is:
* KdCloseScreen * KdCloseScreen

View File

@ -875,13 +875,6 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
if (!ret) return FALSE; if (!ret) return FALSE;
miInitializeBackingStore(pScreen);
/*
* Circumvent the backing store that was just initialised. This amounts
* to a truely bizarre way of initialising SaveDoomedAreas and friends.
*/
pScreen->InstallColormap = vfbInstallColormap; pScreen->InstallColormap = vfbInstallColormap;
pScreen->UninstallColormap = vfbUninstallColormap; pScreen->UninstallColormap = vfbUninstallColormap;
pScreen->ListInstalledColormaps = vfbListInstalledColormaps; pScreen->ListInstalledColormaps = vfbListInstalledColormaps;

View File

@ -32,12 +32,12 @@ DOC_SUBDIR = doc
SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \ SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \
ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \ ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \
xf8_16bpp loader dixmods exa modes \ loader dixmods exa modes \
$(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR) $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR)
DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
parser ramdac shadowfb vbe vgahw xaa \ parser ramdac shadowfb vbe vgahw xaa \
xf8_16bpp loader dixmods dri dri2 exa modes \ loader dixmods dri dri2 exa modes \
utils doc utils doc
bin_PROGRAMS = Xorg bin_PROGRAMS = Xorg

View File

@ -62,9 +62,6 @@ extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec; extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec;
#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec) #define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec)
extern _X_EXPORT DevPrivateKeyRec xf86PixmapKeyRec;
#define xf86PixmapKey (&xf86PixmapKeyRec)
extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
extern _X_EXPORT const unsigned char byte_reversed[256]; extern _X_EXPORT const unsigned char byte_reversed[256];
extern _X_EXPORT Bool fbSlotClaimed; extern _X_EXPORT Bool fbSlotClaimed;

View File

@ -49,7 +49,6 @@
DevPrivateKeyRec xf86CreateRootWindowKeyRec; DevPrivateKeyRec xf86CreateRootWindowKeyRec;
DevPrivateKeyRec xf86ScreenKeyRec; DevPrivateKeyRec xf86ScreenKeyRec;
DevPrivateKeyRec xf86PixmapKeyRec;
ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */ ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */
const unsigned char byte_reversed[256] = const unsigned char byte_reversed[256] =

View File

@ -732,8 +732,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
FatalError("Cannot register DDX private keys"); FatalError("Cannot register DDX private keys");
if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) || if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) ||
!dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0) || !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0))
!dixRegisterPrivateKey(&xf86PixmapKeyRec, PRIVATE_PIXMAP, 0))
FatalError("Cannot register DDX private keys"); FatalError("Cannot register DDX private keys");
for (i = 0; i < xf86NumScreens; i++) { for (i = 0; i < xf86NumScreens; i++) {

View File

@ -1628,14 +1628,6 @@ Here is what <function>InitOutput()</function> does:
</blockquote></para></blockquote> </blockquote></para></blockquote>
<para>
Currently, aperture remapping, as described here, should not be
attempted if the driver uses the <literal remap="tt">xf8_16bpp</literal> or
<literal remap="tt">xf8_32bpp</literal> framebuffer layers. A pending
restructuring of VT switching will address this restriction in
the near future.
</para>
<para> <para>
Other layers may wrap the <function>ChipEnterVT()</function> and Other layers may wrap the <function>ChipEnterVT()</function> and
<function>ChipLeaveVT()</function> functions if they need to take some <function>ChipLeaveVT()</function> functions if they need to take some

View File

@ -208,12 +208,6 @@ cat > sdksyms.c << EOF
*/ */
/* hw/xfree86/xf8_16bpp/Makefile.am -- module */
/*
#include "cfb8_16.h"
*/
/* mi/Makefile.am */ /* mi/Makefile.am */
#include "micmap.h" #include "micmap.h"
#include "miline.h" #include "miline.h"
@ -255,8 +249,6 @@ cat > sdksyms.c << EOF
/* include/Makefile.am */ /* include/Makefile.am */
#include "XIstubs.h" #include "XIstubs.h"
#include "bstore.h"
#include "bstorestr.h"
#include "closestr.h" #include "closestr.h"
#include "closure.h" #include "closure.h"
#include "colormap.h" #include "colormap.h"

View File

@ -1,5 +1,5 @@
SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS) SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS)
DIST_SUBDIRS = bsd bus misc linux solaris sysv sco hurd DIST_SUBDIRS = bsd bus misc linux solaris sco hurd
sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h

View File

@ -39,47 +39,14 @@
#include <sys/stat.h> #include <sys/stat.h>
static Bool KeepTty = FALSE; static Bool KeepTty = FALSE;
static int VTnum = -1;
static Bool VTSwitch = TRUE; static Bool VTSwitch = TRUE;
static Bool ShareVTs = FALSE; static Bool ShareVTs = FALSE;
static int activeVT = -1; static int activeVT = -1;
static int vtPermSave[4];
static char vtname[11]; static char vtname[11];
static struct termios tty_attr; /* tty state to restore */ static struct termios tty_attr; /* tty state to restore */
static int tty_mode; /* kbd mode to restore */ static int tty_mode; /* kbd mode to restore */
static int
saveVtPerms(void)
{
/* We need to use stat to get permissions. */
struct stat svtp;
/* Do them numerically ordered, hard coded tty0 first. */
if (stat("/dev/tty0", &svtp) != 0)
return 0;
vtPermSave[0] = (int)svtp.st_uid;
vtPermSave[1] = (int)svtp.st_gid;
/* Now check the console we are dealing with. */
if (stat(vtname, &svtp) != 0)
return 0;
vtPermSave[2] = (int)svtp.st_uid;
vtPermSave[3] = (int)svtp.st_gid;
return 1;
}
static void
restoreVtPerms(void)
{
if (geteuid() == 0) {
/* Set the terminal permissions back to before we started. */
(void)chown("/dev/tty0", vtPermSave[0], vtPermSave[1]);
(void)chown(vtname, vtPermSave[2], vtPermSave[3]);
}
}
static void *console_handler; static void *console_handler;
static void static void
@ -92,6 +59,16 @@ drain_console(int fd, void *closure)
} }
} }
static void
switch_to(int vt, const char *from)
{
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt) < 0)
FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt) < 0)
FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno));
}
void void
xf86OpenConsole(void) xf86OpenConsole(void)
{ {
@ -112,8 +89,7 @@ xf86OpenConsole(void)
/* /*
* setup the virtual terminal manager * setup the virtual terminal manager
*/ */
if (VTnum != -1) { if (xf86Info.vtno != -1) {
xf86Info.vtno = VTnum;
from = X_CMDLINE; from = X_CMDLINE;
} else { } else {
@ -179,34 +155,6 @@ xf86OpenConsole(void)
FatalError("xf86OpenConsole: Cannot open virtual console" FatalError("xf86OpenConsole: Cannot open virtual console"
" %d (%s)\n", xf86Info.vtno, strerror(errno)); " %d (%s)\n", xf86Info.vtno, strerror(errno));
if (!ShareVTs)
{
/*
* Grab the vt ownership before we overwrite it.
* Hard coded /dev/tty0 into this function as well for below.
*/
if (!saveVtPerms())
xf86Msg(X_WARNING,
"xf86OpenConsole: Could not save ownership of VT\n");
if (geteuid() == 0) {
/* change ownership of the vt */
if (chown(vtname, getuid(), getgid()) < 0)
xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n",
vtname, strerror(errno));
/*
* the current VT device we're running on is not
* "console", we want to grab all consoles too
*
* Why is this needed??
*/
if (chown("/dev/tty0", getuid(), getgid()) < 0)
xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n",
strerror(errno));
}
}
/* /*
* Linux doesn't switch to an active vt after the last close of a vt, * Linux doesn't switch to an active vt after the last close of a vt,
* so we do this ourselves by remembering which is active now. * so we do this ourselves by remembering which is active now.
@ -236,13 +184,7 @@ xf86OpenConsole(void)
/* /*
* now get the VT. This _must_ succeed, or else fail completely. * now get the VT. This _must_ succeed, or else fail completely.
*/ */
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) switch_to(xf86Info.vtno, "xf86OpenConsole");
FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n",
strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0)
FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",
strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", FatalError("xf86OpenConsole: VT_GETMODE failed %s\n",
@ -289,16 +231,8 @@ xf86OpenConsole(void)
} else { /* serverGeneration != 1 */ } else { /* serverGeneration != 1 */
if (!ShareVTs && VTSwitch) if (!ShareVTs && VTSwitch)
{ {
/* /* now get the VT */
* now get the VT switch_to(xf86Info.vtno, "xf86OpenConsole");
*/
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed %s\n",
strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed %s\n",
strerror(errno));
} }
} }
} }
@ -343,19 +277,11 @@ xf86CloseConsole(void)
* Perform a switch back to the active VT when we were started * Perform a switch back to the active VT when we were started
*/ */
if (activeVT >= 0) { if (activeVT >= 0) {
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0) switch_to(activeVT, "xf86CloseConsole");
xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n",
strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT) < 0)
xf86Msg(X_WARNING,
"xf86CloseConsole: VT_WAITACTIVE failed: %s\n",
strerror(errno));
activeVT = -1; activeVT = -1;
} }
} }
close(xf86Info.consoleFd); /* make the vt-manager happy */ close(xf86Info.consoleFd); /* make the vt-manager happy */
restoreVtPerms(); /* restore the permissions */
} }
int int
@ -382,10 +308,10 @@ xf86ProcessArgument(int argc, char *argv[], int i)
} }
if ((argv[i][0] == 'v') && (argv[i][1] == 't')) if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{ {
if (sscanf(argv[i], "vt%2d", &VTnum) == 0) if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0)
{ {
UseMsg(); UseMsg();
VTnum = -1; xf86Info.vtno = -1;
return 0; return 0;
} }
return 1; return 1;

View File

@ -31,10 +31,6 @@
#include "xf86Priv.h" #include "xf86Priv.h"
#include "xf86_OSlib.h" #include "xf86_OSlib.h"
#ifdef OSHEADER
# include OSHEADER
#endif
/* /*
* Handle the VT-switching interface for OSs that use USL-style ioctl()s * Handle the VT-switching interface for OSs that use USL-style ioctl()s
* (the sysv, sco, and linux subdirs). * (the sysv, sco, and linux subdirs).
@ -63,16 +59,9 @@ xf86VTSwitchAway(void)
{ {
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
{
return FALSE; return FALSE;
}
else else
{
#ifdef OSSWITCHAWAY
OSSWITCHAWAY;
#endif
return TRUE; return TRUE;
}
} }
Bool Bool
@ -80,13 +69,9 @@ xf86VTSwitchTo(void)
{ {
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
{
return FALSE; return FALSE;
}
else else
{
return TRUE; return TRUE;
}
} }
Bool Bool

View File

@ -1 +0,0 @@
EXTRA_DIST = sysv_init.c sysv_video.c

View File

@ -1,252 +0,0 @@
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
*
* 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 Thomas Roell and David Wexelblat
* not be used in advertising or publicity pertaining to distribution of
* the software without specific, written prior permission. Thomas Roell and
* David Wexelblat makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* THOMAS ROELL AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID WEXELBLAT 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.
*
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include "compiler.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
static Bool KeepTty = FALSE;
#ifdef SVR4
static Bool Protect0 = FALSE;
#endif
static int VTnum = -1;
void
xf86OpenConsole()
{
int fd;
struct vt_mode VT;
char vtname1[10],vtname2[10];
MessageType from = X_PROBED;
if (serverGeneration == 1)
{
/* check if we're run with euid==0 */
if (geteuid() != 0)
{
FatalError("xf86OpenConsole: Server must be suid root\n");
}
#ifdef SVR4
/* Protect page 0 to help find NULL dereferencing */
/* mprotect() doesn't seem to work */
if (Protect0)
{
int fd = -1;
if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0)
{
xf86Msg(X_WARNING,
"xf86OpenConsole: cannot open /dev/zero (%s)\n",
strerror(errno));
}
else
{
if ((int)mmap(0, 0x1000, PROT_NONE,
MAP_FIXED | MAP_SHARED, fd, 0) == -1)
{
xf86Msg(X_WARNING,
"xf86OpenConsole: failed to protect page 0 (%s)\n",
strerror(errno));
}
close(fd);
}
}
#endif
/*
* setup the virtual terminal manager
*/
if (VTnum != -1)
{
xf86Info.vtno = VTnum;
from = X_CMDLINE;
}
else
{
if ((fd = open("/dev/console",O_WRONLY,0)) < 0)
{
FatalError(
"xf86OpenConsole: Cannot open /dev/console (%s)\n",
strerror(errno));
}
if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
(xf86Info.vtno == -1))
{
FatalError("xf86OpenConsole: Cannot find a free VT\n");
}
close(fd);
}
xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
sprintf(vtname1,"/dev/vc%02d",xf86Info.vtno); /* ESIX */
sprintf(vtname2,"/dev/vt%02d",xf86Info.vtno); /* rest of the world */
if (!KeepTty)
{
setpgrp();
}
if (((xf86Info.consoleFd = open(vtname1, O_RDWR|O_NDELAY, 0)) < 0) &&
((xf86Info.consoleFd = open(vtname2, O_RDWR|O_NDELAY, 0)) < 0))
{
FatalError("xf86OpenConsole: Cannot open %s (%s) (%s)\n",
vtname2, vtname1, strerror(errno));
}
/* change ownership of the vt */
if (chown(vtname1, getuid(), getgid()) < 0)
{
chown(vtname2, getuid(), getgid());
}
/*
* now get the VT
*/
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
{
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
}
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
{
xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
}
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
{
FatalError("xf86OpenConsole: VT_GETMODE failed\n");
}
signal(SIGUSR1, xf86VTRequest);
VT.mode = VT_PROCESS;
VT.relsig = SIGUSR1;
VT.acqsig = SIGUSR1;
if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
{
FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
}
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
{
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
}
}
else
{
/* serverGeneration != 1 */
/*
* now get the VT
*/
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
{
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
}
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
{
xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
}
/*
* If the server doesn't have the VT when the reset occurs,
* this is to make sure we don't continue until the activate
* signal is received.
*/
if (!xf86Screens[0]->vtSema)
sleep(5);
}
return;
}
void
xf86CloseConsole()
{
struct vt_mode VT;
#if 0
ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno);
ioctl(xf86Info.consoleFd, VT_WAITACTIVE, 0);
#endif
ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
{
VT.mode = VT_AUTO;
ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */
}
close(xf86Info.consoleFd); /* make the vt-manager happy */
return;
}
int
xf86ProcessArgument(int argc, char *argv[], int i)
{
/*
* Keep server from detaching from controlling tty. This is useful
* when debugging (so the server can receive keyboard signals.
*/
if (!strcmp(argv[i], "-keeptty"))
{
KeepTty = TRUE;
return 1;
}
#ifdef SVR4
/*
* Undocumented flag to protect page 0 from read/write to help
* catch NULL pointer dereferences. This is purely a debugging
* flag.
*/
if (!strcmp(argv[i], "-protect0"))
{
Protect0 = TRUE;
return 1;
}
#endif
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{
if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
{
UseMsg();
VTnum = -1;
return 0;
}
return 1;
}
return 0;
}
void
xf86UseMsg()
{
ErrorF("vtXX use the specified VT number\n");
ErrorF("-keeptty ");
ErrorF("don't detach controlling tty (for debugging only)\n");
return;
}

View File

@ -1,315 +0,0 @@
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
*
* 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 Thomas Roell and David Wexelblat
* not be used in advertising or publicity pertaining to distribution of
* the software without specific, written prior permission. Thomas Roell and
* David Wexelblat makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* THOMAS ROELL AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THOMAS ROELL OR DAVID WEXELBLAT 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.
*
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <X11/X.h>
#define _NEED_SYSI86
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "xf86OSpriv.h"
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
#endif
#ifndef SI86IOPL
#define SET_IOPL() sysi86(SI86V86,V86SC_IOPL,PS_IOPL)
#define RESET_IOPL() sysi86(SI86V86,V86SC_IOPL,0)
#else
#define SET_IOPL() sysi86(SI86IOPL,3)
#define RESET_IOPL() sysi86(SI86IOPL,0)
#endif
/***************************************************************************/
/* Video Memory Mapping section */
/***************************************************************************/
/*
* XXX Support for SVR3 will need to be reworked if needed. In particular
* the Region parameter is no longer passed, and will need to be dealt
* with internally if required.
* OK, i'll rework that thing ... (clean it up a lot)
* SVR3 Support only with SVR3_MMAPDRV (mr)
*
*/
#ifdef HAS_SVR3_MMAPDRV
#ifndef MMAP_DEBUG
#define MMAP_DEBUG 3
#endif
struct kd_memloc MapDSC;
int mmapFd = -2;
static int
mmapStat(pointer Base, unsigned long Size) {
int nmmreg,i=0,region=-1;
mmapinfo_t *ibuf;
nmmreg = ioctl(mmapFd, GETNMMREG);
if(nmmreg <= 0)
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"\nNo physical memory mapped currently.\n\n");
else {
if((ibuf = (mmapinfo_t *)malloc(nmmreg*sizeof(mmapinfo_t))) == NULL)
xf86Msg(X_WARNING,
"Couldn't allocate memory 4 mmapinfo_t\n");
else {
if(ioctl(mmapFd, GETMMREG, ibuf) != -1)
{
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"# mmapStat: [Size=%x,Base=%x]\n", Size, Base);
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"# Physical Address Size Reference Count\n");
for(i = 0; i < nmmreg; i++) {
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"%-4d 0x%08X %5dk %5d ",
i, ibuf[i].physaddr, ibuf[i].length/1024, ibuf[i].refcnt);
if (ibuf[i].physaddr == Base || ibuf[i].length == Size ) {
xf86MsgVerb(X_INFO, MMAP_DEBUG,"MATCH !!!");
if (region==-1) region=i;
}
xf86ErrorFVerb(MMAP_DEBUG, "\n");
}
xf86ErrorFVerb(MMAP_DEBUG, "\n");
}
free(ibuf);
}
}
if (region == -1 && nmmreg > 0) region=region * i;
return region;
}
#endif
static Bool
linearVidMem()
{
#ifdef SVR4
return TRUE;
#elif defined(HAS_SVR3_MMAPDRV)
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"# xf86LinearVidMem: MMAP 2.2.2 called\n");
if(mmapFd >= 0) return TRUE;
if ((mmapFd = open("/dev/mmap", O_RDWR)) != -1)
{
if(ioctl(mmapFd, GETVERSION) < 0x0222) {
xf86Msg(X_WARNING,
"xf86LinearVidMem: MMAP 2.2.2 or above required\n");
xf86ErrorF("\tlinear memory access disabled\n");
return FALSE;
}
return TRUE;
}
xf86Msg(X_WARNING, "xf86LinearVidMem: failed to open /dev/mmap (%s)\n",
strerror(errno));
xf86ErrorF("\tlinear memory access disabled\n");
return FALSE;
#endif
}
static pointer
mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
pointer base;
int fd;
#if defined(SVR4)
fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
if (fd < 0)
{
FatalError("xf86MapVidMem: failed to open %s (%s)\n",
DEV_MEM, strerror(errno));
}
base = mmap((caddr_t)0, Size,
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE),
MAP_SHARED, fd, (off_t)Base);
close(fd);
if (base == MAP_FAILED)
{
FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n",
"xf86MapVidMem", Size, Base, strerror(errno));
}
#else /* SVR4 */
#ifdef HAS_SVR3_MMAPDRV
xf86MsgVerb(X_INFO, MMAP_DEBUG, "# xf86MapVidMem: MMAP 2.2.2 called\n");
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"MMAP_VERSION: 0x%x\n",ioctl(mmapFd, GETVERSION));
if (ioctl(mmapFd, GETVERSION) == -1)
{
xf86LinearVidMem();
}
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"MMAP_VERSION: 0x%x\n",ioctl(mmapFd, GETVERSION));
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"xf86MapVidMem: Screen: %d\n", ScreenNum);
mmapStat(Base,Size);
/* To force the MMAP driver to provide the address */
base = (pointer)0;
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"xf86MapVidMem: [s=%x,a=%x]\n", Size, Base);
MapDSC.vaddr = (char *)base;
MapDSC.physaddr = (char *)Base;
MapDSC.length = Size;
MapDSC.ioflg = 1;
if(mmapFd >= 0)
{
if((base = (pointer)ioctl(mmapFd, MAP, &MapDSC)) == (pointer)-1)
{
FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n",
"xf86MapVidMem", Size, Base, strerror(errno));
/* NOTREACHED */
}
/* Next time we want the same address! */
MapDSC.vaddr = (char *)base;
}
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"MapDSC.vaddr : 0x%x\n", MapDSC.vaddr);
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"MapDSC.physaddr: 0x%x\n", MapDSC.physaddr);
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"MapDSC.length : %d\n", MapDSC.length);
mmapStat(Base,Size);
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"xf86MapVidMem: [s=%x,a=%x,b=%x]\n", Size, Base, base);
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"xf86MapVidMem: SUCCEED Mapping FrameBuffer \n");
#endif /* HAS_SVR3_MMAPDRV */
#endif /* SVR4 */
return base;
}
/* ARGSUSED */
static void
unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
{
#if defined (SVR4)
munmap(Base, Size);
#else /* SVR4 */
#ifdef HAS_SVR3_MMAPDRV
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"# xf86UnMapVidMem: UNMapping FrameBuffer\n");
mmapStat(Base,Size);
ioctl(mmapFd, UNMAPRM , Base);
mmapStat(Base,Size);
xf86MsgVerb(X_INFO, MMAP_DEBUG,
"# xf86UnMapVidMem: Screen: %d [v=%x]\n", ScreenNum, Base);
#endif /* HAS_SVR3_MMAPDRV */
#endif /* SVR4 */
return;
}
#if defined(SVR4) && defined(__i386__) && !defined(sun)
/*
* For some SVR4 versions, a 32-bit read is done for the first location
* in each page when the page is first mapped. If this is done while
* memory access is enabled for regions that have read side-effects,
* this can cause unexpected results, including lockups on some hardware.
* This function is called to make sure each page is mapped while it is
* safe to do so.
*/
/*
* XXX Should get this the correct way (see os/xalloc.c), but since this is
* for one platform I'll be lazy.
*/
#define X_PAGE_SIZE 4096
static void
readSideEffects(int ScreenNum, pointer Base, unsigned long Size)
{
unsigned long base, end, addr;
CARD32 val;
base = (unsigned long)Base;
end = base + Size;
for (addr = base; addr < end; addr += X_PAGE_SIZE)
val = *(volatile CARD32 *)addr;
}
#endif
void
xf86OSInitVidMem(VidMemInfoPtr pVidMem)
{
pVidMem->linearSupported = linearVidMem();
pVidMem->mapMem = mapVidMem;
pVidMem->unmapMem = unmapVidMem;
#if defined(SVR4) && defined(__i386__) && !defined(sun)
pVidMem->readSideEffects = readSideEffects;
#endif
pVidMem->initialised = TRUE;
}
/***************************************************************************/
/* I/O Permissions section */
/***************************************************************************/
static Bool ExtendedEnabled = FALSE;
static Bool InitDone = FALSE;
Bool
xf86EnableIO()
{
int i;
if (ExtendedEnabled)
return TRUE;
if (SET_IOPL() < 0)
{
xf86Msg(X_WARNING,
"xf86EnableIO: Failed to set IOPL for extended I/O\n");
return FALSE;
}
ExtendedEnabled = TRUE;
return TRUE;
}
void
xf86DisableIO()
{
if (!ExtendedEnabled)
return;
RESET_IOPL();
ExtendedEnabled = FALSE;
return;
}

View File

@ -1028,6 +1028,11 @@ VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data)
if (pScrn->monitor->nHsync || pScrn->monitor->nVrefresh) if (pScrn->monitor->nHsync || pScrn->monitor->nVrefresh)
return; return;
if (data->hsize < 320 || data->vsize < 240) {
xf86DrvMsg(scrnIndex, X_INFO, "...which I refuse to believe\n");
return;
}
mode = xf86CVTMode(data->hsize, data->vsize, PANEL_HZ, 1, 0); mode = xf86CVTMode(data->hsize, data->vsize, PANEL_HZ, 1, 0);
pScrn->monitor->nHsync = 1; pScrn->monitor->nHsync = 1;

View File

@ -1241,8 +1241,6 @@ typedef struct _XAAInfoRec {
GetImageProcPtr GetImage; GetImageProcPtr GetImage;
GetSpansProcPtr GetSpans; GetSpansProcPtr GetSpans;
CopyWindowProcPtr CopyWindow; CopyWindowProcPtr CopyWindow;
BackingStoreSaveAreasProcPtr SaveAreas;
BackingStoreRestoreAreasProcPtr RestoreAreas;
unsigned int offscreenDepths; unsigned int offscreenDepths;
Bool offscreenDepthsInitialized; Bool offscreenDepthsInitialized;

View File

@ -1,11 +0,0 @@
module_LTLIBRARIES = libxf8_16bpp.la
sdk_HEADERS = cfb8_16.h
INCLUDES = $(XORG_INCS) -I$(top_srcdir)/fb
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
libxf8_16bpp_la_LDFLAGS = -avoid-version
libxf8_16bpp_la_SOURCES = xf8_16module.c

View File

@ -1,37 +0,0 @@
/*
* Copyright 2006 Adam Jackson.
*
* 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 (including the next
* paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
*/
#ifndef _CFB8_16_H
#define _CFB8_16_H
#include "regionstr.h"
#include "windowstr.h"
/* this has to stay misnamed for ABI reasons */
extern _X_EXPORT Bool
cfb8_16ScreenInit(ScreenPtr pScreen, pointer pbits16, pointer pbits8,
int xsize, int ysize, int dpix, int dpiy,
int width16, int width8);
#endif /* _CFB8_16_H */

View File

@ -1,78 +0,0 @@
/*
* Copyright 2006 Adam Jackson.
*
* 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 (including the next
* paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <X11/X.h>
#include <X11/Xmd.h>
#include "misc.h"
#include "servermd.h"
#include "scrnintstr.h"
#include "resource.h"
#include "fb.h"
#include "fboverlay.h"
#include "cfb8_16.h"
Bool
cfb8_16ScreenInit(ScreenPtr pScreen, pointer pbits16, pointer pbits8,
int xsize, int ysize, int dpix, int dpiy,
int width16, int width8)
{
return
(fbOverlaySetupScreen(pScreen, pbits16, pbits8, xsize, ysize,
dpix, dpiy, width16, width8, 16, 8) &&
fbOverlayFinishScreenInit(pScreen, pbits16, pbits8, xsize, ysize,
dpix, dpiy, width16, width8, 16, 8, 16, 8));
}
#include "xf86Module.h"
static MODULESETUPPROTO(xf8_16bppSetup);
static XF86ModuleVersionInfo VersRec = {
"xf8_16bpp",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
2, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
NULL,
{0,0,0,0} /* signature, to be patched into the file by a tool */
};
_X_EXPORT XF86ModuleData xf8_16bppModuleData = {
&VersRec,
xf8_16bppSetup,
NULL
};
static pointer
xf8_16bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
return (pointer)LoadSubModule(module, "fb", NULL, NULL, NULL, NULL,
errmaj, errmin);
}

View File

@ -239,8 +239,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
defaultVisual, /* root visual */ defaultVisual, /* root visual */
numVisuals, visuals); numVisuals, visuals);
/* miInitializeBackingStore(pScreen); */
pScreen->defColormap = (Colormap) FakeClientID(0); pScreen->defColormap = (Colormap) FakeClientID(0);
pScreen->minInstalledCmaps = MINCMAPS; pScreen->minInstalledCmaps = MINCMAPS;
pScreen->maxInstalledCmaps = MAXCMAPS; pScreen->maxInstalledCmaps = MAXCMAPS;

View File

@ -586,8 +586,6 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
screen->base.createContext = __glXAquaScreenCreateContext; screen->base.createContext = __glXAquaScreenCreateContext;
screen->base.createDrawable = __glXAquaScreenCreateDrawable; screen->base.createDrawable = __glXAquaScreenCreateDrawable;
screen->base.swapInterval = /*FIXME*/ NULL; screen->base.swapInterval = /*FIXME*/ NULL;
screen->base.hyperpipeFuncs = NULL;
screen->base.swapBarrierFuncs = NULL;
screen->base.pScreen = pScreen; screen->base.pScreen = pScreen;
screen->base.fbconfigs = __glXAquaCreateVisualConfigs(&screen->base.numFBConfigs, pScreen->myNum); screen->base.fbconfigs = __glXAquaCreateVisualConfigs(&screen->base.numFBConfigs, pScreen->myNum);

View File

@ -868,28 +868,6 @@ xf86SetRootClip (ScreenPtr pScreen, int enable)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther); (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
} }
if (pWin->backStorage &&
((pWin->backingStore == Always) || WasViewable))
{
if (!WasViewable)
pOldClip = &pWin->clipList; /* a convenient empty region */
bsExposed = (*pScreen->TranslateBackingStore)
(pWin, 0, 0, pOldClip,
pWin->drawable.x, pWin->drawable.y);
if (WasViewable)
RegionDestroy(pOldClip);
if (bsExposed)
{
RegionPtr valExposed = NullRegion;
if (pWin->valdata)
valExposed = &pWin->valdata->after.exposed;
(*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
if (valExposed)
RegionEmpty(valExposed);
RegionDestroy(bsExposed);
}
}
if (WasViewable) if (WasViewable)
{ {
if (anyMarked) if (anyMarked)

View File

@ -649,8 +649,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
screen->base.createContext = glxWinCreateContext; screen->base.createContext = glxWinCreateContext;
screen->base.createDrawable = glxWinCreateDrawable; screen->base.createDrawable = glxWinCreateDrawable;
screen->base.swapInterval = glxWinScreenSwapInterval; screen->base.swapInterval = glxWinScreenSwapInterval;
screen->base.hyperpipeFuncs = NULL;
screen->base.swapBarrierFuncs = NULL;
screen->base.pScreen = pScreen; screen->base.pScreen = pScreen;
if (strstr(wgl_extensions, "WGL_ARB_pixel_format")) if (strstr(wgl_extensions, "WGL_ARB_pixel_format"))

View File

@ -394,13 +394,6 @@ winFinishScreenInitFB (int index,
} }
#endif #endif
/*
* Backing store support should reduce network traffic and increase
* performance.
*/
miInitializeBackingStore (pScreen);
/* KDrive does miDCInitialize right after miInitializeBackingStore */
/* Setup the cursor routines */ /* Setup the cursor routines */
#if CYGDEBUG #if CYGDEBUG
winDebug ("winFinishScreenInitFB - Calling miDCInitialize ()\n"); winDebug ("winFinishScreenInitFB - Calling miDCInitialize ()\n");

View File

@ -1,8 +1,6 @@
if XORG if XORG
sdk_HEADERS = \ sdk_HEADERS = \
XIstubs.h \ XIstubs.h \
bstore.h \
bstorestr.h \
callback.h \ callback.h \
closestr.h \ closestr.h \
closure.h \ closure.h \

View File

@ -1,22 +0,0 @@
/*
* Copyright (c) 1987 by the Regents of the University of California
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies. The University of
* California makes no representations about the suitability of this software
* for any purpose. It is provided "as is" without express or implied
* warranty.
*/
/*
* Moved here from mi to allow wrapping of lower level backing store functions.
* -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org)
*/
#ifndef _BSTORE_H_
#define _BSTORE_H_
#include "bstorestr.h"
#endif /* _BSTORE_H_ */

View File

@ -1,55 +0,0 @@
/*
* Copyright (c) 1987 by the Regents of the University of California
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies. The University of
* California makes no representations about the suitability of this software
* for any purpose. It is provided "as is" without express or implied
* warranty.
*/
/*
* Moved here from mi to allow wrapping of lower level backing store functions.
* -- 1997.10.27 Marc Aurele La France (tsi@xfree86.org)
*/
#ifndef _BSTORESTR_H_
#define _BSTORESTR_H_
#include "gc.h"
#include "pixmap.h"
#include "region.h"
#include "window.h"
typedef void (* BackingStoreSaveAreasProcPtr)(
PixmapPtr /*pBackingPixmap*/,
RegionPtr /*pObscured*/,
int /*x*/,
int /*y*/,
WindowPtr /*pWin*/);
typedef void (* BackingStoreRestoreAreasProcPtr)(
PixmapPtr /*pBackingPixmap*/,
RegionPtr /*pExposed*/,
int /*x*/,
int /*y*/,
WindowPtr /*pWin*/);
typedef void (* BackingStoreSetClipmaskRgnProcPtr)(
GCPtr /*pBackingGC*/,
RegionPtr /*pbackingCompositeClip*/);
typedef PixmapPtr (* BackingStoreGetImagePixmapProcPtr)(void);
typedef PixmapPtr (* BackingStoreGetSpansPixmapProcPtr)(void);
typedef struct _BSFuncs {
BackingStoreSaveAreasProcPtr SaveAreas;
BackingStoreRestoreAreasProcPtr RestoreAreas;
BackingStoreSetClipmaskRgnProcPtr SetClipmaskRgn;
BackingStoreGetImagePixmapProcPtr GetImagePixmap;
BackingStoreGetSpansPixmapProcPtr GetSpansPixmap;
} BSFuncRec, *BSFuncPtr;
#endif /* _BSTORESTR_H_ */

View File

@ -50,7 +50,6 @@ SOFTWARE.
#include "screenint.h" #include "screenint.h"
#include "regionstr.h" #include "regionstr.h"
#include "bstore.h"
#include "colormap.h" #include "colormap.h"
#include "cursor.h" #include "cursor.h"
#include "validate.h" #include "validate.h"
@ -213,48 +212,6 @@ typedef PixmapPtr (* CreatePixmapProcPtr)(
typedef Bool (* DestroyPixmapProcPtr)( typedef Bool (* DestroyPixmapProcPtr)(
PixmapPtr /*pPixmap*/); PixmapPtr /*pPixmap*/);
typedef void (* SaveDoomedAreasProcPtr)(
WindowPtr /*pWindow*/,
RegionPtr /*prgnSave*/,
int /*xorg*/,
int /*yorg*/);
typedef RegionPtr (* RestoreAreasProcPtr)(
WindowPtr /*pWindow*/,
RegionPtr /*prgnRestore*/);
typedef void (* ExposeCopyProcPtr)(
WindowPtr /*pSrc*/,
DrawablePtr /*pDst*/,
GCPtr /*pGC*/,
RegionPtr /*prgnExposed*/,
int /*srcx*/,
int /*srcy*/,
int /*dstx*/,
int /*dsty*/,
unsigned long /*plane*/);
typedef RegionPtr (* TranslateBackingStoreProcPtr)(
WindowPtr /*pWindow*/,
int /*windx*/,
int /*windy*/,
RegionPtr /*oldClip*/,
int /*oldx*/,
int /*oldy*/);
typedef RegionPtr (* ClearBackingStoreProcPtr)(
WindowPtr /*pWindow*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/,
Bool /*generateExposures*/);
typedef void (* DrawGuaranteeProcPtr)(
WindowPtr /*pWindow*/,
GCPtr /*pGC*/,
int /*guarantee*/);
typedef Bool (* RealizeFontProcPtr)( typedef Bool (* RealizeFontProcPtr)(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
FontPtr /*pFont*/); FontPtr /*pFont*/);
@ -388,14 +345,6 @@ typedef Bool (* MarkOverlappedWindowsProcPtr)(
WindowPtr /*firstChild*/, WindowPtr /*firstChild*/,
WindowPtr * /*pLayerWin*/); WindowPtr * /*pLayerWin*/);
typedef Bool (* ChangeSaveUnderProcPtr)(
WindowPtr /*pLayerWin*/,
WindowPtr /*firstChild*/);
typedef void (* PostChangeSaveUnderProcPtr)(
WindowPtr /*pLayerWin*/,
WindowPtr /*firstChild*/);
typedef int (* ConfigNotifyProcPtr)( typedef int (* ConfigNotifyProcPtr)(
WindowPtr /*pWin*/, WindowPtr /*pWin*/,
int /*x*/, int /*x*/,
@ -511,20 +460,6 @@ typedef struct _Screen {
CreatePixmapProcPtr CreatePixmap; CreatePixmapProcPtr CreatePixmap;
DestroyPixmapProcPtr DestroyPixmap; DestroyPixmapProcPtr DestroyPixmap;
/* Backing store procedures */
SaveDoomedAreasProcPtr SaveDoomedAreas;
RestoreAreasProcPtr RestoreAreas;
ExposeCopyProcPtr ExposeCopy;
TranslateBackingStoreProcPtr TranslateBackingStore;
ClearBackingStoreProcPtr ClearBackingStore;
DrawGuaranteeProcPtr DrawGuarantee;
/*
* A read/write copy of the lower level backing store vector is needed now
* that the functions can be wrapped.
*/
BSFuncRec BackingStoreFuncs;
/* Font procedures */ /* Font procedures */
RealizeFontProcPtr RealizeFont; RealizeFontProcPtr RealizeFont;
@ -584,8 +519,6 @@ typedef struct _Screen {
MarkWindowProcPtr MarkWindow; MarkWindowProcPtr MarkWindow;
MarkOverlappedWindowsProcPtr MarkOverlappedWindows; MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
ChangeSaveUnderProcPtr ChangeSaveUnder;
PostChangeSaveUnderProcPtr PostChangeSaveUnder;
ConfigNotifyProcPtr ConfigNotify; ConfigNotifyProcPtr ConfigNotify;
MoveWindowProcPtr MoveWindow; MoveWindowProcPtr MoveWindow;
ResizeWindowProcPtr ResizeWindow; ResizeWindowProcPtr ResizeWindow;

View File

@ -79,8 +79,8 @@ typedef struct _DevCursorNode {
} DevCursNodeRec, *DevCursNodePtr, *DevCursorList; } DevCursNodeRec, *DevCursNodePtr, *DevCursorList;
typedef struct _WindowOpt { typedef struct _WindowOpt {
VisualID visual; /* default: same as parent */
CursorPtr cursor; /* default: window.cursorNone */ CursorPtr cursor; /* default: window.cursorNone */
VisualID visual; /* default: same as parent */
Colormap colormap; /* default: same as parent */ Colormap colormap; /* default: same as parent */
Mask dontPropagateMask; /* default: window.dontPropagate */ Mask dontPropagateMask; /* default: window.dontPropagate */
Mask otherEventMasks; /* default: 0 */ Mask otherEventMasks; /* default: 0 */

View File

@ -12,9 +12,7 @@ libmi_la_SOURCES = \
mi.h \ mi.h \
miarc.c \ miarc.c \
mibitblt.c \ mibitblt.c \
mibstore.c \
mibstore.h \ mibstore.h \
mibstorest.h \
micmap.c \ micmap.c \
micmap.h \ micmap.h \
micoord.h \ micoord.h \

View File

@ -456,10 +456,6 @@ extern _X_EXPORT Bool miScreenInit(
VisualPtr /*visuals*/ VisualPtr /*visuals*/
); );
extern _X_EXPORT DevPrivateKey miAllocateGCPrivateIndex(
void
);
/* mivaltree.c */ /* mivaltree.c */
extern _X_EXPORT int miShapedWindowIn( extern _X_EXPORT int miShapedWindowIn(

View File

@ -40,10 +40,4 @@
void void
miInitializeBackingStore (ScreenPtr pScreen) miInitializeBackingStore (ScreenPtr pScreen)
{ {
pScreen->SaveDoomedAreas = NULL;
pScreen->RestoreAreas = NULL;
pScreen->ExposeCopy = NULL;
pScreen->TranslateBackingStore = NULL;
pScreen->ClearBackingStore = NULL;
pScreen->DrawGuarantee = NULL;
} }

View File

@ -18,8 +18,6 @@
#include "screenint.h" #include "screenint.h"
extern _X_EXPORT void miInitializeBackingStore( #define miInitializeBackingStore(x) do {} while (0)
ScreenPtr /*pScreen*/
);
#endif /* _MIBSTORE_H */ #endif /* _MIBSTORE_H */

View File

@ -1,91 +0,0 @@
/*
* mibstorest.h
*
* internal structure definitions for mi backing store
*/
/*
Copyright 1989, 1998 The Open Group
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.
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
OPEN GROUP 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 Open Group 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 Open Group.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "mibstore.h"
#include "regionstr.h"
/*
* One of these structures is allocated per GC used with a backing-store
* drawable.
*/
typedef struct {
GCPtr pBackingGC; /* Copy of the GC but with graphicsExposures
* set FALSE and the clientClip set to
* clip output to the valid regions of the
* backing pixmap. */
int guarantee; /* GuaranteeNothing, etc. */
unsigned long serialNumber; /* clientClip computed time */
unsigned long stateChanges; /* changes in parent gc since last copy */
GCOps *wrapOps; /* wrapped ops */
GCFuncs *wrapFuncs; /* wrapped funcs */
} miBSGCRec, *miBSGCPtr;
/*
* one of these structures is allocated per Window with backing store
*/
typedef struct {
PixmapPtr pBackingPixmap; /* Pixmap for saved areas */
short x; /* origin of pixmap relative to window */
short y;
RegionRec SavedRegion; /* Valid area in pBackingPixmap */
char viewable; /* Tracks pWin->viewable so SavedRegion may
* be initialized correctly when the window
* is first mapped */
char status; /* StatusNoPixmap, etc. */
char backgroundState; /* background type */
PixUnion background; /* background pattern */
} miBSWindowRec, *miBSWindowPtr;
#define StatusNoPixmap 1 /* pixmap has not been created */
#define StatusVirtual 2 /* pixmap is virtual, tiled with background */
#define StatusVDirty 3 /* pixmap is virtual, visiblt has contents */
#define StatusBadAlloc 4 /* pixmap create failed, do not try again */
#define StatusContents 5 /* pixmap is created, has valid contents */
typedef struct {
/*
* screen func wrappers
*/
CloseScreenProcPtr CloseScreen;
GetImageProcPtr GetImage;
GetSpansProcPtr GetSpans;
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
CreateGCProcPtr CreateGC;
DestroyWindowProcPtr DestroyWindow;
} miBSScreenRec, *miBSScreenPtr;

View File

@ -269,8 +269,6 @@ miScreenInit(
pScreen->wakeupData = (pointer)0; pScreen->wakeupData = (pointer)0;
pScreen->MarkWindow = miMarkWindow; pScreen->MarkWindow = miMarkWindow;
pScreen->MarkOverlappedWindows = miMarkOverlappedWindows; pScreen->MarkOverlappedWindows = miMarkOverlappedWindows;
pScreen->ChangeSaveUnder = NULL;
pScreen->PostChangeSaveUnder = NULL;
pScreen->MoveWindow = miMoveWindow; pScreen->MoveWindow = miMoveWindow;
pScreen->ResizeWindow = miSlideAndSizeWindow; pScreen->ResizeWindow = miSlideAndSizeWindow;
pScreen->GetLayerWindow = miGetLayerWindow; pScreen->GetLayerWindow = miGetLayerWindow;
@ -280,29 +278,11 @@ miScreenInit(
pScreen->SetShape = miSetShape; pScreen->SetShape = miSetShape;
pScreen->MarkUnrealizedWindow = miMarkUnrealizedWindow; pScreen->MarkUnrealizedWindow = miMarkUnrealizedWindow;
pScreen->SaveDoomedAreas = 0;
pScreen->RestoreAreas = 0;
pScreen->ExposeCopy = 0;
pScreen->TranslateBackingStore = 0;
pScreen->ClearBackingStore = 0;
pScreen->DrawGuarantee = 0;
miSetZeroLineBias(pScreen, DEFAULTZEROLINEBIAS); miSetZeroLineBias(pScreen, DEFAULTZEROLINEBIAS);
return miScreenDevPrivateInit(pScreen, width, pbits); return miScreenDevPrivateInit(pScreen, width, pbits);
} }
static DevPrivateKeyRec privateKeyRec;
#define privateKey (&privateKeyRec)
DevPrivateKey
miAllocateGCPrivateIndex(void)
{
if (!dixRegisterPrivateKey(&privateKeyRec, PRIVATE_GC, 0))
return NULL;
return privateKey;
}
DevPrivateKeyRec miZeroLineScreenKeyRec; DevPrivateKeyRec miZeroLineScreenKeyRec;
void void

View File

@ -40,8 +40,7 @@ typedef union _Validate {
DDXPointRec oldAbsCorner; /* old window position */ DDXPointRec oldAbsCorner; /* old window position */
RegionPtr borderVisible; /* visible region of border, */ RegionPtr borderVisible; /* visible region of border, */
/* non-null when size changes */ /* non-null when size changes */
Bool resized; /* unclipped winSize has changed - */ Bool resized; /* unclipped winSize has changed */
/* don't call SaveDoomedAreas */
} before; } before;
struct AfterValidate { struct AfterValidate {
RegionRec exposed; /* exposed regions, absolute pos */ RegionRec exposed; /* exposed regions, absolute pos */

View File

@ -471,18 +471,6 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen,
universe, &pParent->clipList); universe, &pParent->clipList);
} }
/*
* One last thing: backing storage. We have to try to save what parts of
* the window are about to be obscured. We can just subtract the universe
* from the old clipList and get the areas that were in the old but aren't
* in the new and, hence, are about to be obscured.
*/
if (pParent->backStorage && !resized)
{
RegionSubtract(exposed, &pParent->clipList, universe);
(* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy);
}
/* HACK ALERT - copying contents of regions, instead of regions */ /* HACK ALERT - copying contents of regions, instead of regions */
{ {
RegionRec tmp; RegionRec tmp;

View File

@ -71,10 +71,9 @@ typedef struct _GlyphHash {
typedef struct _GlyphSet { typedef struct _GlyphSet {
CARD32 refcnt; CARD32 refcnt;
PictFormatPtr format;
int fdepth; int fdepth;
PictFormatPtr format;
GlyphHashRec hash; GlyphHashRec hash;
int maxPrivate;
PrivateRec *devPrivates; PrivateRec *devPrivates;
} GlyphSetRec, *GlyphSetPtr; } GlyphSetRec, *GlyphSetPtr;

View File

@ -735,13 +735,12 @@ SetPictureToDefaults (PicturePtr pPicture)
pPicture->transform = 0; pPicture->transform = 0;
pPicture->dither = None;
pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE); pPicture->filter = PictureGetFilterId (FilterNearest, -1, TRUE);
pPicture->filter_params = 0; pPicture->filter_params = 0;
pPicture->filter_nparams = 0; pPicture->filter_nparams = 0;
pPicture->serialNumber = GC_CHANGE_SERIAL_BIT; pPicture->serialNumber = GC_CHANGE_SERIAL_BIT;
pPicture->stateChanges = (1 << (CPLastBit+1)) - 1; pPicture->stateChanges = -1;
pPicture->pSourcePict = 0; pPicture->pSourcePict = 0;
} }
@ -1261,7 +1260,7 @@ ChangePicture (PicturePtr pPicture,
} }
break; break;
case CPDither: case CPDither:
pPicture->dither = NEXT_VAL(Atom); (void) NEXT_VAL(Atom); /* unimplemented */
break; break;
case CPComponentAlpha: case CPComponentAlpha:
{ {
@ -1480,7 +1479,6 @@ CopyPicture (PicturePtr pSrc,
pDst->polyMode = pSrc->polyMode; pDst->polyMode = pSrc->polyMode;
break; break;
case CPDither: case CPDither:
pDst->dither = pSrc->dither;
break; break;
case CPComponentAlpha: case CPComponentAlpha:
pDst->componentAlpha = pSrc->componentAlpha; pDst->componentAlpha = pSrc->componentAlpha;

View File

@ -151,8 +151,6 @@ typedef struct _Picture {
PictFormatShort format; /* PICT_FORMAT */ PictFormatShort format; /* PICT_FORMAT */
int refcnt; int refcnt;
CARD32 id; CARD32 id;
PicturePtr pNext; /* chain on same drawable */
unsigned int repeat : 1; unsigned int repeat : 1;
unsigned int graphicsExposures : 1; unsigned int graphicsExposures : 1;
unsigned int subWindowMode : 1; unsigned int subWindowMode : 1;
@ -162,7 +160,11 @@ typedef struct _Picture {
unsigned int clientClipType : 2; unsigned int clientClipType : 2;
unsigned int componentAlpha : 1; unsigned int componentAlpha : 1;
unsigned int repeatType : 2; unsigned int repeatType : 2;
unsigned int unused : 21; unsigned int filter : 3;
unsigned int stateChanges : CPLastBit;
unsigned int unused : 18 - CPLastBit;
PicturePtr pNext; /* chain on same drawable */
PicturePtr alphaMap; PicturePtr alphaMap;
DDXPointRec alphaOrigin; DDXPointRec alphaOrigin;
@ -170,9 +172,6 @@ typedef struct _Picture {
DDXPointRec clipOrigin; DDXPointRec clipOrigin;
pointer clientClip; pointer clientClip;
Atom dither;
unsigned long stateChanges;
unsigned long serialNumber; unsigned long serialNumber;
RegionPtr pCompositeClip; RegionPtr pCompositeClip;
@ -181,10 +180,9 @@ typedef struct _Picture {
PictTransform *transform; PictTransform *transform;
int filter; SourcePictPtr pSourcePict;
xFixed *filter_params; xFixed *filter_params;
int filter_nparams; int filter_nparams;
SourcePictPtr pSourcePict;
} PictureRec; } PictureRec;
typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id, typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id,
@ -205,6 +203,7 @@ typedef struct {
#define PictFilterBest 4 #define PictFilterBest 4
#define PictFilterConvolution 5 #define PictFilterConvolution 5
/* if you add an 8th filter, expand the filter bitfield above */
typedef struct { typedef struct {
char *alias; char *alias;

View File

@ -842,3 +842,81 @@ SProcXFixesExpandRegion (ClientPtr client)
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
int
PanoramiXFixesSetGCClipRegion (ClientPtr client)
{
REQUEST(xXFixesSetGCClipRegionReq);
int result = Success, j;
PanoramiXRes *gc;
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
if ((result = dixLookupResourceByType((void **)&gc, stuff->gc, XRT_GC,
client, DixWriteAccess))) {
client->errorValue = stuff->gc;
return result;
}
FOR_NSCREENS_BACKWARD(j) {
stuff->gc = gc->info[j].id;
result = (*PanoramiXSaveXFixesVector[X_XFixesSetGCClipRegion]) (client);
if(result != Success) break;
}
return result;
}
int
PanoramiXFixesSetWindowShapeRegion (ClientPtr client)
{
int result = Success, j;
PanoramiXRes *win;
REQUEST(xXFixesSetWindowShapeRegionReq);
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
if ((result = dixLookupResourceByType((void **)&win, stuff->dest,
XRT_WINDOW, client,
DixWriteAccess))) {
client->errorValue = stuff->dest;
return result;
}
FOR_NSCREENS_FORWARD(j) {
stuff->dest = win->info[j].id;
result = (*PanoramiXSaveXFixesVector[X_XFixesSetWindowShapeRegion]) (client);
if(result != Success) break;
}
return result;
}
int
PanoramiXFixesSetPictureClipRegion (ClientPtr client)
{
REQUEST(xXFixesSetPictureClipRegionReq);
int result = Success, j;
PanoramiXRes *pict;
REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
if ((result = dixLookupResourceByType((void **)&pict, stuff->picture,
XRT_PICTURE, client,
DixWriteAccess))) {
client->errorValue = stuff->picture;
return result;
}
FOR_NSCREENS_BACKWARD(j) {
stuff->picture = pict->info[j].id;
result = (*PanoramiXSaveXFixesVector[X_XFixesSetPictureClipRegion]) (client);
if(result != Success) break;
}
return result;
}
#endif

View File

@ -262,3 +262,33 @@ XFixesExtensionInit(void)
SetResourceTypeErrorValue(RegionResType, XFixesErrorBase + BadRegion); SetResourceTypeErrorValue(RegionResType, XFixesErrorBase + BadRegion);
} }
} }
#ifdef PANORAMIX
int (*PanoramiXSaveXFixesVector[XFixesNumberRequests])(ClientPtr);
void
PanoramiXFixesInit (void)
{
int i;
for (i = 0; i < XFixesNumberRequests; i++)
PanoramiXSaveXFixesVector[i] = ProcXFixesVector[i];
/*
* Stuff in Xinerama aware request processing hooks
*/
ProcXFixesVector[X_XFixesSetGCClipRegion] = PanoramiXFixesSetGCClipRegion;
ProcXFixesVector[X_XFixesSetWindowShapeRegion] = PanoramiXFixesSetWindowShapeRegion;
ProcXFixesVector[X_XFixesSetPictureClipRegion] = PanoramiXFixesSetPictureClipRegion;
}
void
PanoramiXFixesReset (void)
{
int i;
for (i = 0; i < XFixesNumberRequests; i++)
ProcXFixesVector[i] = PanoramiXSaveXFixesVector[i];
}
#endif

View File

@ -255,6 +255,15 @@ ProcXFixesExpandRegion (ClientPtr client);
int int
SProcXFixesExpandRegion (ClientPtr client); SProcXFixesExpandRegion (ClientPtr client);
int
PanoramiXFixesSetGCClipRegion (ClientPtr client);
int
PanoramiXFixesSetWindowShapeRegion (ClientPtr client);
int
PanoramiXFixesSetPictureClipRegion (ClientPtr client);
/* Cursor Visibility (Version 4) */ /* Cursor Visibility (Version 4) */
int int
@ -269,4 +278,8 @@ ProcXFixesShowCursor (ClientPtr client);
int int
SProcXFixesShowCursor (ClientPtr client); SProcXFixesShowCursor (ClientPtr client);
extern int (*PanoramiXSaveXFixesVector[XFixesNumberRequests])(ClientPtr);
void PanoramiXFixesInit (void);
void PanoramiXFixesReset (void);
#endif /* _XFIXESINT_H_ */ #endif /* _XFIXESINT_H_ */