Merge branch 'master' of git://people.freedesktop.org/~herrb/xserver into for-keith

This commit is contained in:
Peter Hutterer 2011-04-04 09:58:53 +10:00
commit a52049de2f
64 changed files with 259 additions and 7948 deletions

View File

@ -185,7 +185,7 @@ SGEGenericEvent(xEvent* from, xEvent* to)
xGenericEvent* gefrom = (xGenericEvent*)from; xGenericEvent* gefrom = (xGenericEvent*)from;
xGenericEvent* geto = (xGenericEvent*)to; xGenericEvent* geto = (xGenericEvent*)to;
if (gefrom->extension > MAXEXTENSIONS) if ((gefrom->extension & 0x7f) > MAXEXTENSIONS)
{ {
ErrorF("GE: Invalid extension offset for event.\n"); ErrorF("GE: Invalid extension offset for event.\n");
return; return;

View File

@ -49,6 +49,7 @@ SOFTWARE.
* Dispatch routines and initialization routines for the X input extension. * Dispatch routines and initialization routines for the X input extension.
* *
*/ */
#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
#define NUMTYPES 15 #define NUMTYPES 15
@ -410,7 +411,7 @@ static int
ProcIDispatch(ClientPtr client) ProcIDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
if (stuff->data > (IREQUESTS + XI2REQUESTS) || !ProcIVector[stuff->data]) if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
return BadRequest; return BadRequest;
return (*ProcIVector[stuff->data])(client); return (*ProcIVector[stuff->data])(client);
@ -429,7 +430,7 @@ static int
SProcIDispatch(ClientPtr client) SProcIDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
if (stuff->data > IREQUESTS || !SProcIVector[stuff->data]) if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
return BadRequest; return BadRequest;
return (*SProcIVector[stuff->data])(client); return (*SProcIVector[stuff->data])(client);
@ -863,6 +864,8 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
{ {
case XI_Enter: case XI_Enter:
case XI_Leave: case XI_Leave:
case XI_FocusIn:
case XI_FocusOut:
SDeviceLeaveNotifyEvent((xXILeaveEvent*)from, (xXILeaveEvent*)to); SDeviceLeaveNotifyEvent((xXILeaveEvent*)from, (xXILeaveEvent*)to);
break; break;
case XI_DeviceChanged: case XI_DeviceChanged:

View File

@ -153,8 +153,9 @@ ProcXIQueryDevice(ClientPtr client)
} }
} }
len = rep.length * 4;
WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep);
WriteToClient(client, rep.length * 4, ptr); WriteToClient(client, len, ptr);
free(ptr); free(ptr);
free(skip); free(skip);
return rc; return rc;

View File

@ -590,7 +590,10 @@ AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerate
[AIGLX=yes]) [AIGLX=yes])
AX_TLS AX_TLS
AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]), AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]),
[GLX_USE_TLS=$enableval], [GLX_USE_TLS=$enableval
if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.])
fi],
[GLX_USE_TLS=no [GLX_USE_TLS=no
if test "${ac_cv_tls}" != "none" ; then if test "${ac_cv_tls}" != "none" ; then
GLX_USE_TLS=yes GLX_USE_TLS=yes

View File

@ -562,6 +562,17 @@ RebuildTable(int client)
clientTable[client].resources = resources; clientTable[client].resources = resources;
} }
static void
doFreeResource(ResourcePtr res, Bool skip)
{
CallResourceStateCallback(ResourceStateFreeing, res);
if (!skip)
resourceTypes[res->type & TypeMask].deleteFunc(res->value, res->id);
free(res);
}
void void
FreeResource(XID id, RESTYPE skipDeleteFuncType) FreeResource(XID id, RESTYPE skipDeleteFuncType)
{ {
@ -590,11 +601,8 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
*prev = res->next; *prev = res->next;
elements = --*eltptr; elements = --*eltptr;
CallResourceStateCallback(ResourceStateFreeing, res); doFreeResource(res, rtype == skipDeleteFuncType);
if (rtype != skipDeleteFuncType)
(*resourceTypes[rtype & TypeMask].deleteFunc)(res->value, res->id);
free(res);
if (*eltptr != elements) if (*eltptr != elements)
prev = head; /* prev may no longer be valid */ prev = head; /* prev may no longer be valid */
} }
@ -604,7 +612,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
} }
} }
void void
FreeResourceByType(XID id, RESTYPE type, Bool skipFree) FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
{ {
@ -627,11 +634,8 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
*prev = res->next; *prev = res->next;
clientTable[cid].elements--; clientTable[cid].elements--;
CallResourceStateCallback(ResourceStateFreeing, res); doFreeResource(res, skipFree);
if (!skipFree)
(*resourceTypes[type & TypeMask].deleteFunc)(res->value, res->id);
free(res);
break; break;
} }
else else
@ -793,12 +797,10 @@ FreeClientNeverRetainResources(ClientPtr client)
#endif #endif
*prev = this->next; *prev = this->next;
clientTable[client->index].elements--; clientTable[client->index].elements--;
CallResourceStateCallback(ResourceStateFreeing, this);
elements = *eltptr; elements = *eltptr;
(*resourceTypes[rtype & TypeMask].deleteFunc)(this->value, this->id);
free(this); doFreeResource(this, FALSE);
if (*eltptr != elements) if (*eltptr != elements)
prev = &resources[j]; /* prev may no longer be valid */ prev = &resources[j]; /* prev may no longer be valid */
} }
@ -841,7 +843,6 @@ FreeClientResources(ClientPtr client)
for (this = *head; this; this = *head) for (this = *head; this; this = *head)
{ {
RESTYPE rtype = this->type;
#ifdef XSERVER_DTRACE #ifdef XSERVER_DTRACE
XSERVER_RESOURCE_FREE(this->id, this->type, XSERVER_RESOURCE_FREE(this->id, this->type,
this->value, TypeNameString(this->type)); this->value, TypeNameString(this->type));
@ -849,10 +850,7 @@ FreeClientResources(ClientPtr client)
*head = this->next; *head = this->next;
clientTable[client->index].elements--; clientTable[client->index].elements--;
CallResourceStateCallback(ResourceStateFreeing, this); doFreeResource(this, FALSE);
(*resourceTypes[rtype & TypeMask].deleteFunc)(this->value, this->id);
free(this);
} }
} }
free(clientTable[client->index].resources); free(clientTable[client->index].resources);

View File

@ -116,6 +116,7 @@ Equipment Corporation.
#include "dixstruct.h" #include "dixstruct.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "servermd.h" #include "servermd.h"
#include "mivalidate.h"
#ifdef PANORAMIX #ifdef PANORAMIX
#include "panoramiX.h" #include "panoramiX.h"
#include "panoramiXsrv.h" #include "panoramiXsrv.h"
@ -3684,3 +3685,105 @@ WindowParentHasDeviceCursor(WindowPtr pWin,
} }
return FALSE; return FALSE;
} }
/*
* SetRootClip --
* Enable or disable rendering to the screen by
* setting the root clip list and revalidating
* all of the windows
*/
void
SetRootClip(ScreenPtr pScreen, Bool enable)
{
WindowPtr pWin = pScreen->root;
WindowPtr pChild;
Bool WasViewable;
Bool anyMarked = FALSE;
WindowPtr pLayerWin;
BoxRec box;
if (!pWin)
return;
WasViewable = (Bool)(pWin->viewable);
if (WasViewable)
{
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
{
(void) (*pScreen->MarkOverlappedWindows)(pChild,
pChild,
&pLayerWin);
}
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
if (pWin->valdata)
{
if (HasBorder (pWin))
{
RegionPtr borderVisible;
borderVisible = RegionCreate(NullBox, 1);
RegionSubtract(borderVisible,
&pWin->borderClip, &pWin->winSize);
pWin->valdata->before.borderVisible = borderVisible;
}
pWin->valdata->before.resized = TRUE;
}
}
/*
* Use REGION_BREAK to avoid optimizations in ValidateTree
* that assume the root borderClip can't change well, normally
* it doesn't...)
*/
if (enable)
{
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
RegionInit(&pWin->winSize, &box, 1);
RegionInit(&pWin->borderSize, &box, 1);
if (WasViewable)
RegionReset(&pWin->borderClip, &box);
pWin->drawable.width = pScreen->width;
pWin->drawable.height = pScreen->height;
RegionBreak(&pWin->clipList);
}
else
{
RegionEmpty(&pWin->borderClip);
RegionBreak(&pWin->clipList);
}
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
if (WasViewable)
{
if (pWin->firstChild)
{
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
pWin->firstChild,
(WindowPtr *)NULL);
}
else
{
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
}
if (anyMarked)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
if (WasViewable)
{
if (anyMarked)
(*pScreen->HandleExposures)(pWin);
if (anyMarked && pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
}
if (pWin->realized)
WindowsRestructured ();
FlushAllOutput();
}

View File

@ -228,10 +228,10 @@ extern DevPrivateKeyRec exaPixmapPrivateKeyRec;
extern DevPrivateKeyRec exaGCPrivateKeyRec; extern DevPrivateKeyRec exaGCPrivateKeyRec;
#define exaGCPrivateKey (&exaGCPrivateKeyRec) #define exaGCPrivateKey (&exaGCPrivateKeyRec)
#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixLookupPrivate(&(s)->devPrivates, exaScreenPrivateKey)) #define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey))
#define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s) #define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s)
#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixLookupPrivate(&(gc)->devPrivates, exaGCPrivateKey)) #define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, exaGCPrivateKey))
#define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc) #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc)
/* /*
@ -282,8 +282,7 @@ extern DevPrivateKeyRec exaGCPrivateKeyRec;
#define EXA_PIXMAP_SCORE_PINNED 1000 #define EXA_PIXMAP_SCORE_PINNED 1000
#define EXA_PIXMAP_SCORE_INIT 1001 #define EXA_PIXMAP_SCORE_INIT 1001
#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixLookupPrivate(&(p)->devPrivates, exaPixmapPrivateKey)) #define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, exaPixmapPrivateKey))
#define ExaSetPixmapPriv(p,a) dixSetPrivate(&(p)->devPrivates, exaPixmapPrivateKey, a)
#define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p) #define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p)
#define EXA_RANGE_PITCH (1 << 0) #define EXA_RANGE_PITCH (1 << 0)

34
fb/fb.h
View File

@ -97,21 +97,10 @@
#if GLYPHPADBYTES != 4 #if GLYPHPADBYTES != 4
#error "GLYPHPADBYTES must be 4" #error "GLYPHPADBYTES must be 4"
#endif #endif
/* whether to bother to include 24bpp support */
#ifndef FBNO24BIT /* for driver compat - intel UXA needs the second one at least */
#define FB_24BIT #define FB_24BIT
#endif
/*
* Unless otherwise instructed, fb includes code to advertise 24bpp
* windows with 32bpp image format for application compatibility
*/
#ifdef FB_24BIT
#ifndef FBNO24_32
#define FB_24_32BIT #define FB_24_32BIT
#endif
#endif
#define FB_STIP_SHIFT LOG2_BITMAP_PAD #define FB_STIP_SHIFT LOG2_BITMAP_PAD
#define FB_STIP_UNIT (1 << FB_STIP_SHIFT) #define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
@ -234,15 +223,6 @@ extern _X_EXPORT void fbSetBits (FbStip *bits, int stride, FbStip data);
n >>= FB_SHIFT; \ n >>= FB_SHIFT; \
} }
#ifdef FBNOPIXADDR
#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) FbMaskBits(x,w,l,n,r)
#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
*dst = FbDoMaskRRop(*dst,and,xor,l); \
}
#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \
*dst = FbDoMaskRRop(*dst,and,xor,r); \
}
#else
#define FbByteMaskInvalid 0x10 #define FbByteMaskInvalid 0x10
@ -454,7 +434,6 @@ extern _X_EXPORT void fbSetBits (FbStip *bits, int stride, FbStip data);
WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \ WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \
} \ } \
} }
#endif
#define FbMaskStip(x,w,l,n,r) { \ #define FbMaskStip(x,w,l,n,r) { \
n = (w); \ n = (w); \
@ -612,9 +591,6 @@ fbGetWinPrivateKey (void);
extern _X_EXPORT const GCOps fbGCOps; extern _X_EXPORT const GCOps fbGCOps;
extern _X_EXPORT const GCFuncs fbGCFuncs; extern _X_EXPORT const GCFuncs fbGCFuncs;
#ifdef FB_24_32BIT
#define FB_SCREEN_PRIVATE
#endif
/* Framebuffer access wrapper */ /* Framebuffer access wrapper */
typedef FbBits (*ReadMemoryProcPtr)(const void *src, int size); typedef FbBits (*ReadMemoryProcPtr)(const void *src, int size);
@ -642,7 +618,6 @@ typedef void (*FinishWrapProcPtr)(DrawablePtr pDraw);
#endif #endif
#ifdef FB_SCREEN_PRIVATE
extern _X_EXPORT DevPrivateKey extern _X_EXPORT DevPrivateKey
fbGetScreenPrivateKey(void); fbGetScreenPrivateKey(void);
@ -658,7 +633,6 @@ typedef struct {
#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \ #define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey())) dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey()))
#endif
/* private field of GC */ /* private field of GC */
typedef struct { typedef struct {
@ -1223,7 +1197,6 @@ fbBltOne (FbStip *src,
FbBits bgand, FbBits bgand,
FbBits bgxor); FbBits bgxor);
#ifdef FB_24BIT
extern _X_EXPORT void extern _X_EXPORT void
fbBltOne24 (FbStip *src, fbBltOne24 (FbStip *src,
FbStride srcStride, /* FbStip units per scanline */ FbStride srcStride, /* FbStip units per scanline */
@ -1240,7 +1213,6 @@ fbBltOne24 (FbStip *src,
FbBits fgxor, FbBits fgxor,
FbBits bgand, FbBits bgand,
FbBits bgxor); FbBits bgxor);
#endif
extern _X_EXPORT void extern _X_EXPORT void
fbBltPlane (FbBits *src, fbBltPlane (FbBits *src,
@ -1868,7 +1840,6 @@ fbSolid (FbBits *dst,
FbBits and, FbBits and,
FbBits xor); FbBits xor);
#ifdef FB_24BIT
extern _X_EXPORT void extern _X_EXPORT void
fbSolid24 (FbBits *dst, fbSolid24 (FbBits *dst,
FbStride dstStride, FbStride dstStride,
@ -1879,7 +1850,6 @@ fbSolid24 (FbBits *dst,
FbBits and, FbBits and,
FbBits xor); FbBits xor);
#endif
/* /*
* fbstipple.c * fbstipple.c

View File

@ -26,11 +26,9 @@
#include "fb.h" #include "fb.h"
#ifdef FB_SCREEN_PRIVATE
static DevPrivateKeyRec fbScreenPrivateKeyRec; static DevPrivateKeyRec fbScreenPrivateKeyRec;
DevPrivateKey DevPrivateKey
fbGetScreenPrivateKey(void) { return &fbScreenPrivateKeyRec; } fbGetScreenPrivateKey(void) { return &fbScreenPrivateKeyRec; }
#endif
static DevPrivateKeyRec fbGCPrivateKeyRec; static DevPrivateKeyRec fbGCPrivateKeyRec;
DevPrivateKey DevPrivateKey
@ -48,10 +46,8 @@ fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey)
if (!dixRegisterPrivateKey(&fbGCPrivateKeyRec, PRIVATE_GC, sizeof(FbGCPrivRec))) if (!dixRegisterPrivateKey(&fbGCPrivateKeyRec, PRIVATE_GC, sizeof(FbGCPrivRec)))
return FALSE; return FALSE;
#ifdef FB_SCREEN_PRIVATE
if (!dixRegisterPrivateKey(&fbScreenPrivateKeyRec, PRIVATE_SCREEN, sizeof (FbScreenPrivRec))) if (!dixRegisterPrivateKey(&fbScreenPrivateKeyRec, PRIVATE_SCREEN, sizeof (FbScreenPrivRec)))
return FALSE; return FALSE;
#endif
if (!dixRegisterPrivateKey(&fbWinPrivateKeyRec, PRIVATE_WINDOW, 0)) if (!dixRegisterPrivateKey(&fbWinPrivateKeyRec, PRIVATE_WINDOW, 0))
return FALSE; return FALSE;

View File

@ -47,7 +47,6 @@ fbPolyArc (DrawablePtr pDrawable,
if (pGC->lineWidth == 0) if (pGC->lineWidth == 0)
{ {
#ifndef FBNOPIXADDR
arc = 0; arc = 0;
if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid) if (pGC->lineStyle == LineSolid && pGC->fillStyle == FillSolid)
{ {
@ -55,9 +54,7 @@ fbPolyArc (DrawablePtr pDrawable,
{ {
case 8: arc = fbArc8; break; case 8: arc = fbArc8; break;
case 16: arc = fbArc16; break; case 16: arc = fbArc16; break;
#ifdef FB_24BIT
case 24: arc = fbArc24; break; case 24: arc = fbArc24; break;
#endif
case 32: arc = fbArc32; break; case 32: arc = fbArc32; break;
} }
} }
@ -141,7 +138,6 @@ fbPolyArc (DrawablePtr pDrawable,
#endif #endif
} }
else else
#endif
miZeroPolyArc (pDrawable, pGC, narcs, parcs); miZeroPolyArc (pDrawable, pGC, narcs, parcs);
} }
else else

View File

@ -89,7 +89,6 @@
#undef BITS4 #undef BITS4
#endif #endif
#ifdef FB_24BIT
#define BRESSOLID fbBresSolid24 #define BRESSOLID fbBresSolid24
#define BRESDASH fbBresDash24 #define BRESDASH fbBresDash24
#define DOTS fbDots24 #define DOTS fbDots24
@ -147,7 +146,6 @@
#undef ARC #undef ARC
#undef POLYLINE #undef POLYLINE
#undef POLYSEGMENT #undef POLYSEGMENT
#endif /* FB_24BIT */
#define BRESSOLID fbBresSolid32 #define BRESSOLID fbBresSolid32
#define BRESDASH fbBresDash32 #define BRESDASH fbBresDash32

View File

@ -67,14 +67,12 @@ fbBlt (FbBits *srcLine,
int startbyte, endbyte; int startbyte, endbyte;
FbDeclareMergeRop (); FbDeclareMergeRop ();
#ifdef FB_24BIT
if (bpp == 24 && !FbCheck24Pix (pm)) if (bpp == 24 && !FbCheck24Pix (pm))
{ {
fbBlt24 (srcLine, srcStride, srcX, dstLine, dstStride, dstX, fbBlt24 (srcLine, srcStride, srcX, dstLine, dstStride, dstX,
width, height, alu, pm, reverse, upsidedown); width, height, alu, pm, reverse, upsidedown);
return; return;
} }
#endif
if (alu == GXcopy && pm == FB_ALLONES && !reverse && if (alu == GXcopy && pm == FB_ALLONES && !reverse &&
!(srcX & 7) && !(dstX & 7) && !(width & 7)) { !(srcX & 7) && !(dstX & 7) && !(width & 7)) {
@ -338,7 +336,6 @@ fbBlt (FbBits *srcLine,
} }
} }
#ifdef FB_24BIT
#undef DEBUG_BLT24 #undef DEBUG_BLT24
#ifdef DEBUG_BLT24 #ifdef DEBUG_BLT24
@ -603,7 +600,6 @@ fbBlt24 (FbBits *srcLine,
ErrorF ("\n"); ErrorF ("\n");
#endif #endif
} }
#endif /* FB_24BIT */
#if FB_SHIFT == FB_STIP_SHIFT + 1 #if FB_SHIFT == FB_STIP_SHIFT + 1
@ -784,7 +780,6 @@ fbBltOdd (FbBits *srcLine,
} }
} }
#ifdef FB_24BIT
void void
fbBltOdd24 (FbBits *srcLine, fbBltOdd24 (FbBits *srcLine,
FbStride srcStrideEven, FbStride srcStrideEven,
@ -826,7 +821,6 @@ fbBltOdd24 (FbBits *srcLine,
} }
} }
} }
#endif
#endif #endif
@ -915,7 +909,6 @@ fbBltStip (FbStip *src,
&dstStrideEven, &dstStrideOdd, &dstStrideEven, &dstStrideOdd,
&dstXEven, &dstXOdd); &dstXEven, &dstXOdd);
#ifdef FB_24BIT
if (bpp == 24 && !FbCheck24Pix (pm)) if (bpp == 24 && !FbCheck24Pix (pm))
{ {
fbBltOdd24 (s, srcStrideEven, srcStrideOdd, fbBltOdd24 (s, srcStrideEven, srcStrideOdd,
@ -927,7 +920,6 @@ fbBltStip (FbStip *src,
width, height, alu, pm); width, height, alu, pm);
} }
else else
#endif
{ {
fbBltOdd (s, srcStrideEven, srcStrideOdd, fbBltOdd (s, srcStrideEven, srcStrideOdd,
srcXEven, srcXOdd, srcXEven, srcXOdd,

View File

@ -57,7 +57,6 @@
bits = (src < srcEnd ? READ(src++) : 0); \ bits = (src < srcEnd ? READ(src++) : 0); \
} }
#ifndef FBNOPIXADDR
#define LaneCases1(n,a) case n: FbLaneCase(n,a); break #define LaneCases1(n,a) case n: FbLaneCase(n,a); break
#define LaneCases2(n,a) LaneCases1(n,a); LaneCases1(n+1,a) #define LaneCases2(n,a) LaneCases1(n,a); LaneCases1(n+1,a)
@ -128,7 +127,6 @@ CARD8 *fbLaneTable[33] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
fb32Lane fb32Lane
}; };
#endif
void void
fbBltOne (FbStip *src, fbBltOne (FbStip *src,
@ -164,12 +162,9 @@ fbBltOne (FbStip *src,
Bool transparent; /* accelerate 0 nop */ Bool transparent; /* accelerate 0 nop */
int srcinc; /* source units consumed */ int srcinc; /* source units consumed */
Bool endNeedsLoad = FALSE; /* need load for endmask */ Bool endNeedsLoad = FALSE; /* need load for endmask */
#ifndef FBNOPIXADDR
CARD8 *fbLane; CARD8 *fbLane;
#endif
int startbyte, endbyte; int startbyte, endbyte;
#ifdef FB_24BIT
if (dstBpp == 24) if (dstBpp == 24)
{ {
fbBltOne24 (src, srcStride, srcX, fbBltOne24 (src, srcStride, srcX,
@ -178,7 +173,6 @@ fbBltOne (FbStip *src,
fgand, fgxor, bgand, bgxor); fgand, fgxor, bgand, bgxor);
return; return;
} }
#endif
/* /*
* Do not read past the end of the buffer! * Do not read past the end of the buffer!
@ -238,11 +232,9 @@ fbBltOne (FbStip *src,
fbBits = 0; /* unused */ fbBits = 0; /* unused */
if (pixelsPerDst <= 8) if (pixelsPerDst <= 8)
fbBits = fbStippleTable[pixelsPerDst]; fbBits = fbStippleTable[pixelsPerDst];
#ifndef FBNOPIXADDR
fbLane = 0; fbLane = 0;
if (transparent && fgand == 0 && dstBpp >= 8) if (transparent && fgand == 0 && dstBpp >= 8)
fbLane = fbLaneTable[dstBpp]; fbLane = fbLaneTable[dstBpp];
#endif
/* /*
* Compute total number of destination words written, but * Compute total number of destination words written, but
@ -302,13 +294,11 @@ fbBltOne (FbStip *src,
else else
#endif #endif
mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)]; mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
#ifndef FBNOPIXADDR
if (fbLane) if (fbLane)
{ {
fbTransparentSpan (dst, mask & startmask, fgxor, 1); fbTransparentSpan (dst, mask & startmask, fgxor, 1);
} }
else else
#endif
{ {
if (mask || !transparent) if (mask || !transparent)
FbDoLeftMaskByteStippleRRop (dst, mask, FbDoLeftMaskByteStippleRRop (dst, mask,
@ -343,7 +333,6 @@ fbBltOne (FbStip *src,
} }
else else
{ {
#ifndef FBNOPIXADDR
if (fbLane) if (fbLane)
{ {
while (bits && n) while (bits && n)
@ -358,7 +347,6 @@ fbBltOne (FbStip *src,
dst += n; dst += n;
} }
else else
#endif
{ {
while (n--) while (n--)
{ {
@ -400,13 +388,11 @@ fbBltOne (FbStip *src,
else else
#endif #endif
mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)]; mask = fbBits[FbLeftStipBits(bits,pixelsPerDst)];
#ifndef FBNOPIXADDR
if (fbLane) if (fbLane)
{ {
fbTransparentSpan (dst, mask & endmask, fgxor, 1); fbTransparentSpan (dst, mask & endmask, fgxor, 1);
} }
else else
#endif
{ {
if (mask || !transparent) if (mask || !transparent)
FbDoRightMaskByteStippleRRop (dst, mask, FbDoRightMaskByteStippleRRop (dst, mask,
@ -419,7 +405,6 @@ fbBltOne (FbStip *src,
} }
} }
#ifdef FB_24BIT
/* /*
* Crufty macros to initialize the mask array, most of this * Crufty macros to initialize the mask array, most of this
@ -747,7 +732,6 @@ fbBltOne24 (FbStip *srcLine,
} }
} }
} }
#endif
/* /*
* Not very efficient, but simple -- copy a single plane * Not very efficient, but simple -- copy a single plane
@ -801,7 +785,6 @@ fbBltPlane (FbBits *src,
w = width / srcBpp; w = width / srcBpp;
pm = fbReplicatePixel (planeMask, srcBpp); pm = fbReplicatePixel (planeMask, srcBpp);
#ifdef FB_24BIT
if (srcBpp == 24) if (srcBpp == 24)
{ {
int w = 24; int w = 24;
@ -812,7 +795,6 @@ fbBltPlane (FbBits *src,
srcMaskFirst = FbRot24(pm,rot0) & FbBitsMask(srcX,w); srcMaskFirst = FbRot24(pm,rot0) & FbBitsMask(srcX,w);
} }
else else
#endif
{ {
rot0 = 0; rot0 = 0;
srcMaskFirst = pm & FbBitsMask(srcX, srcBpp); srcMaskFirst = pm & FbBitsMask(srcX, srcBpp);
@ -828,10 +810,8 @@ fbBltPlane (FbBits *src,
src += srcStride; src += srcStride;
srcMask = srcMaskFirst; srcMask = srcMaskFirst;
#ifdef FB_24BIT
if (srcBpp == 24) if (srcBpp == 24)
srcMask0 = FbRot24(pm,rot0) & FbBitsMask(0, srcBpp); srcMask0 = FbRot24(pm,rot0) & FbBitsMask(0, srcBpp);
#endif
srcBits = READ(s++); srcBits = READ(s++);
dstMask = dstMaskFirst; dstMask = dstMaskFirst;
@ -845,10 +825,8 @@ fbBltPlane (FbBits *src,
if (!srcMask) if (!srcMask)
{ {
srcBits = READ(s++); srcBits = READ(s++);
#ifdef FB_24BIT
if (srcBpp == 24) if (srcBpp == 24)
srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0,24); srcMask0 = FbNext24Pix(srcMask0) & FbBitsMask(0,24);
#endif
srcMask = srcMask0; srcMask = srcMask0;
} }
if (!dstMask) if (!dstMask)

View File

@ -335,11 +335,9 @@ fbCopyArea (DrawablePtr pSrcDrawable,
{ {
miCopyProc copy; miCopyProc copy;
#ifdef FB_24_32BIT
if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel) if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel)
copy = fb24_32CopyMtoN; copy = fb24_32CopyMtoN;
else else
#endif
copy = fbCopyNtoN; copy = fbCopyNtoN;
return miDoCopy (pSrcDrawable, pDstDrawable, pGC, xIn, yIn, return miDoCopy (pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
widthSrc, heightSrc, xOut, yOut, copy, 0, 0); widthSrc, heightSrc, xOut, yOut, copy, 0, 0);

View File

@ -206,7 +206,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
miComputeCompositeClip (pGC, pDrawable); miComputeCompositeClip (pGC, pDrawable);
} }
#ifdef FB_24_32BIT
if (pPriv->bpp != pDrawable->bitsPerPixel) if (pPriv->bpp != pDrawable->bitsPerPixel)
{ {
changes |= GCStipple|GCForeground|GCBackground|GCPlaneMask; changes |= GCStipple|GCForeground|GCBackground|GCPlaneMask;
@ -240,7 +239,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
} }
} }
} }
#endif
if (changes & GCTile) if (changes & GCTile)
{ {
if (!pGC->tileIsPixel && if (!pGC->tileIsPixel &&

View File

@ -47,13 +47,11 @@ fbGetSpans(DrawablePtr pDrawable,
if (!fbDrawableEnabled(pDrawable)) if (!fbDrawableEnabled(pDrawable))
return; return;
#ifdef FB_24_32BIT
if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth))
{ {
fb24_32GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pchardstStart); fb24_32GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pchardstStart);
return; return;
} }
#endif
fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);

View File

@ -57,8 +57,6 @@ fbGlyphIn (RegionPtr pRegion,
return RegionContainsRect(pRegion, &box) == rgnIN; return RegionContainsRect(pRegion, &box) == rgnIN;
} }
#ifdef FB_24BIT
#ifndef FBNOPIXADDR
#define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg) #define WRITE1(d,n,fg) WRITE((d) + (n), (CARD8) fg)
#define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg) #define WRITE2(d,n,fg) WRITE((CARD16 *) &(d[n]), (CARD16) fg)
@ -248,8 +246,6 @@ fbGlyph24 (FbBits *dstBits,
dstLine += dstStride; dstLine += dstStride;
} }
} }
#endif
#endif
void void
fbPolyGlyphBlt (DrawablePtr pDrawable, fbPolyGlyphBlt (DrawablePtr pDrawable,
@ -266,7 +262,6 @@ fbPolyGlyphBlt (DrawablePtr pDrawable,
int gx, gy; int gx, gy;
int gWidth, gHeight; /* width and height of glyph */ int gWidth, gHeight; /* width and height of glyph */
FbStride gStride; /* stride of glyph */ FbStride gStride; /* stride of glyph */
#ifndef FBNOPIXADDR
void (*glyph) (FbBits *, void (*glyph) (FbBits *,
FbStride, FbStride,
int, int,
@ -286,13 +281,10 @@ fbPolyGlyphBlt (DrawablePtr pDrawable,
switch (dstBpp) { switch (dstBpp) {
case 8: glyph = fbGlyph8; break; case 8: glyph = fbGlyph8; break;
case 16: glyph = fbGlyph16; break; case 16: glyph = fbGlyph16; break;
#ifdef FB_24BIT
case 24: glyph = fbGlyph24; break; case 24: glyph = fbGlyph24; break;
#endif
case 32: glyph = fbGlyph32; break; case 32: glyph = fbGlyph32; break;
} }
} }
#endif
x += pDrawable->x; x += pDrawable->x;
y += pDrawable->y; y += pDrawable->y;
@ -306,7 +298,6 @@ fbPolyGlyphBlt (DrawablePtr pDrawable,
{ {
gx = x + pci->metrics.leftSideBearing; gx = x + pci->metrics.leftSideBearing;
gy = y - pci->metrics.ascent; gy = y - pci->metrics.ascent;
#ifndef FBNOPIXADDR
if (glyph && gWidth <= sizeof (FbStip) * 8 && if (glyph && gWidth <= sizeof (FbStip) * 8 &&
fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
{ {
@ -321,7 +312,6 @@ fbPolyGlyphBlt (DrawablePtr pDrawable,
fbFinishAccess (pDrawable); fbFinishAccess (pDrawable);
} }
else else
#endif
{ {
gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip); gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
fbPushImage (pDrawable, fbPushImage (pDrawable,
@ -359,7 +349,6 @@ fbImageGlyphBlt (DrawablePtr pDrawable,
Bool opaque; Bool opaque;
int n; int n;
int gx, gy; int gx, gy;
#ifndef FBNOPIXADDR
void (*glyph) (FbBits *, void (*glyph) (FbBits *,
FbStride, FbStride,
int, int,
@ -379,21 +368,16 @@ fbImageGlyphBlt (DrawablePtr pDrawable,
switch (dstBpp) { switch (dstBpp) {
case 8: glyph = fbGlyph8; break; case 8: glyph = fbGlyph8; break;
case 16: glyph = fbGlyph16; break; case 16: glyph = fbGlyph16; break;
#ifdef FB_24BIT
case 24: glyph = fbGlyph24; break; case 24: glyph = fbGlyph24; break;
#endif
case 32: glyph = fbGlyph32; break; case 32: glyph = fbGlyph32; break;
} }
} }
#endif
x += pDrawable->x; x += pDrawable->x;
y += pDrawable->y; y += pDrawable->y;
if (TERMINALFONT (pGC->font) if (TERMINALFONT (pGC->font)
#ifndef FBNOPIXADDR
&& !glyph && !glyph
#endif
) )
{ {
opaque = TRUE; opaque = TRUE;
@ -439,7 +423,6 @@ fbImageGlyphBlt (DrawablePtr pDrawable,
{ {
gx = x + pci->metrics.leftSideBearing; gx = x + pci->metrics.leftSideBearing;
gy = y - pci->metrics.ascent; gy = y - pci->metrics.ascent;
#ifndef FBNOPIXADDR
if (glyph && gWidth <= sizeof (FbStip) * 8 && if (glyph && gWidth <= sizeof (FbStip) * 8 &&
fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
{ {
@ -454,7 +437,6 @@ fbImageGlyphBlt (DrawablePtr pDrawable,
fbFinishAccess (pDrawable); fbFinishAccess (pDrawable);
} }
else else
#endif
{ {
gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip); gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
fbPutXYImage (pDrawable, fbPutXYImage (pDrawable,

View File

@ -86,7 +86,6 @@ fbPutImage (DrawablePtr pDrawable,
} }
break; break;
case ZPixmap: case ZPixmap:
#ifdef FB_24_32BIT
if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth))
{ {
srcStride = PixmapBytePad(w, pDrawable->depth); srcStride = PixmapBytePad(w, pDrawable->depth);
@ -99,7 +98,6 @@ fbPutImage (DrawablePtr pDrawable,
srcStride); srcStride);
} }
else else
#endif
{ {
srcStride = PixmapBytePad(w, pDrawable->depth) / sizeof (FbStip); srcStride = PixmapBytePad(w, pDrawable->depth) / sizeof (FbStip);
fbPutZImage (pDrawable, fbPutZImage (pDrawable,
@ -305,14 +303,12 @@ fbGetImage (DrawablePtr pDrawable,
if (!fbDrawableEnabled(pDrawable)) if (!fbDrawableEnabled(pDrawable))
return; return;
#ifdef FB_24_32BIT
if (format == ZPixmap && if (format == ZPixmap &&
pDrawable->bitsPerPixel != BitsPerPixel (pDrawable->depth)) pDrawable->bitsPerPixel != BitsPerPixel (pDrawable->depth))
{ {
fb24_32GetImage (pDrawable, x, y, w, h, format, planeMask, d); fb24_32GetImage (pDrawable, x, y, w, h, format, planeMask, d);
return; return;
} }
#endif
fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff); fbGetDrawable (pDrawable, src, srcStride, srcBpp, srcXoff, srcYoff);

View File

@ -114,7 +114,6 @@ fbPolyLine (DrawablePtr pDrawable,
if (pGC->lineWidth == 0) if (pGC->lineWidth == 0)
{ {
line = fbZeroLine; line = fbZeroLine;
#ifndef FBNOPIXADDR
if (pGC->fillStyle == FillSolid && if (pGC->fillStyle == FillSolid &&
pGC->lineStyle == LineSolid && pGC->lineStyle == LineSolid &&
RegionNumRects (fbGetCompositeClip(pGC)) == 1) RegionNumRects (fbGetCompositeClip(pGC)) == 1)
@ -122,13 +121,10 @@ fbPolyLine (DrawablePtr pDrawable,
switch (pDrawable->bitsPerPixel) { switch (pDrawable->bitsPerPixel) {
case 8: line = fbPolyline8; break; case 8: line = fbPolyline8; break;
case 16: line = fbPolyline16; break; case 16: line = fbPolyline16; break;
#ifdef FB_24BIT
case 24: line = fbPolyline24; break; case 24: line = fbPolyline24; break;
#endif
case 32: line = fbPolyline32; break; case 32: line = fbPolyline32; break;
} }
} }
#endif
} }
else else
{ {
@ -151,7 +147,6 @@ fbPolySegment (DrawablePtr pDrawable,
if (pGC->lineWidth == 0) if (pGC->lineWidth == 0)
{ {
seg = fbZeroSegment; seg = fbZeroSegment;
#ifndef FBNOPIXADDR
if (pGC->fillStyle == FillSolid && if (pGC->fillStyle == FillSolid &&
pGC->lineStyle == LineSolid && pGC->lineStyle == LineSolid &&
RegionNumRects (fbGetCompositeClip(pGC)) == 1) RegionNumRects (fbGetCompositeClip(pGC)) == 1)
@ -159,13 +154,10 @@ fbPolySegment (DrawablePtr pDrawable,
switch (pDrawable->bitsPerPixel) { switch (pDrawable->bitsPerPixel) {
case 8: seg = fbPolySegment8; break; case 8: seg = fbPolySegment8; break;
case 16: seg = fbPolySegment16; break; case 16: seg = fbPolySegment16; break;
#ifdef FB_24BIT
case 24: seg = fbPolySegment24; break; case 24: seg = fbPolySegment24; break;
#endif
case 32: seg = fbPolySegment32; break; case 32: seg = fbPolySegment32; break;
} }
} }
#endif
} }
else else
{ {

View File

@ -55,10 +55,8 @@ fbOverlayCreateWindow(WindowPtr pWin)
if (pWin->drawable.class != InputOutput) if (pWin->drawable.class != InputOutput)
return TRUE; return TRUE;
#ifdef FB_SCREEN_PRIVATE
if (pWin->drawable.bitsPerPixel == 32) if (pWin->drawable.bitsPerPixel == 32)
pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
#endif
for (i = 0; i < pScrPriv->nlayers; i++) for (i = 0; i < pScrPriv->nlayers; i++)
{ {
@ -349,7 +347,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
if (!pScrPriv) if (!pScrPriv)
return FALSE; return FALSE;
#ifdef FB_24_32BIT
if (bpp1 == 32 || bpp2 == 32) if (bpp1 == 32 || bpp2 == 32)
bpp = 32; bpp = 32;
else if (bpp1 == 24 || bpp2 == 24) else if (bpp1 == 24 || bpp2 == 24)
@ -374,8 +371,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
} }
} }
} }
#endif
#ifdef FB_SCREEN_PRIVATE
if (imagebpp == 32) if (imagebpp == 32)
{ {
fbGetScreenPrivate(pScreen)->win32bpp = bpp; fbGetScreenPrivate(pScreen)->win32bpp = bpp;
@ -386,7 +381,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
fbGetScreenPrivate(pScreen)->win32bpp = 32; fbGetScreenPrivate(pScreen)->win32bpp = 32;
fbGetScreenPrivate(pScreen)->pix32bpp = 32; fbGetScreenPrivate(pScreen)->pix32bpp = 32;
} }
#endif
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1, if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1,
&defaultVisual, ((unsigned long)1<<(bpp1-1)) | &defaultVisual, ((unsigned long)1<<(bpp1-1)) |
@ -421,13 +415,11 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
pScreen->CreateWindow = fbOverlayCreateWindow; pScreen->CreateWindow = fbOverlayCreateWindow;
pScreen->WindowExposures = fbOverlayWindowExposures; pScreen->WindowExposures = fbOverlayWindowExposures;
pScreen->CopyWindow = fbOverlayCopyWindow; pScreen->CopyWindow = fbOverlayCopyWindow;
#ifdef FB_24_32BIT
if (bpp == 24 && imagebpp == 32) if (bpp == 24 && imagebpp == 32)
{ {
pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader;
pScreen->CreateScreenResources = fb24_32OverlayCreateScreenResources; pScreen->CreateScreenResources = fb24_32OverlayCreateScreenResources;
} }
#endif
return TRUE; return TRUE;
} }

View File

@ -89,10 +89,8 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
{ {
int bpp; int bpp;
bpp = BitsPerPixel (depth); bpp = BitsPerPixel (depth);
#ifdef FB_SCREEN_PRIVATE
if (bpp == 32 && depth <= 24) if (bpp == 32 && depth <= 24)
bpp = fbGetScreenPrivate(pScreen)->pix32bpp; bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
#endif
return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint); return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint);
} }

View File

@ -75,7 +75,6 @@ fbDots (FbBits *dstOrig,
x = (x + xoff) * dstBpp; x = (x + xoff) * dstBpp;
d = dst + ((y + yoff) * dstStride) + (x >> FB_STIP_SHIFT); d = dst + ((y + yoff) * dstStride) + (x >> FB_STIP_SHIFT);
x &= FB_STIP_MASK; x &= FB_STIP_MASK;
#ifdef FB_24BIT
if (dstBpp == 24) if (dstBpp == 24)
{ {
FbStip leftMask, rightMask; FbStip leftMask, rightMask;
@ -97,7 +96,6 @@ fbDots (FbBits *dstOrig,
WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask)); WRITE(d, FbDoMaskRRop(READ(d), andT, xorT, rightMask));
} }
else else
#endif
{ {
FbStip mask; FbStip mask;
mask = FbStipMask(x, dstBpp); mask = FbStipMask(x, dstBpp);
@ -144,16 +142,12 @@ fbPolyPoint (DrawablePtr pDrawable,
and = pPriv->and; and = pPriv->and;
xor = pPriv->xor; xor = pPriv->xor;
dots = fbDots; dots = fbDots;
#ifndef FBNOPIXADDR
switch (dstBpp) { switch (dstBpp) {
case 8: dots = fbDots8; break; case 8: dots = fbDots8; break;
case 16: dots = fbDots16; break; case 16: dots = fbDots16; break;
#ifdef FB_24BIT
case 24: dots = fbDots24; break; case 24: dots = fbDots24; break;
#endif
case 32: dots = fbDots32; break; case 32: dots = fbDots32; break;
} }
#endif
for (nBox = RegionNumRects (pClip), pBox = RegionRects (pClip); for (nBox = RegionNumRects (pClip), pBox = RegionRects (pClip);
nBox--; pBox++) nBox--; pBox++)
(*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit, (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit,

View File

@ -185,7 +185,6 @@ fbFinishScreenInit(ScreenPtr pScreen,
* pixels. If you want real 24bit images, include a 24bpp * pixels. If you want real 24bit images, include a 24bpp
* format in the pixmap formats * format in the pixmap formats
*/ */
#ifdef FB_24_32BIT
if (bpp == 24) if (bpp == 24)
{ {
int f; int f;
@ -205,8 +204,6 @@ fbFinishScreenInit(ScreenPtr pScreen,
} }
} }
} }
#endif
#ifdef FB_SCREEN_PRIVATE
if (imagebpp == 32) if (imagebpp == 32)
{ {
fbGetScreenPrivate(pScreen)->win32bpp = bpp; fbGetScreenPrivate(pScreen)->win32bpp = bpp;
@ -220,7 +217,6 @@ fbFinishScreenInit(ScreenPtr pScreen,
#ifdef FB_ACCESS_WRAPPER #ifdef FB_ACCESS_WRAPPER
fbGetScreenPrivate(pScreen)->setupWrap = setupWrap; fbGetScreenPrivate(pScreen)->setupWrap = setupWrap;
fbGetScreenPrivate(pScreen)->finishWrap = finishWrap; fbGetScreenPrivate(pScreen)->finishWrap = finishWrap;
#endif
#endif #endif
rootdepth = 0; rootdepth = 0;
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth, if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
@ -236,13 +232,11 @@ fbFinishScreenInit(ScreenPtr pScreen,
return FALSE; return FALSE;
/* overwrite miCloseScreen with our own */ /* overwrite miCloseScreen with our own */
pScreen->CloseScreen = fbCloseScreen; pScreen->CloseScreen = fbCloseScreen;
#ifdef FB_24_32BIT
if (bpp == 24 && imagebpp == 32) if (bpp == 24 && imagebpp == 32)
{ {
pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader; pScreen->ModifyPixmapHeader = fb24_32ModifyPixmapHeader;
pScreen->CreateScreenResources = fb24_32CreateScreenResources; pScreen->CreateScreenResources = fb24_32CreateScreenResources;
} }
#endif
return TRUE; return TRUE;
} }

View File

@ -330,7 +330,6 @@ fbBresFillDash (DrawablePtr pDrawable,
fbSetFg (pDrawable, pGC, fg); fbSetFg (pDrawable, pGC, fg);
} }
#ifdef FB_24BIT
static void static void
fbBresSolid24RRop (DrawablePtr pDrawable, fbBresSolid24RRop (DrawablePtr pDrawable,
GCPtr pGC, GCPtr pGC,
@ -507,7 +506,6 @@ fbBresDash24RRop (DrawablePtr pDrawable,
fbFinishAccess (pDrawable); fbFinishAccess (pDrawable);
} }
#endif
/* /*
* For drivers that want to bail drawing some lines, this * For drivers that want to bail drawing some lines, this
@ -529,23 +527,17 @@ fbSelectBres (DrawablePtr pDrawable,
if (pGC->fillStyle == FillSolid) if (pGC->fillStyle == FillSolid)
{ {
bres = fbBresSolid; bres = fbBresSolid;
#ifdef FB_24BIT
if (dstBpp == 24) if (dstBpp == 24)
bres = fbBresSolid24RRop; bres = fbBresSolid24RRop;
#endif
#ifndef FBNOPIXADDR
if (pPriv->and == 0) if (pPriv->and == 0)
{ {
switch (dstBpp) { switch (dstBpp) {
case 8: bres = fbBresSolid8; break; case 8: bres = fbBresSolid8; break;
case 16: bres = fbBresSolid16; break; case 16: bres = fbBresSolid16; break;
#ifdef FB_24BIT
case 24: bres = fbBresSolid24; break; case 24: bres = fbBresSolid24; break;
#endif
case 32: bres = fbBresSolid32; break; case 32: bres = fbBresSolid32; break;
} }
} }
#endif
} }
} }
else else
@ -554,24 +546,18 @@ fbSelectBres (DrawablePtr pDrawable,
if (pGC->fillStyle == FillSolid) if (pGC->fillStyle == FillSolid)
{ {
bres = fbBresDash; bres = fbBresDash;
#ifdef FB_24BIT
if (dstBpp == 24) if (dstBpp == 24)
bres = fbBresDash24RRop; bres = fbBresDash24RRop;
#endif
#ifndef FBNOPIXADDR
if (pPriv->and == 0 && if (pPriv->and == 0 &&
(pGC->lineStyle == LineOnOffDash || pPriv->bgand == 0)) (pGC->lineStyle == LineOnOffDash || pPriv->bgand == 0))
{ {
switch (dstBpp) { switch (dstBpp) {
case 8: bres = fbBresDash8; break; case 8: bres = fbBresDash8; break;
case 16: bres = fbBresDash16; break; case 16: bres = fbBresDash16; break;
#ifdef FB_24BIT
case 24: bres = fbBresDash24; break; case 24: bres = fbBresDash24; break;
#endif
case 32: bres = fbBresDash32; break; case 32: bres = fbBresDash32; break;
} }
} }
#endif
} }
} }
return bres; return bres;

View File

@ -46,13 +46,11 @@ fbSetSpans (DrawablePtr pDrawable,
int xoff; int xoff;
int x1, x2; int x1, x2;
#ifdef FB_24_32BIT
if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth)) if (pDrawable->bitsPerPixel != BitsPerPixel(pDrawable->depth))
{ {
fb24_32SetSpans (pDrawable, pGC, src, ppt, pwidth, nspans, fSorted); fb24_32SetSpans (pDrawable, pGC, src, ppt, pwidth, nspans, fSorted);
return; return;
} }
#endif
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
while (nspans--) while (nspans--)
{ {

View File

@ -44,13 +44,11 @@ fbSolid (FbBits *dst,
int n, nmiddle; int n, nmiddle;
int startbyte, endbyte; int startbyte, endbyte;
#ifdef FB_24BIT
if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor))) if (bpp == 24 && (!FbCheck24Pix(and) || !FbCheck24Pix(xor)))
{ {
fbSolid24 (dst, dstStride, dstX, width, height, and, xor); fbSolid24 (dst, dstStride, dstX, width, height, and, xor);
return; return;
} }
#endif
dst += dstX >> FB_SHIFT; dst += dstX >> FB_SHIFT;
dstX &= FB_MASK; dstX &= FB_MASK;
FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte, FbMaskBitsBytes(dstX, width, and == 0, startmask, startbyte,
@ -81,7 +79,6 @@ fbSolid (FbBits *dst,
} }
} }
#ifdef FB_24BIT
void void
fbSolid24 (FbBits *dst, fbSolid24 (FbBits *dst,
FbStride dstStride, FbStride dstStride,
@ -210,4 +207,3 @@ fbSolid24 (FbBits *dst,
dst += dstStride; dst += dstStride;
} }
} }
#endif

View File

@ -26,7 +26,6 @@
#include "fb.h" #include "fb.h"
#ifndef FBNOPIXADDR
/* /*
* This is a slight abuse of the preprocessor to generate repetitive * This is a slight abuse of the preprocessor to generate repetitive
* code, the idea is to generate code for each case of a copy-mode * code, the idea is to generate code for each case of a copy-mode
@ -78,7 +77,6 @@ fbTransparentSpan (FbBits *dst,
LaneCases(dst); LaneCases(dst);
} }
} }
#endif
void void
fbEvenStipple (FbBits *dst, fbEvenStipple (FbBits *dst,
@ -170,7 +168,6 @@ fbEvenStipple (FbBits *dst,
and = (fgand & mask) | (bgand & ~mask); and = (fgand & mask) | (bgand & ~mask);
xor = (fgxor & mask) | (bgxor & ~mask); xor = (fgxor & mask) | (bgxor & ~mask);
#ifndef FBNOPIXADDR
if (transparent) if (transparent)
{ {
if (startmask) if (startmask)
@ -184,7 +181,6 @@ fbEvenStipple (FbBits *dst,
fbTransparentSpan(dst, mask&endmask, fgxor, 1); fbTransparentSpan(dst, mask&endmask, fgxor, 1);
} }
else else
#endif
{ {
/* /*
* Fill scanline * Fill scanline

View File

@ -33,10 +33,8 @@ fbCreateWindow(WindowPtr pWin)
{ {
dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(),
fbGetScreenPixmap(pWin->drawable.pScreen)); fbGetScreenPixmap(pWin->drawable.pScreen));
#ifdef FB_SCREEN_PRIVATE
if (pWin->drawable.bitsPerPixel == 32) if (pWin->drawable.bitsPerPixel == 32)
pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp; pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
#endif
return TRUE; return TRUE;
} }
@ -148,55 +146,36 @@ fbCopyWindow(WindowPtr pWin,
fbValidateDrawable (&pWin->drawable); fbValidateDrawable (&pWin->drawable);
} }
static void
fbFixupWindowPixmap(DrawablePtr pDrawable, PixmapPtr *ppPixmap)
{
PixmapPtr pPixmap = *ppPixmap;
if (pPixmap->drawable.bitsPerPixel != pDrawable->bitsPerPixel)
{
pPixmap = fb24_32ReformatTile (pPixmap, pDrawable->bitsPerPixel);
if (!pPixmap)
return;
(*pDrawable->pScreen->DestroyPixmap) (*ppPixmap);
*ppPixmap = pPixmap;
}
if (FbEvenTile (pPixmap->drawable.width *
pPixmap->drawable.bitsPerPixel))
fbPadPixmap (pPixmap);
}
Bool Bool
fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
{ {
PixmapPtr pPixmap;
if (mask & CWBackPixmap) if (mask & CWBackPixmap)
{ {
if (pWin->backgroundState == BackgroundPixmap) if (pWin->backgroundState == BackgroundPixmap)
{ fbFixupWindowPixmap(&pWin->drawable, &pWin->background.pixmap);
pPixmap = pWin->background.pixmap;
#ifdef FB_24_32BIT
if (pPixmap->drawable.bitsPerPixel != pWin->drawable.bitsPerPixel)
{
pPixmap = fb24_32ReformatTile (pPixmap,
pWin->drawable.bitsPerPixel);
if (pPixmap)
{
(*pWin->drawable.pScreen->DestroyPixmap) (pWin->background.pixmap);
pWin->background.pixmap = pPixmap;
}
}
#endif
if (FbEvenTile (pPixmap->drawable.width *
pPixmap->drawable.bitsPerPixel))
fbPadPixmap (pPixmap);
}
} }
if (mask & CWBorderPixmap) if (mask & CWBorderPixmap)
{ {
if (pWin->borderIsPixel == FALSE) if (pWin->borderIsPixel == FALSE)
{ fbFixupWindowPixmap(&pWin->drawable, &pWin->border.pixmap);
pPixmap = pWin->border.pixmap;
#ifdef FB_24_32BIT
if (pPixmap->drawable.bitsPerPixel !=
pWin->drawable.bitsPerPixel)
{
pPixmap = fb24_32ReformatTile (pPixmap,
pWin->drawable.bitsPerPixel);
if (pPixmap)
{
(*pWin->drawable.pScreen->DestroyPixmap) (pWin->border.pixmap);
pWin->border.pixmap = pPixmap;
}
}
#endif
if (FbEvenTile (pPixmap->drawable.width *
pPixmap->drawable.bitsPerPixel))
fbPadPixmap (pPixmap);
}
} }
return TRUE; return TRUE;
} }

View File

@ -11,7 +11,6 @@ AM_CFLAGS = \
@XLIB_CFLAGS@ \ @XLIB_CFLAGS@ \
@LIBDRM_CFLAGS@ \ @LIBDRM_CFLAGS@ \
@DRIPROTO_CFLAGS@ \ @DRIPROTO_CFLAGS@ \
-DXFree86Server \
@GLX_DEFINES@ \ @GLX_DEFINES@ \
@GLX_ARCH_DEFINES@ @GLX_ARCH_DEFINES@
@ -41,7 +40,6 @@ glapi_sources = \
indirect_table.c \ indirect_table.c \
dispatch.h \ dispatch.h \
glapitable.h \ glapitable.h \
glapitemp.h \
glapi.c \ glapi.c \
glapi.h \ glapi.h \
glapioffsets.h \ glapioffsets.h \

View File

@ -22,46 +22,21 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
/* /*
* This file manages the OpenGL API dispatch layer. * This file manages the OpenGL API dispatch layer. There are functions
* The dispatch table (struct _glapi_table) is basically just a list * to set/get the current dispatch table for the current thread and to
* of function pointers. * manage registration/dispatch of dynamically added extension functions.
* There are functions to set/get the current dispatch table for the
* current thread and to manage registration/dispatch of dynamically
* added extension functions.
* *
* It's intended that this file and the other glapi*.[ch] files are * This code was originally general enough to be shared with Mesa, but
* flexible enough to be reused in several places: XFree86, DRI- * they diverged long ago, so this is now just enough support to make
* based libGL.so, and perhaps the SGI SI. * indirect GLX work.
*
* NOTE: There are no dependencies on Mesa in this code.
*
* Versions (API changes):
* 2000/02/23 - original version for Mesa 3.3 and XFree86 4.0
* 2001/01/16 - added dispatch override feature for Mesa 3.5
* 2002/06/28 - added _glapi_set_warning_func(), Mesa 4.1.
* 2002/10/01 - _glapi_get_proc_address() will now generate new entrypoints
* itself (using offset ~0). _glapi_add_entrypoint() can be
* called afterward and it'll fill in the correct dispatch
* offset. This allows DRI libGL to avoid probing for DRI
* drivers! No changes to the public glapi interface.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#include <X11/Xfuncproto.h> #include <X11/Xfuncproto.h>
#include <os.h>
#define PUBLIC _X_EXPORT #define PUBLIC _X_EXPORT
#else
#include "glheader.h"
#endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef DEBUG #ifdef DEBUG
@ -72,91 +47,10 @@
#include "glapioffsets.h" #include "glapioffsets.h"
#include "glapitable.h" #include "glapitable.h"
/***** BEGIN NO-OP DISPATCH *****/
static GLboolean WarnFlag = GL_FALSE;
static _glapi_warning_func warning_func;
#if defined(PTHREADS) || defined(GLX_USE_TLS) #if defined(PTHREADS) || defined(GLX_USE_TLS)
static void init_glapi_relocs(void); static void init_glapi_relocs(void);
#endif #endif
static _glapi_proc generate_entrypoint(GLuint functionOffset);
static void fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset);
/*
* Enable/disable printing of warning messages.
*/
PUBLIC void
_glapi_noop_enable_warnings(GLboolean enable)
{
WarnFlag = enable;
}
/*
* Register a callback function for reporting errors.
*/
PUBLIC void
_glapi_set_warning_func( _glapi_warning_func func )
{
warning_func = func;
}
static GLboolean
warn(void)
{
if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG"))
&& warning_func) {
return GL_TRUE;
}
else {
return GL_FALSE;
}
}
#if defined(__GNUC__) && (__GNUC__ > 2)
#define possibly_unused __attribute((unused))
#else
#define possibly_unused
#endif
#define KEYWORD1 static
#define KEYWORD1_ALT static
#define KEYWORD2 GLAPIENTRY possibly_unused
#define NAME(func) NoOp##func
#define F NULL
#define DISPATCH(func, args, msg) \
if (warn()) { \
warning_func(NULL, "GL User Error: called without context: %s", #func); \
}
#define RETURN_DISPATCH(func, args, msg) \
if (warn()) { \
warning_func(NULL, "GL User Error: called without context: %s", #func); \
} \
return 0
#define DISPATCH_TABLE_NAME __glapi_noop_table
#define UNUSED_TABLE_NAME __unused_noop_functions
#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name
static GLint NoOpUnused(void)
{
if (warn()) {
warning_func(NULL, "GL User Error: calling extension function without a current context\n");
}
return 0;
}
#include "glapitemp.h"
/***** END NO-OP DISPATCH *****/
/** /**
* \name Current dispatch and current context control variables * \name Current dispatch and current context control variables
* *
@ -184,11 +78,10 @@ static GLint NoOpUnused(void)
/*@{*/ /*@{*/
#if defined(GLX_USE_TLS) #if defined(GLX_USE_TLS)
PUBLIC __thread struct _glapi_table * _glapi_tls_Dispatch PUBLIC TLS struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec"))) __attribute__((tls_model("initial-exec"))) = NULL;
= (struct _glapi_table *) __glapi_noop_table;
PUBLIC __thread void * _glapi_tls_Context PUBLIC TLS void * _glapi_tls_Context
__attribute__((tls_model("initial-exec"))); __attribute__((tls_model("initial-exec")));
PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL; PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL;
@ -212,30 +105,12 @@ void FreeAllTSD(void)
#endif /* defined(THREADS) */ #endif /* defined(THREADS) */
PUBLIC struct _glapi_table *_glapi_Dispatch = PUBLIC struct _glapi_table *_glapi_Dispatch = NULL;
(struct _glapi_table *) __glapi_noop_table;
PUBLIC void *_glapi_Context = NULL; PUBLIC void *_glapi_Context = NULL;
#endif /* defined(GLX_USE_TLS) */ #endif /* defined(GLX_USE_TLS) */
/*@}*/ /*@}*/
/**
* strdup() is actually not a standard ANSI C or POSIX routine.
* Irix will not define it if ANSI mode is in effect.
*/
static char *
str_dup(const char *str)
{
char *copy;
copy = (char*) malloc(strlen(str) + 1);
if (!copy)
return NULL;
strcpy(copy, str);
return copy;
}
/* /*
* xserver's gl is not multithreaded, we promise. * xserver's gl is not multithreaded, we promise.
*/ */
@ -252,7 +127,6 @@ _glapi_check_multithread(void)
PUBLIC void PUBLIC void
_glapi_set_context(void *context) _glapi_set_context(void *context)
{ {
(void) __unused_noop_functions; /* silence a warning */
#if defined(GLX_USE_TLS) #if defined(GLX_USE_TLS)
_glapi_tls_Context = context; _glapi_tls_Context = context;
#elif defined(THREADS) #elif defined(THREADS)
@ -284,8 +158,6 @@ _glapi_get_context(void)
/** /**
* Set the global or per-thread dispatch table pointer. * Set the global or per-thread dispatch table pointer.
* If the dispatch parameter is NULL we'll plug in the no-op dispatch
* table (__glapi_noop_table).
*/ */
PUBLIC void PUBLIC void
_glapi_set_dispatch(struct _glapi_table *dispatch) _glapi_set_dispatch(struct _glapi_table *dispatch)
@ -295,11 +167,6 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
pthread_once( & once_control, init_glapi_relocs ); pthread_once( & once_control, init_glapi_relocs );
#endif #endif
if (!dispatch) {
/* use the no-op functions */
dispatch = (struct _glapi_table *) __glapi_noop_table;
}
#if defined(GLX_USE_TLS) #if defined(GLX_USE_TLS)
_glapi_tls_Dispatch = dispatch; _glapi_tls_Dispatch = dispatch;
#elif defined(THREADS) #elif defined(THREADS)
@ -344,9 +211,6 @@ _glapi_get_dispatch(void)
# endif # endif
#endif #endif
#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer)
# define NEED_FUNCTION_POINTER
#endif
/* The code in this file is auto-generated with Python */ /* The code in this file is auto-generated with Python */
#include "glprocs.h" #include "glprocs.h"
@ -385,46 +249,6 @@ get_static_proc_offset(const char *funcName)
} }
#if !defined(XFree86Server) && !defined(XGLServer)
#ifdef USE_X86_ASM
#if defined( GLX_USE_TLS )
extern GLubyte gl_dispatch_functions_start[];
extern GLubyte gl_dispatch_functions_end[];
#else
extern const GLubyte gl_dispatch_functions_start[];
#endif
#endif /* USE_X86_ASM */
/**
* Return dispatch function address for the named static (built-in) function.
* Return NULL if function not found.
*/
static _glapi_proc
get_static_proc_address(const char *funcName)
{
const glprocs_table_t * const f = find_entry( funcName );
if (f) {
#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING)
return (f->Address == NULL)
? (_glapi_proc) (gl_dispatch_functions_start
+ (DISPATCH_FUNCTION_SIZE * f->Offset))
: f->Address;
#elif defined(DISPATCH_FUNCTION_SIZE)
return (_glapi_proc) (gl_dispatch_functions_start
+ (DISPATCH_FUNCTION_SIZE * f->Offset));
#else
return f->Address;
#endif
}
else {
return NULL;
}
}
#endif /* !defined(XFree86Server) && !defined(XGLServer) */
/********************************************************************** /**********************************************************************
* Extension function management. * Extension function management.
@ -454,7 +278,6 @@ struct _glapi_function {
*/ */
const char * name; const char * name;
/** /**
* Text string that describes the types of the parameters passed to the * Text string that describes the types of the parameters passed to the
* named function. Parameter types are converted to characters using the * named function. Parameter types are converted to characters using the
@ -466,164 +289,17 @@ struct _glapi_function {
*/ */
const char * parameter_signature; const char * parameter_signature;
/** /**
* Offset in the dispatch table where the pointer to the real function is * Offset in the dispatch table where the pointer to the real function is
* located. If the driver has not requested that the named function be * located. If the driver has not requested that the named function be
* added to the dispatch table, this will have the value ~0. * added to the dispatch table, this will have the value ~0.
*/ */
unsigned dispatch_offset; unsigned dispatch_offset;
/**
* Pointer to the dispatch stub for the named function.
*
* \todo
* The semantic of this field should be changed slightly. Currently, it
* is always expected to be non-\c NULL. However, it would be better to
* only allocate the entry-point stub when the application requests the
* function via \c glXGetProcAddress. This would save memory for all the
* functions that the driver exports but that the application never wants
* to call.
*/
_glapi_proc dispatch_stub;
}; };
static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS];
static GLuint NumExtEntryPoints = 0; static GLuint NumExtEntryPoints = 0;
#ifdef USE_SPARC_ASM
extern void __glapi_sparc_icache_flush(unsigned int *);
#endif
/**
* Generate a dispatch function (entrypoint) which jumps through
* the given slot number (offset) in the current dispatch table.
* We need assembly language in order to accomplish this.
*/
static _glapi_proc
generate_entrypoint(GLuint functionOffset)
{
#if defined(USE_X86_ASM)
/* 32 is chosen as something of a magic offset. For x86, the dispatch
* at offset 32 is the first one where the offset in the
* "jmp OFFSET*4(%eax)" can't be encoded in a single byte.
*/
const GLubyte * const template_func = gl_dispatch_functions_start
+ (DISPATCH_FUNCTION_SIZE * 32);
GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE);
if ( code != NULL ) {
(void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE);
fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset );
}
return (_glapi_proc) code;
#elif defined(USE_SPARC_ASM)
#ifdef __arch64__
static const unsigned int insn_template[] = {
0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */
0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */
0x8410a000, /* or %g2, %ulo(_glapi_Dispatch), %g2 */
0x82106000, /* or %g1, %lo(_glapi_Dispatch), %g1 */
0x8528b020, /* sllx %g2, 32, %g2 */
0xc2584002, /* ldx [%g1 + %g2], %g1 */
0x05000000, /* sethi %hi(8 * glapioffset), %g2 */
0x8410a000, /* or %g2, %lo(8 * glapioffset), %g2 */
0xc6584002, /* ldx [%g1 + %g2], %g3 */
0x81c0c000, /* jmpl %g3, %g0 */
0x01000000 /* nop */
};
#else
static const unsigned int insn_template[] = {
0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */
0xc2006000, /* ld [%g1 + %lo(_glapi_Dispatch)], %g1 */
0xc6006000, /* ld [%g1 + %lo(4*glapioffset)], %g3 */
0x81c0c000, /* jmpl %g3, %g0 */
0x01000000 /* nop */
};
#endif /* __arch64__ */
unsigned int *code = (unsigned int *) malloc(sizeof(insn_template));
unsigned long glapi_addr = (unsigned long) &_glapi_Dispatch;
if (code) {
memcpy(code, insn_template, sizeof(insn_template));
#ifdef __arch64__
code[0] |= (glapi_addr >> (32 + 10));
code[1] |= ((glapi_addr & 0xffffffff) >> 10);
__glapi_sparc_icache_flush(&code[0]);
code[2] |= ((glapi_addr >> 32) & ((1 << 10) - 1));
code[3] |= (glapi_addr & ((1 << 10) - 1));
__glapi_sparc_icache_flush(&code[2]);
code[6] |= ((functionOffset * 8) >> 10);
code[7] |= ((functionOffset * 8) & ((1 << 10) - 1));
__glapi_sparc_icache_flush(&code[6]);
#else
code[0] |= (glapi_addr >> 10);
code[1] |= (glapi_addr & ((1 << 10) - 1));
__glapi_sparc_icache_flush(&code[0]);
code[2] |= (functionOffset * 4);
__glapi_sparc_icache_flush(&code[2]);
#endif /* __arch64__ */
}
return (_glapi_proc) code;
#else
(void) functionOffset;
return NULL;
#endif /* USE_*_ASM */
}
/**
* This function inserts a new dispatch offset into the assembly language
* stub that was generated with the preceeding function.
*/
static void
fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset)
{
#if defined(USE_X86_ASM)
GLubyte * const code = (GLubyte *) entrypoint;
#if DISPATCH_FUNCTION_SIZE == 32
*((unsigned int *)(code + 11)) = 4 * offset;
*((unsigned int *)(code + 22)) = 4 * offset;
#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS )
*((unsigned int *)(code + 8)) = 4 * offset;
#elif DISPATCH_FUNCTION_SIZE == 16
*((unsigned int *)(code + 7)) = 4 * offset;
#else
# error Invalid DISPATCH_FUNCTION_SIZE!
#endif
#elif defined(USE_SPARC_ASM)
/* XXX this hasn't been tested! */
unsigned int *code = (unsigned int *) entrypoint;
#ifdef __arch64__
code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */
code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */
code[6] |= ((offset * 8) >> 10);
code[7] |= ((offset * 8) & ((1 << 10) - 1));
__glapi_sparc_icache_flush(&code[6]);
#else /* __arch64__ */
code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */
code[2] |= (offset * 4);
__glapi_sparc_icache_flush(&code[2]);
#endif /* __arch64__ */
#else
/* an unimplemented architecture */
(void) entrypoint;
(void) offset;
#endif /* USE_*_ASM */
}
/** /**
* Generate new entrypoint * Generate new entrypoint
* *
@ -643,16 +319,12 @@ add_function_name( const char * funcName )
struct _glapi_function * entry = NULL; struct _glapi_function * entry = NULL;
if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) {
_glapi_proc entrypoint = generate_entrypoint(~0); entry = &ExtEntryTable[NumExtEntryPoints];
if (entrypoint != NULL) {
entry = & ExtEntryTable[NumExtEntryPoints];
ExtEntryTable[NumExtEntryPoints].name = str_dup(funcName); ExtEntryTable[NumExtEntryPoints].name = strdup(funcName);
ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL;
ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0;
ExtEntryTable[NumExtEntryPoints].dispatch_stub = entrypoint; NumExtEntryPoints++;
NumExtEntryPoints++;
}
} }
return entry; return entry;
@ -721,14 +393,13 @@ _glapi_add_dispatch( const char * const * function_names,
int new_offset; int new_offset;
(void) memset( is_static, 0, sizeof( is_static ) ); (void) memset(is_static, 0, sizeof(is_static));
(void) memset( entry, 0, sizeof( entry ) ); (void) memset(entry, 0, sizeof(entry));
for ( i = 0 ; function_names[i] != NULL ; i++ ) { for (i = 0 ; function_names[i] != NULL ; i++) {
/* Do some trivial validation on the name of the function. /* Do some trivial validation on the name of the function. */
*/
if (!function_names[i] || function_names[i][0] != 'g' || function_names[i][1] != 'l') if (function_names[i][0] != 'g' || function_names[i][1] != 'l')
return GL_FALSE; return GL_FALSE;
/* Determine if the named function already exists. If the function does /* Determine if the named function already exists. If the function does
@ -742,7 +413,7 @@ _glapi_add_dispatch( const char * const * function_names,
* FIXME: the parameter signature for static functions? * FIXME: the parameter signature for static functions?
*/ */
if ( (offset != ~0) && (new_offset != offset) ) { if ((offset != ~0) && (new_offset != offset)) {
return -1; return -1;
} }
@ -750,20 +421,17 @@ _glapi_add_dispatch( const char * const * function_names,
offset = new_offset; offset = new_offset;
} }
for (j = 0; j < NumExtEntryPoints; j++) {
for ( j = 0 ; j < NumExtEntryPoints ; j++ ) {
if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) {
/* The offset may be ~0 if the function name was added by /* The offset may be ~0 if the function name was added by
* glXGetProcAddress but never filled in by the driver. * glXGetProcAddress but never filled in by the driver.
*/ */
if (ExtEntryTable[j].dispatch_offset != ~0) { if (ExtEntryTable[j].dispatch_offset != ~0) {
if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) != 0)
!= 0) {
return -1; return -1;
}
if ( (offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset) ) { if ((offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset)) {
return -1; return -1;
} }
@ -781,19 +449,15 @@ _glapi_add_dispatch( const char * const * function_names,
next_dynamic_offset++; next_dynamic_offset++;
} }
for ( i = 0 ; function_names[i] != NULL ; i++ ) { for (i = 0 ; function_names[i] != NULL ; i++) {
if (! is_static[i] ) { if (!is_static[i]) {
if (entry[i] == NULL) { if (entry[i] == NULL) {
entry[i] = add_function_name( function_names[i] ); entry[i] = add_function_name(function_names[i]);
if (entry[i] == NULL) { if (entry[i] == NULL)
/* FIXME: Possible memory leak here.
*/
return -1; return -1;
}
} }
entry[i]->parameter_signature = str_dup(real_sig); entry[i]->parameter_signature = strdup(real_sig);
fill_in_entrypoint_offset(entry[i]->dispatch_stub, offset);
entry[i]->dispatch_offset = offset; entry[i]->dispatch_offset = offset;
} }
} }
@ -801,43 +465,15 @@ _glapi_add_dispatch( const char * const * function_names,
return offset; return offset;
} }
/** /*
* Return pointer to the named function. If the function name isn't found * glXGetProcAddress doesn't exist in the protocol, the drivers never call
* in the name of static functions, try generating a new API entrypoint on * this themselves, and neither does the server. warn if it happens though.
* the fly with assembly language.
*/ */
_glapi_proc PUBLIC _glapi_proc
_glapi_get_proc_address(const char *funcName) _glapi_get_proc_address(const char *funcName)
{ {
struct _glapi_function * entry; ErrorF("_glapi_get_proc_address called!\n");
GLuint i; return NULL;
#ifdef MANGLE
if (funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l')
return NULL;
#else
if (funcName[0] != 'g' || funcName[1] != 'l')
return NULL;
#endif
/* search extension functions first */
for (i = 0; i < NumExtEntryPoints; i++) {
if (strcmp(ExtEntryTable[i].name, funcName) == 0) {
return ExtEntryTable[i].dispatch_stub;
}
}
#if !defined( XFree86Server ) && !defined( XGLServer )
/* search static functions */
{
const _glapi_proc func = get_static_proc_address(funcName);
if (func)
return func;
}
#endif /* !defined( XFree86Server ) */
entry = add_function_name(funcName);
return (entry == NULL) ? NULL : entry->dispatch_stub;
} }
/** /**

View File

@ -83,7 +83,7 @@ typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
const extern void *_glapi_Context; const extern void *_glapi_Context;
const extern struct _glapi_table *_glapi_Dispatch; const extern struct _glapi_table *_glapi_Dispatch;
extern __thread void * _glapi_tls_Context extern TLS void * _glapi_tls_Context
__attribute__((tls_model("initial-exec"))); __attribute__((tls_model("initial-exec")));
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context # define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
@ -106,12 +106,6 @@ extern struct _glapi_table *_glapi_Dispatch;
** GL API public functions ** GL API public functions
**/ **/
extern void
_glapi_noop_enable_warnings(GLboolean enable);
extern void
_glapi_set_warning_func(_glapi_warning_func func);
extern void extern void
_glapi_check_multithread(void); _glapi_check_multithread(void);

File diff suppressed because it is too large Load Diff

View File

@ -233,7 +233,7 @@ _glthread_SetTSD(_glthread_TSD *, void *);
#if defined(GLX_USE_TLS) #if defined(GLX_USE_TLS)
extern __thread struct _glapi_table * _glapi_tls_Dispatch extern TLS struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec"))); __attribute__((tls_model("initial-exec")));
#define GET_DISPATCH() _glapi_tls_Dispatch #define GET_DISPATCH() _glapi_tls_Dispatch

View File

@ -136,9 +136,9 @@ validGlxContext(ClientPtr client, XID id, int access_mode,
{ {
*err = dixLookupResourceByType((pointer *) context, id, *err = dixLookupResourceByType((pointer *) context, id,
__glXContextRes, client, access_mode); __glXContextRes, client, access_mode);
if (*err != Success) { if (*err != Success || (*context)->idExists == GL_FALSE) {
client->errorValue = id; client->errorValue = id;
if (*err == BadValue) if (*err == BadValue || *err == Success)
*err = __glXError(GLXBadContext); *err = __glXError(GLXBadContext);
return FALSE; return FALSE;
} }
@ -369,6 +369,7 @@ int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
return DoCreateContext(cl, req->context, req->shareList, return DoCreateContext(cl, req->context, req->shareList,
config, pGlxScreen, req->isDirect); config, pGlxScreen, req->isDirect);
} }
int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc) int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc)
{ {
ClientPtr client = cl->client; ClientPtr client = cl->client;
@ -382,77 +383,31 @@ int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc)
&glxc, &err)) &glxc, &err))
return err; return err;
FreeResourceByType(req->context, __glXContextRes, FALSE); glxc->idExists = GL_FALSE;
if (!glxc->isCurrent)
FreeResourceByType(req->context, __glXContextRes, FALSE);
return Success; return Success;
} }
/*****************************************************************************/
/* /*
** For each client, the server keeps a table of all the contexts that are * This will return "deleted" contexts, ie, where idExists is GL_FALSE.
** current for that client (each thread of a client may have its own current * Contrast validGlxContext, which will not. We're cheating here and
** context). These routines add, change, and lookup contexts in the table. * using the XID as the context tag, which is fine as long as we defer
*/ * actually destroying the context until it's no longer referenced, and
* block clients from trying to MakeCurrent on contexts that are on the
/* * way to destruction. Notice that DoMakeCurrent calls validGlxContext
** Add a current context, and return the tag that will be used to refer to it. * for new contexts but __glXLookupContextByTag for previous contexts.
*/ */
static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc)
{
int i;
int num = cl->numCurrentContexts;
__GLXcontext **table = cl->currentContexts;
if (!glxc) return -1;
/*
** Try to find an empty slot and use it.
*/
for (i=0; i < num; i++) {
if (!table[i]) {
table[i] = glxc;
return i+1;
}
}
/*
** Didn't find a free slot, so we'll have to grow the table.
*/
if (!num) {
table = (__GLXcontext **) malloc(sizeof(__GLXcontext *));
} else {
table = (__GLXcontext **) realloc(table,
(num+1)*sizeof(__GLXcontext *));
}
table[num] = glxc;
cl->currentContexts = table;
cl->numCurrentContexts++;
return num+1;
}
/*
** Given a tag, change the current context for the corresponding entry.
*/
static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc,
GLXContextTag tag)
{
__GLXcontext **table = cl->currentContexts;
table[tag-1] = glxc;
}
/*
** For this implementation we have chosen to simply use the index of the
** context's entry in the table as the context tag. A tag must be greater
** than 0.
*/
__GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag) __GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag)
{ {
int num = cl->numCurrentContexts; __GLXcontext *ret;
if (tag < 1 || tag > num) { if (dixLookupResourceByType((void **)&ret, tag, __glXContextRes,
return 0; cl->client, DixUseAccess) == Success)
} else { return ret;
return cl->currentContexts[tag-1];
} return NULL;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -466,7 +421,7 @@ static void StopUsingContext(__GLXcontext *glxc)
} }
glxc->isCurrent = GL_FALSE; glxc->isCurrent = GL_FALSE;
if (!glxc->idExists) { if (!glxc->idExists) {
__glXFreeContext(glxc); FreeResourceByType(glxc->id, __glXContextRes, FALSE);
} }
} }
} }
@ -631,10 +586,10 @@ DoMakeCurrent(__GLXclientState *cl,
/* /*
** Flush the previous context if needed. ** Flush the previous context if needed.
*/ */
if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) { if (prevglxc->hasUnflushedCommands) {
if (__glXForceCurrent(cl, tag, (int *)&error)) { if (__glXForceCurrent(cl, tag, (int *)&error)) {
CALL_Flush( GET_DISPATCH(), () ); CALL_Flush( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(prevglxc); prevglxc->hasUnflushedCommands = GL_FALSE;
} else { } else {
return error; return error;
} }
@ -669,16 +624,11 @@ DoMakeCurrent(__GLXclientState *cl,
glxc->isCurrent = GL_TRUE; glxc->isCurrent = GL_TRUE;
} }
if (prevglxc) { StopUsingContext(prevglxc);
ChangeCurrentContext(cl, glxc, tag);
StopUsingContext(prevglxc);
} else {
tag = AddCurrentContext(cl, glxc);
}
if (glxc) { if (glxc) {
StartUsingContext(cl, glxc); StartUsingContext(cl, glxc);
reply.contextTag = tag; reply.contextTag = glxc->id;
} else { } else {
reply.contextTag = 0; reply.contextTag = 0;
} }
@ -905,7 +855,7 @@ int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc)
** in both streams are completed before the copy is executed. ** in both streams are completed before the copy is executed.
*/ */
CALL_Finish( GET_DISPATCH(), () ); CALL_Finish( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(tagcx); tagcx->hasUnflushedCommands = GL_FALSE;
} else { } else {
return error; return error;
} }
@ -1616,7 +1566,7 @@ int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
** in both streams are completed before the swap is executed. ** in both streams are completed before the swap is executed.
*/ */
CALL_Finish( GET_DISPATCH(), () ); CALL_Finish( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(glxc); glxc->hasUnflushedCommands = GL_FALSE;
} else { } else {
return error; return error;
} }
@ -1815,7 +1765,7 @@ int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
** in both streams are completed before the swap is executed. ** in both streams are completed before the swap is executed.
*/ */
CALL_Finish( GET_DISPATCH(), () ); CALL_Finish( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(glxc); glxc->hasUnflushedCommands = GL_FALSE;
} else { } else {
return error; return error;
} }
@ -2002,7 +1952,7 @@ int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
left -= cmdlen; left -= cmdlen;
commandsDone++; commandsDone++;
} }
__GLX_NOTE_UNFLUSHED_CMDS(glxc); glxc->hasUnflushedCommands = GL_TRUE;
return Success; return Success;
} }
@ -2199,7 +2149,7 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
** Skip over the header and execute the command. ** Skip over the header and execute the command.
*/ */
(*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
__GLX_NOTE_UNFLUSHED_CMDS(glxc); glxc->hasUnflushedCommands = GL_TRUE;
/* /*
** Reset for the next RenderLarge series. ** Reset for the next RenderLarge series.

View File

@ -53,8 +53,6 @@ struct __GLXcontext {
int (*copy) (__GLXcontext *dst, int (*copy) (__GLXcontext *dst,
__GLXcontext *src, __GLXcontext *src,
unsigned long mask); unsigned long mask);
int (*forceCurrent) (__GLXcontext *context);
Bool (*wait) (__GLXcontext *context, Bool (*wait) (__GLXcontext *context,
__GLXclientState *cl, __GLXclientState *cl,
int *error); int *error);

View File

@ -335,19 +335,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
src->driContext, mask); src->driContext, mask);
} }
static int
__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
static void static void
glxFillAlphaChannel (CARD32 *pixels, CARD32 rowstride, int width, int height) glxFillAlphaChannel (CARD32 *pixels, CARD32 rowstride, int width, int height)
{ {
@ -641,7 +628,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy; context->base.copy = __glXDRIcontextCopy;
context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
/* Find the requested X visual */ /* Find the requested X visual */

View File

@ -283,19 +283,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
src->driContext, mask); src->driContext, mask);
} }
static int
__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
static Bool static Bool
__glXDRIcontextWait(__GLXcontext *baseContext, __glXDRIcontextWait(__GLXcontext *baseContext,
__GLXclientState *cl, int *error) __GLXclientState *cl, int *error)
@ -411,7 +398,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy; context->base.copy = __glXDRIcontextCopy;
context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->base.wait = __glXDRIcontextWait; context->base.wait = __glXDRIcontextWait;

View File

@ -174,19 +174,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
src->driContext, mask); src->driContext, mask);
} }
static int
__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
{
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
return (*screen->core->bindContext)(context->driContext,
draw->driDrawable,
read->driDrawable);
}
#ifdef __DRI_TEX_BUFFER #ifdef __DRI_TEX_BUFFER
static int static int
@ -289,7 +276,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy; context->base.copy = __glXDRIcontextCopy;
context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->driContext = context->driContext =

View File

@ -50,7 +50,6 @@
** from the server's perspective. ** from the server's perspective.
*/ */
__GLXcontext *__glXLastContext; __GLXcontext *__glXLastContext;
__GLXcontext *__glXContextList;
/* /*
** X resources. ** X resources.
@ -66,11 +65,6 @@ xGLXSingleReply __glXReply;
static DevPrivateKeyRec glxClientPrivateKeyRec; static DevPrivateKeyRec glxClientPrivateKeyRec;
#define glxClientPrivateKey (&glxClientPrivateKeyRec) #define glxClientPrivateKey (&glxClientPrivateKeyRec)
/*
** Client that called into GLX dispatch.
*/
ClientPtr __pGlxClient;
/* /*
** Forward declarations. ** Forward declarations.
*/ */
@ -138,34 +132,15 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
for (c = glxAllContexts; c; c = next) { for (c = glxAllContexts; c; c = next) {
next = c->next; next = c->next;
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
int i;
(*c->loseCurrent)(c); (*c->loseCurrent)(c);
c->isCurrent = GL_FALSE; c->isCurrent = GL_FALSE;
if (c == __glXLastContext) if (c == __glXLastContext)
__glXFlushContextCache(); __glXFlushContextCache();
for (i = 1; i < currentMaxClients; i++) {
if (clients[i]) {
__GLXclientState *cl = glxGetClient(clients[i]);
if (cl->inUse) {
int j;
for (j = 0; j < cl->numCurrentContexts; j++) {
if (cl->currentContexts[j] == c)
cl->currentContexts[j] = NULL;
}
}
}
}
} }
if (c->drawPriv == glxPriv) if (c->drawPriv == glxPriv)
c->drawPriv = NULL; c->drawPriv = NULL;
if (c->readPriv == glxPriv) if (c->readPriv == glxPriv)
c->readPriv = NULL; c->readPriv = NULL;
if (!c->idExists && !c->isCurrent)
__glXFreeContext(c);
} }
glxPriv->destroy(glxPriv); glxPriv->destroy(glxPriv);
@ -283,8 +258,6 @@ glxClientCallback (CallbackListPtr *list,
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
ClientPtr pClient = clientinfo->client; ClientPtr pClient = clientinfo->client;
__GLXclientState *cl = glxGetClient(pClient); __GLXclientState *cl = glxGetClient(pClient);
__GLXcontext *cx;
int i;
switch (pClient->clientState) { switch (pClient->clientState) {
case ClientStateRunning: case ClientStateRunning:
@ -298,18 +271,8 @@ glxClientCallback (CallbackListPtr *list,
break; break;
case ClientStateGone: case ClientStateGone:
for (i = 0; i < cl->numCurrentContexts; i++) {
cx = cl->currentContexts[i];
if (cx) {
cx->isCurrent = GL_FALSE;
if (!cx->idExists)
__glXFreeContext(cx);
}
}
free(cl->returnBuf); free(cl->returnBuf);
free(cl->largeCmdBuf); free(cl->largeCmdBuf);
free(cl->currentContexts);
free(cl->GLClientextensions); free(cl->GLClientextensions);
break; break;
@ -422,7 +385,7 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
** See if the context tag is legal; it is managed by the extension, ** See if the context tag is legal; it is managed by the extension,
** so if it's invalid, we have an implementation error. ** so if it's invalid, we have an implementation error.
*/ */
cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag); cx = __glXLookupContextByTag(cl, tag);
if (!cx) { if (!cx) {
cl->client->errorValue = tag; cl->client->errorValue = tag;
*error = __glXError(GLXBadContextTag); *error = __glXError(GLXBadContextTag);
@ -451,7 +414,7 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
/* Make this context the current one for the GL. */ /* Make this context the current one for the GL. */
if (!cx->isDirect) { if (!cx->isDirect) {
if (!(*cx->forceCurrent)(cx)) { if (!(*cx->makeCurrent)(cx)) {
/* Bind failed, and set the error code. Bummer */ /* Bind failed, and set the error code. Bummer */
cl->client->errorValue = cx->id; cl->client->errorValue = cx->id;
*error = __glXError(GLXBadContextState); *error = __glXError(GLXBadContextState);
@ -571,15 +534,12 @@ static int __glXDispatch(ClientPtr client)
/* /*
** Use the opcode to index into the procedure table. ** Use the opcode to index into the procedure table.
*/ */
proc = (__GLXdispatchSingleProcPtr) __glXGetProtocolDecodeFunction(& Single_dispatch_info, proc = __glXGetProtocolDecodeFunction(& Single_dispatch_info, opcode,
opcode, client->swapped);
client->swapped);
if (proc != NULL) { if (proc != NULL) {
GLboolean rendering = opcode <= X_GLXRenderLarge; GLboolean rendering = opcode <= X_GLXRenderLarge;
__glXleaveServer(rendering); __glXleaveServer(rendering);
__pGlxClient = client;
retval = (*proc)(cl, (GLbyte *) stuff); retval = (*proc)(cl, (GLbyte *) stuff);
__glXenterServer(rendering); __glXenterServer(rendering);

View File

@ -96,18 +96,8 @@ void __glXScreenInitVisuals(__GLXscreen *screen);
extern __GLXcontext *__glXLastContext; extern __GLXcontext *__glXLastContext;
extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*); extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
extern ClientPtr __pGlxClient;
int __glXError(int error); int __glXError(int error);
/*
** Macros to set, unset, and retrieve the flag that says whether a context
** has unflushed commands.
*/
#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
/************************************************************************/ /************************************************************************/
typedef struct __GLXprovider __GLXprovider; typedef struct __GLXprovider __GLXprovider;
@ -158,13 +148,6 @@ struct __GLXclientStateRec {
GLbyte *largeCmdBuf; GLbyte *largeCmdBuf;
GLint largeCmdBufSize; GLint largeCmdBufSize;
/*
** Keep a list of all the contexts that are current for this client's
** threads.
*/
__GLXcontext **currentContexts;
GLint numCurrentContexts;
/* Back pointer to X client record */ /* Back pointer to X client record */
ClientPtr client; ClientPtr client;

View File

@ -72,7 +72,7 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
cx->feedbackBufSize = size; cx->feedbackBufSize = size;
} }
CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) ); CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) );
__GLX_NOTE_UNFLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_TRUE;
return Success; return Success;
} }
@ -100,7 +100,7 @@ int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
cx->selectBufSize = size; cx->selectBufSize = size;
} }
CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) ); CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) );
__GLX_NOTE_UNFLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_TRUE;
return Success; return Success;
} }
@ -213,7 +213,7 @@ int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc)
} }
CALL_Flush( GET_DISPATCH(), () ); CALL_Flush( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_FALSE;
return Success; return Success;
} }
@ -230,7 +230,7 @@ int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc)
/* Do a local glFinish */ /* Do a local glFinish */
CALL_Finish( GET_DISPATCH(), () ); CALL_Finish( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_FALSE;
/* Send empty reply packet to indicate finish is finished */ /* Send empty reply packet to indicate finish is finished */
client = cl->client; client = cl->client;

View File

@ -72,7 +72,7 @@ int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
cx->feedbackBufSize = size; cx->feedbackBufSize = size;
} }
CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) ); CALL_FeedbackBuffer( GET_DISPATCH(), (size, type, cx->feedbackBuf) );
__GLX_NOTE_UNFLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_TRUE;
return Success; return Success;
} }
@ -103,7 +103,7 @@ int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
cx->selectBufSize = size; cx->selectBufSize = size;
} }
CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) ); CALL_SelectBuffer( GET_DISPATCH(), (size, cx->selectBuf) );
__GLX_NOTE_UNFLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_TRUE;
return Success; return Success;
} }
@ -229,7 +229,7 @@ int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc)
} }
CALL_Flush( GET_DISPATCH(), () ); CALL_Flush( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_FALSE;
return Success; return Success;
} }
@ -248,7 +248,7 @@ int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc)
/* Do a local glFinish */ /* Do a local glFinish */
CALL_Finish( GET_DISPATCH(), () ); CALL_Finish( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_FALSE;
/* Send empty reply packet to indicate finish is finished */ /* Send empty reply packet to indicate finish is finished */
client = cl->client; client = cl->client;

View File

@ -91,7 +91,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
__GLX_SEND_HEADER(); __GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize); __GLX_SEND_VOID_ARRAY(compsize);
} }
__GLX_NOTE_FLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_FALSE;
return Success; return Success;
} }

View File

@ -102,7 +102,7 @@ int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
__GLX_SEND_HEADER(); __GLX_SEND_HEADER();
__GLX_SEND_VOID_ARRAY(compsize); __GLX_SEND_VOID_ARRAY(compsize);
} }
__GLX_NOTE_FLUSHED_CMDS(cx); cx->hasUnflushedCommands = GL_FALSE;
return Success; return Success;
} }

View File

@ -92,14 +92,6 @@ extern GLint __glXNumActiveScreens;
extern __GLXcontext *__glXLastContext; extern __GLXcontext *__glXLastContext;
extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*); extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
/*
** Macros to set, unset, and retrieve the flag that says whether a context
** has unflushed commands.
*/
#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
/************************************************************************/ /************************************************************************/
typedef struct { typedef struct {

View File

@ -91,95 +91,6 @@ static Bool kdCaughtSignal = FALSE;
KdOsFuncs *kdOsFuncs; KdOsFuncs *kdOsFuncs;
void
KdSetRootClip (ScreenPtr pScreen, BOOL enable)
{
WindowPtr pWin = pScreen->root;
WindowPtr pChild;
Bool WasViewable;
Bool anyMarked = FALSE;
WindowPtr pLayerWin;
BoxRec box;
if (!pWin)
return;
WasViewable = (Bool)(pWin->viewable);
if (WasViewable)
{
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
{
(void) (*pScreen->MarkOverlappedWindows)(pChild,
pChild,
&pLayerWin);
}
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
if (pWin->valdata)
{
if (HasBorder (pWin))
{
RegionPtr borderVisible;
borderVisible = RegionCreate(NullBox, 1);
RegionSubtract(borderVisible,
&pWin->borderClip, &pWin->winSize);
pWin->valdata->before.borderVisible = borderVisible;
}
pWin->valdata->before.resized = TRUE;
}
}
if (enable)
{
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
pWin->drawable.width = pScreen->width;
pWin->drawable.height = pScreen->height;
RegionInit(&pWin->winSize, &box, 1);
RegionInit(&pWin->borderSize, &box, 1);
RegionReset(&pWin->borderClip, &box);
RegionBreak(&pWin->clipList);
}
else
{
RegionEmpty(&pWin->borderClip);
RegionBreak(&pWin->clipList);
}
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
if (WasViewable)
{
if (pWin->firstChild)
{
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
pWin->firstChild,
(WindowPtr *)NULL);
}
else
{
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
}
if (anyMarked)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
if (WasViewable)
{
if (anyMarked)
(*pScreen->HandleExposures)(pWin);
if (anyMarked && pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
}
if (pWin->realized)
WindowsRestructured ();
}
void void
KdDisableScreen (ScreenPtr pScreen) KdDisableScreen (ScreenPtr pScreen)
{ {
@ -188,7 +99,7 @@ KdDisableScreen (ScreenPtr pScreen)
if (!pScreenPriv->enabled) if (!pScreenPriv->enabled)
return; return;
if (!pScreenPriv->closed) if (!pScreenPriv->closed)
KdSetRootClip (pScreen, FALSE); SetRootClip (pScreen, FALSE);
KdDisableColormap (pScreen); KdDisableColormap (pScreen);
if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->disableAccel) if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->disableAccel)
(*pScreenPriv->card->cfuncs->disableAccel) (pScreen); (*pScreenPriv->card->cfuncs->disableAccel) (pScreen);
@ -271,7 +182,7 @@ KdEnableScreen (ScreenPtr pScreen)
if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->enableAccel) if (!pScreenPriv->screen->dumb && pScreenPriv->card->cfuncs->enableAccel)
(*pScreenPriv->card->cfuncs->enableAccel) (pScreen); (*pScreenPriv->card->cfuncs->enableAccel) (pScreen);
KdEnableColormap (pScreen); KdEnableColormap (pScreen);
KdSetRootClip (pScreen, TRUE); SetRootClip (pScreen, TRUE);
if (pScreenPriv->card->cfuncs->dpms) if (pScreenPriv->card->cfuncs->dpms)
(*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState); (*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState);
return TRUE; return TRUE;

View File

@ -386,9 +386,6 @@ KdStoreColors (ColormapPtr pCmap, int ndef, xColorItem *pdefs);
/* kdrive.c */ /* kdrive.c */
extern miPointerScreenFuncRec kdPointerScreenFuncs; extern miPointerScreenFuncRec kdPointerScreenFuncs;
void
KdSetRootClip (ScreenPtr pScreen, BOOL enable);
void void
KdDisableScreen (ScreenPtr pScreen); KdDisableScreen (ScreenPtr pScreen);

View File

@ -982,106 +982,6 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen)
} }
} }
/*
* xf86SetRootClip --
* Enable or disable rendering to the screen by
* setting the root clip list and revalidating
* all of the windows
*/
static void
xf86SetRootClip (ScreenPtr pScreen, Bool enable)
{
WindowPtr pWin = pScreen->root;
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
Bool anyMarked = FALSE;
WindowPtr pLayerWin;
BoxRec box;
if (WasViewable)
{
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
{
(void) (*pScreen->MarkOverlappedWindows)(pChild,
pChild,
&pLayerWin);
}
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
if (pWin->valdata)
{
if (HasBorder (pWin))
{
RegionPtr borderVisible;
borderVisible = RegionCreate(NullBox, 1);
RegionSubtract(borderVisible,
&pWin->borderClip, &pWin->winSize);
pWin->valdata->before.borderVisible = borderVisible;
}
pWin->valdata->before.resized = TRUE;
}
}
/*
* Use REGION_BREAK to avoid optimizations in ValidateTree
* that assume the root borderClip can't change well, normally
* it doesn't...)
*/
if (enable)
{
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
RegionInit(&pWin->winSize, &box, 1);
RegionInit(&pWin->borderSize, &box, 1);
if (WasViewable)
RegionReset(&pWin->borderClip, &box);
pWin->drawable.width = pScreen->width;
pWin->drawable.height = pScreen->height;
RegionBreak(&pWin->clipList);
}
else
{
RegionEmpty(&pWin->borderClip);
RegionBreak(&pWin->clipList);
}
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
if (WasViewable)
{
if (pWin->firstChild)
{
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
pWin->firstChild,
(WindowPtr *)NULL);
}
else
{
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
}
if (anyMarked)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
if (WasViewable)
{
if (anyMarked)
(*pScreen->HandleExposures)(pWin);
if (anyMarked && pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
}
if (pWin->realized)
WindowsRestructured ();
FlushAllOutput ();
}
/* /*
* Function to enable/disable access to the frame buffer * Function to enable/disable access to the frame buffer
* *
@ -1115,7 +1015,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
* Restore all of the clip lists on the screen * Restore all of the clip lists on the screen
*/ */
if (!xf86Resetting) if (!xf86Resetting)
xf86SetRootClip (pScreen, TRUE); SetRootClip (pScreen, TRUE);
} }
else else
@ -1123,7 +1023,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
/* /*
* Empty all of the clip lists on the screen * Empty all of the clip lists on the screen
*/ */
xf86SetRootClip (pScreen, FALSE); SetRootClip (pScreen, FALSE);
} }
} }

View File

@ -1497,10 +1497,6 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
*stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp; *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp;
*X = (int)(pWin->drawable.x); *X = (int)(pWin->drawable.x);
*Y = (int)(pWin->drawable.y); *Y = (int)(pWin->drawable.y);
#if 0
*W = (int)(pWin->winSize.extents.x2 - pWin->winSize.extents.x1);
*H = (int)(pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
#endif
*W = (int)(pWin->drawable.width); *W = (int)(pWin->drawable.width);
*H = (int)(pWin->drawable.height); *H = (int)(pWin->drawable.height);
*numClipRects = RegionNumRects(&pWin->clipList); *numClipRects = RegionNumRects(&pWin->clipList);

View File

@ -1755,6 +1755,7 @@ xf86RandR12EnterVT (int screen_index, int flags)
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
rrScrPrivPtr rp = rrGetScrPriv(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen);
Bool ret; Bool ret;
int i;
if (randrp->orig_EnterVT) { if (randrp->orig_EnterVT) {
pScrn->EnterVT = randrp->orig_EnterVT; pScrn->EnterVT = randrp->orig_EnterVT;
@ -1766,7 +1767,6 @@ xf86RandR12EnterVT (int screen_index, int flags)
} }
/* reload gamma */ /* reload gamma */
int i;
for (i = 0; i < rp->numCrtcs; i++) for (i = 0; i < rp->numCrtcs; i++)
xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]); xf86RandR12CrtcSetGamma(pScreen, rp->crtcs[i]);

View File

@ -189,7 +189,7 @@ xf86parsePointerSection (void)
if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) { if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) {
Error (ZAXISMAPPING_MSG, NULL); Error (ZAXISMAPPING_MSG, NULL);
} }
if (asprintf(&s, "%ul %ul", val1, val.num) == -1) if (asprintf(&s, "%lu %u", val1, val.num) == -1)
s = NULL; s = NULL;
break; break;
case XAXIS: case XAXIS:

View File

@ -174,7 +174,6 @@ static __GLXdrawable * __glXAquaScreenCreateDrawable(ClientPtr client, __GLXscre
static void __glXAquaContextDestroy(__GLXcontext *baseContext); static void __glXAquaContextDestroy(__GLXcontext *baseContext);
static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext); static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext);
static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext); static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext);
static int __glXAquaContextForceCurrent(__GLXcontext *baseContext);
static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask); static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask);
static CGLPixelFormatObj makeFormat(__GLXconfig *conf); static CGLPixelFormatObj makeFormat(__GLXconfig *conf);
@ -235,7 +234,6 @@ __glXAquaScreenCreateContext(__GLXscreen *screen,
context->base.makeCurrent = __glXAquaContextMakeCurrent; context->base.makeCurrent = __glXAquaContextMakeCurrent;
context->base.loseCurrent = __glXAquaContextLoseCurrent; context->base.loseCurrent = __glXAquaContextLoseCurrent;
context->base.copy = __glXAquaContextCopy; context->base.copy = __glXAquaContextCopy;
context->base.forceCurrent = __glXAquaContextForceCurrent;
/*FIXME verify that the context->base is fully initialized. */ /*FIXME verify that the context->base is fully initialized. */
context->pixelFormat = makeFormat(conf); context->pixelFormat = makeFormat(conf);
@ -458,19 +456,6 @@ static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, un
return gl_err == 0; return gl_err == 0;
} }
static int __glXAquaContextForceCurrent(__GLXcontext *baseContext)
{
CGLError gl_err;
__GLXAquaContext *context = (__GLXAquaContext *) baseContext;
GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx %p)\n", context->ctx);
gl_err = CGLSetCurrentContext(context->ctx);
if (gl_err != 0)
ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
return gl_err == 0;
}
/* Drawing surface notification callbacks */ /* Drawing surface notification callbacks */
static GLboolean __glXAquaDrawableSwapBuffers(ClientPtr client, __GLXdrawable *base) { static GLboolean __glXAquaDrawableSwapBuffers(ClientPtr client, __GLXdrawable *base) {
CGLError err; CGLError err;
@ -681,17 +666,8 @@ GLuint __glFloorLog2(GLuint val)
return c; return c;
} }
void warn_func(void * p1, char *format, ...) {
va_list v;
va_start(v, format);
vfprintf(stderr, format, v);
va_end(v);
}
static void setup_dispatch_table(void) { static void setup_dispatch_table(void) {
struct _glapi_table *disp=_glapi_get_dispatch(); struct _glapi_table *disp=_glapi_get_dispatch();
_glapi_set_warning_func((_glapi_warning_func)warn_func);
_glapi_noop_enable_warnings(TRUE);
/* to update: /* to update:
* for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy * for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy

View File

@ -437,7 +437,7 @@ ProcAppleWMSetWindowLevel(register ClientPtr client)
DixReadAccess)) DixReadAccess))
return BadValue; return BadValue;
if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) { if (stuff->level >= AppleWMNumWindowLevels) {
return BadValue; return BadValue;
} }

View File

@ -767,113 +767,3 @@ void AbortDDX( void )
OsAbort(); OsAbort();
} }
#include "mivalidate.h" // for union _Validate used by windowstr.h
#include "windowstr.h" // for struct _Window
#include "scrnintstr.h" // for struct _Screen
// This is copied from Xserver/hw/xfree86/common/xf86Helper.c.
// Quartz mode uses this when switching in and out of Quartz.
// Quartz or IOKit can use this when waking from sleep.
// Copyright (c) 1997-1998 by The XFree86 Project, Inc.
/*
* xf86SetRootClip --
* Enable or disable rendering to the screen by
* setting the root clip list and revalidating
* all of the windows
*/
void
xf86SetRootClip (ScreenPtr pScreen, int enable)
{
WindowPtr pWin = pScreen->root;
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
Bool anyMarked = TRUE;
RegionPtr pOldClip = NULL;
WindowPtr pLayerWin;
BoxRec box;
if (WasViewable)
{
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
{
(void) (*pScreen->MarkOverlappedWindows)(pChild,
pChild,
&pLayerWin);
}
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
if (pWin->valdata)
{
if (HasBorder (pWin))
{
RegionPtr borderVisible;
borderVisible = RegionCreate(NullBox, 1);
RegionSubtract(borderVisible,
&pWin->borderClip, &pWin->winSize);
pWin->valdata->before.borderVisible = borderVisible;
}
pWin->valdata->before.resized = TRUE;
}
}
/*
* Use REGION_BREAK to avoid optimizations in ValidateTree
* that assume the root borderClip can't change well, normally
* it doesn't...)
*/
if (enable)
{
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
RegionReset(&pWin->borderClip, &box);
RegionBreak(&pWin->clipList);
}
else
{
RegionEmpty(&pWin->borderClip);
RegionBreak(&pWin->clipList);
}
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
if (WasViewable)
{
if (pWin->backStorage)
{
pOldClip = RegionCreate(NullBox, 1);
RegionCopy(pOldClip, &pWin->clipList);
}
if (pWin->firstChild)
{
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
pWin->firstChild,
(WindowPtr *)NULL);
}
else
{
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
}
if (anyMarked)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
if (WasViewable)
{
if (anyMarked)
(*pScreen->HandleExposures)(pWin);
if (anyMarked && pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
}
if (pWin->realized)
WindowsRestructured ();
FlushAllOutput ();
}

View File

@ -42,7 +42,6 @@
void DarwinPrintBanner(void); void DarwinPrintBanner(void);
int DarwinParseModifierList(const char *constmodifiers, int separatelr); int DarwinParseModifierList(const char *constmodifiers, int separatelr);
void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
void xf86SetRootClip (ScreenPtr pScreen, int enable);
#define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \ #define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \
dixLookupPrivate(&pScreen->devPrivates, darwinScreenKey)) dixLookupPrivate(&pScreen->devPrivates, darwinScreenKey))

View File

@ -442,7 +442,7 @@ void QuartzSetRootClip(
for (i = 0; i < screenInfo.numScreens; i++) { for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i]) { if (screenInfo.screens[i]) {
xf86SetRootClip(screenInfo.screens[i], enable); SetRootClip(screenInfo.screens[i], enable);
} }
} }
} }

View File

@ -53,4 +53,4 @@ const char *threadSafetyID(pthread_t tid);
#define TA_APPKIT() #define TA_APPKIT()
#endif #endif
#endif _XQ_THREAD_SAFETY_H_ #endif /* _XQ_THREAD_SAFETY_H_ */

View File

@ -326,7 +326,9 @@ xprAddScreen(int index, ScreenPtr pScreen)
#endif #endif
} }
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
have_depth: have_depth:
#endif
switch(depth) { switch(depth) {
case 8: // pseudo-working case 8: // pseudo-working
dfb->visuals = PseudoColorMask; dfb->visuals = PseudoColorMask;

View File

@ -859,7 +859,7 @@ glxWinDrawableDestroy(__GLXdrawable *base)
// on the next context change) // on the next context change)
// (GLX core considers it an error when we try to select a new current context if the old one // (GLX core considers it an error when we try to select a new current context if the old one
// has unflushed commands, but the window has disappeared..) // has unflushed commands, but the window has disappeared..)
__GLX_NOTE_FLUSHED_CMDS(__glXLastContext); __glXLastContext->hasUnflushedCommands = FALSE;
__glXLastContext = NULL; __glXLastContext = NULL;
} }
@ -1480,13 +1480,6 @@ glxWinContextCopy(__GLXcontext *dst_base, __GLXcontext *src_base, unsigned long
return ret; return ret;
} }
static int
glxWinContextForceCurrent(__GLXcontext *base)
{
/* wglMakeCurrent always flushes the previous context, so this is equivalent to glxWinContextMakeCurrent */
return glxWinContextMakeCurrent(base);
}
static void static void
glxWinContextDestroy(__GLXcontext *base) glxWinContextDestroy(__GLXcontext *base)
{ {
@ -1541,7 +1534,6 @@ glxWinCreateContext(__GLXscreen *screen,
context->base.makeCurrent = glxWinContextMakeCurrent; context->base.makeCurrent = glxWinContextMakeCurrent;
context->base.loseCurrent = glxWinContextLoseCurrent; context->base.loseCurrent = glxWinContextLoseCurrent;
context->base.copy = glxWinContextCopy; context->base.copy = glxWinContextCopy;
context->base.forceCurrent = glxWinContextForceCurrent;
context->base.textureFromPixmap = &glxWinTextureFromPixmap; context->base.textureFromPixmap = &glxWinTextureFromPixmap;
context->base.config = modes; context->base.config = modes;
context->base.pGlxScreen = screen; context->base.pGlxScreen = screen;

View File

@ -63,106 +63,6 @@ winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations)
return TRUE; return TRUE;
} }
/*
Copied from the xfree86 DDX
Why can't this be in DIX?
Does union _Validate vary depending on DDX??
*/
static void
xf86SetRootClip (ScreenPtr pScreen, Bool enable)
{
WindowPtr pWin = pScreen->root;
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
Bool anyMarked = FALSE;
WindowPtr pLayerWin;
BoxRec box;
if (WasViewable)
{
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
{
(void) (*pScreen->MarkOverlappedWindows)(pChild,
pChild,
&pLayerWin);
}
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
if (pWin->valdata)
{
if (HasBorder (pWin))
{
RegionPtr borderVisible;
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
REGION_SUBTRACT(pScreen, borderVisible,
&pWin->borderClip, &pWin->winSize);
pWin->valdata->before.borderVisible = borderVisible;
}
pWin->valdata->before.resized = TRUE;
}
}
/*
* Use REGION_BREAK to avoid optimizations in ValidateTree
* that assume the root borderClip can't change well, normally
* it doesn't...)
*/
if (enable)
{
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
REGION_INIT (pScreen, &pWin->winSize, &box, 1);
REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
if (WasViewable)
REGION_RESET(pScreen, &pWin->borderClip, &box);
pWin->drawable.width = pScreen->width;
pWin->drawable.height = pScreen->height;
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
}
else
{
REGION_EMPTY(pScreen, &pWin->borderClip);
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
}
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
if (WasViewable)
{
if (pWin->firstChild)
{
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
pWin->firstChild,
(WindowPtr *)NULL);
}
else
{
(*pScreen->MarkWindow) (pWin);
anyMarked = TRUE;
}
if (anyMarked)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
if (WasViewable)
{
if (anyMarked)
(*pScreen->HandleExposures)(pWin);
if (anyMarked && pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
}
if (pWin->realized)
WindowsRestructured ();
FlushAllOutput ();
}
/* /*
*/ */
@ -178,7 +78,7 @@ winDoRandRScreenSetSize (ScreenPtr pScreen,
WindowPtr pRoot = pScreen->root; WindowPtr pRoot = pScreen->root;
// Prevent screen updates while we change things around // Prevent screen updates while we change things around
xf86SetRootClip(pScreen, FALSE); SetRootClip(pScreen, FALSE);
/* Update the screen size as requested */ /* Update the screen size as requested */
pScreenInfo->dwWidth = width; pScreenInfo->dwWidth = width;
@ -205,7 +105,7 @@ winDoRandRScreenSetSize (ScreenPtr pScreen,
// does this emit a ConfigureNotify?? // does this emit a ConfigureNotify??
// Restore the ability to update screen, now with new dimensions // Restore the ability to update screen, now with new dimensions
xf86SetRootClip(pScreen, TRUE); SetRootClip(pScreen, TRUE);
// and arrange for it to be repainted // and arrange for it to be repainted
miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);

View File

@ -444,6 +444,9 @@
/* Define to 1 if you have the `ffs' function. */ /* Define to 1 if you have the `ffs' function. */
#undef HAVE_FFS #undef HAVE_FFS
/* If the compiler supports a TLS storage class define it to that here */
#undef TLS
/* Correctly set _XSERVER64 for OSX fat binaries */ /* Correctly set _XSERVER64 for OSX fat binaries */
#ifdef __APPLE__ #ifdef __APPLE__
#include "dix-config-apple-verbatim.h" #include "dix-config-apple-verbatim.h"

View File

@ -266,4 +266,5 @@ extern _X_EXPORT void DisableMapUnmapEvents(
extern _X_EXPORT void EnableMapUnmapEvents( extern _X_EXPORT void EnableMapUnmapEvents(
WindowPtr /* pWin */ ); WindowPtr /* pWin */ );
extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable);
#endif /* WINDOW_H */ #endif /* WINDOW_H */

View File

@ -140,10 +140,9 @@ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs)
/* Read the contents of /proc/pid/cmdline. It should contain the /* Read the contents of /proc/pid/cmdline. It should contain the
* process name and arguments. */ * process name and arguments. */
totsize = read(fd, path, sizeof(path)); totsize = read(fd, path, sizeof(path));
close(fd);
if (totsize <= 0) if (totsize <= 0)
return; return;
if (close(fd) < 0)
return;
path[totsize - 1] = '\0'; path[totsize - 1] = '\0';
/* Contruct the process name without arguments. */ /* Contruct the process name without arguments. */

View File

@ -1773,8 +1773,6 @@ CompositeTriStrip (CARD8 op,
int npoints, int npoints,
xPointFixed *points) xPointFixed *points)
{ {
ScreenPtr pScreen = pDst->pDrawable->pScreen;
PictureScreenPtr ps = GetPictureScreen(pScreen);
xTriangle *tris, *tri; xTriangle *tris, *tri;
int ntri; int ntri;
@ -1804,7 +1802,6 @@ CompositeTriFan (CARD8 op,
int npoints, int npoints,
xPointFixed *points) xPointFixed *points)
{ {
ScreenPtr pScreen = pDst->pDrawable->pScreen;
xTriangle *tris, *tri; xTriangle *tris, *tri;
xPointFixed *first; xPointFixed *first;
int ntri; int ntri;