mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-22 20:48:09 +02:00
Implement accelerated indirect rendering by loading DRI drivers directly.
Drop GLcore dependency from glx module.
Work around double destroy case and add DRIUnlockedCallback() function.
New files, lots of code coming from GL/mesa/X/xf86glx.c and the libGL
loader code.
This commit is contained in:
parent
c2dedf4d17
commit
b9fdfa1534
31 changed files with 1637 additions and 1764 deletions
33
ChangeLog
33
ChangeLog
|
|
@ -1,3 +1,36 @@
|
|||
2006-01-17 Kristian Høgsberg <krh@redhat.com>
|
||||
|
||||
* GL/Makefile.am:
|
||||
* GL/glx/Makefile.am:
|
||||
* GL/glx/glxcmds.c: (DoCreateContext), (DoMakeCurrent),
|
||||
(__glXCopyContext), (__glXSwapBuffers):
|
||||
* GL/glx/glxcontext.h:
|
||||
* GL/glx/glxdrawable.h:
|
||||
* GL/glx/glxext.c: (ResetExtension), (ContextGone),
|
||||
(__glXFreeContext), (GlxExtensionInit), (__glXCoreType),
|
||||
(__glXForceCurrent), (__glXCallDispatch), (__glXDispatch):
|
||||
* GL/glx/glxscreens.c: (DrawableGone), (__glXScreenInit):
|
||||
* GL/glx/glxscreens.h:
|
||||
* GL/glx/glxserver.h:
|
||||
* GL/glx/glxutil.c: (__glXCreateDrawablePrivate),
|
||||
(__glXDestroyDrawablePrivate), (__glXGetDrawablePrivate):
|
||||
* configure.ac: Implement accelerated indirect rendering by
|
||||
loading DRI drivers directly.
|
||||
|
||||
* hw/xfree86/dixmods/Makefile.am:
|
||||
* hw/xfree86/dixmods/glxmodule.c: Drop GLcore dependency from glx
|
||||
module.
|
||||
|
||||
* hw/xfree86/dri/dri.c:
|
||||
* hw/xfree86/dri/dri.h: Work around double destroy case and add
|
||||
DRIUnlockedCallback() function.
|
||||
|
||||
* GL/glx/glxloader.c:
|
||||
* GL/glx/glxloader.h:
|
||||
* GL/glx/glxvisuals.c:
|
||||
* GL/glx/glxvisuals.h: New files, lots of code coming from
|
||||
GL/mesa/X/xf86glx.c and the libGL loader code.
|
||||
|
||||
Thu Jan 12 17:09:18 2006 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* include/window.[ch]: Add new functions to enable and disable
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
SUBDIRS = glx mesa include
|
||||
SUBDIRS = glx include
|
||||
|
||||
# someone could get really crazy someday and add support for the SI...
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ AM_CFLAGS = \
|
|||
@DIX_CFLAGS@ \
|
||||
@GL_CFLAGS@ \
|
||||
@XLIB_CFLAGS@ \
|
||||
@LIBDRM_CFLAGS@ \
|
||||
@DRIPROTO_CFLAGS@ \
|
||||
-I@MESA_SOURCE@/include \
|
||||
-I@MESA_SOURCE@/src/mesa/glapi \
|
||||
-I@MESA_SOURCE@/src/mesa/main \
|
||||
|
|
@ -14,7 +16,12 @@ AM_CFLAGS = \
|
|||
# none yet
|
||||
#sdk_HEADERS =
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/GL/include -I$(top_srcdir)/hw/xfree86/os-support
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/GL/include \
|
||||
-I$(top_srcdir)/hw/xfree86/os-support \
|
||||
-I$(top_srcdir)/hw/xfree86/os-support/bus \
|
||||
-I$(top_srcdir)/hw/xfree86/common \
|
||||
-I$(top_srcdir)/hw/xfree86/dri
|
||||
|
||||
nodist_libglx_la_SOURCES = indirect_size.h
|
||||
|
||||
|
|
@ -28,8 +35,6 @@ libglx_la_SOURCES = \
|
|||
glcontextmodes.h \
|
||||
global.c \
|
||||
glthread.c \
|
||||
glxbuf.c \
|
||||
glxbuf.h \
|
||||
glxcmds.c \
|
||||
glxcmdsswap.c \
|
||||
glxcontext.h \
|
||||
|
|
@ -37,14 +42,10 @@ libglx_la_SOURCES = \
|
|||
glxerror.h \
|
||||
glxext.c \
|
||||
glxext.h \
|
||||
glxfb.c \
|
||||
glxfb.h \
|
||||
glximports.c \
|
||||
glximports.h \
|
||||
glxmem.c \
|
||||
glxmem.h \
|
||||
glxpix.c \
|
||||
glxpix.h \
|
||||
glxvisuals.c \
|
||||
glxvisuals.h \
|
||||
glxloader.c \
|
||||
glxloader.h \
|
||||
glxscreens.c \
|
||||
glxscreens.h \
|
||||
glxserver.h \
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <xf86.h>
|
||||
#include "glxserver.h"
|
||||
#include <GL/glxtokens.h>
|
||||
#include <unpack.h>
|
||||
|
|
@ -47,7 +48,6 @@
|
|||
#include <pixmapstr.h>
|
||||
#include <windowstr.h>
|
||||
#include "g_disptab_EXT.h"
|
||||
#include "glximports.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxext.h"
|
||||
#include "GL/glx_ansic.h"
|
||||
|
|
@ -59,24 +59,6 @@
|
|||
|
||||
/************************************************************************/
|
||||
|
||||
static __GLimports imports = {
|
||||
__glXImpMalloc,
|
||||
__glXImpCalloc,
|
||||
__glXImpRealloc,
|
||||
__glXImpFree,
|
||||
__glXImpWarning,
|
||||
__glXImpFatal,
|
||||
__glXImpGetenv,
|
||||
__glXImpAtoi,
|
||||
__glXImpSprintf,
|
||||
__glXImpFopen,
|
||||
__glXImpFclose,
|
||||
__glXImpFprintf,
|
||||
__glXImpGetDrawablePrivate,
|
||||
__glXImpGetReadablePrivate,
|
||||
NULL
|
||||
};
|
||||
|
||||
static int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
|
||||
static int __glXCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
|
||||
static int __glXCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
|
||||
|
|
@ -110,7 +92,7 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
|||
__GLXcontext *glxc, *shareglxc;
|
||||
__GLcontextModes *modes;
|
||||
__GLXscreenInfo *pGlxScreen;
|
||||
__GLinterface *shareGC;
|
||||
void *share;
|
||||
GLint i;
|
||||
|
||||
LEGAL_NEW_RESOURCE(gcId, client);
|
||||
|
|
@ -165,7 +147,7 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
|||
** for multithreaded servers, we don't do this.
|
||||
*/
|
||||
if (shareList == None) {
|
||||
shareGC = 0;
|
||||
share = 0;
|
||||
} else {
|
||||
shareglxc = (__GLXcontext *) LookupIDByType(shareList, __glXContextRes);
|
||||
if (!shareglxc) {
|
||||
|
|
@ -191,7 +173,7 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
|||
*/
|
||||
isDirect = GL_FALSE;
|
||||
}
|
||||
shareGC = shareglxc->gc;
|
||||
share = shareglxc->driContext.private;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -213,13 +195,11 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
|||
glxc->modes = modes;
|
||||
|
||||
if (!isDirect) {
|
||||
|
||||
/*
|
||||
** Allocate a GL context
|
||||
*/
|
||||
imports.other = (void *)glxc;
|
||||
glxc->gc = (*pGlxScreen->createContext)(&imports, glxc->modes, shareGC);
|
||||
if (!glxc->gc) {
|
||||
glxc->driContext.private =
|
||||
(*pGlxScreen->driScreen.createNewContext)(NULL, modes, 0,
|
||||
share,
|
||||
&glxc->driContext);
|
||||
if (glxc->driContext.private == NULL) {
|
||||
__glXFree(glxc);
|
||||
client->errorValue = gcId;
|
||||
return BadAlloc;
|
||||
|
|
@ -228,14 +208,15 @@ int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
|||
/*
|
||||
** Don't need local GL context for a direct context.
|
||||
*/
|
||||
glxc->gc = 0;
|
||||
glxc->driContext.private = NULL;
|
||||
}
|
||||
/*
|
||||
** Register this context as a resource.
|
||||
*/
|
||||
if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
|
||||
if (!isDirect) {
|
||||
(*glxc->gc->exports.destroyContext)((__GLcontext *)glxc->gc);
|
||||
(*glxc->driContext.destroyContext)(NULL, screen,
|
||||
glxc->driContext.private);
|
||||
}
|
||||
__glXFree(glxc);
|
||||
client->errorValue = gcId;
|
||||
|
|
@ -518,7 +499,6 @@ int DoMakeCurrent( __GLXclientState *cl,
|
|||
__GLXpixmap *drawPixmap = NULL;
|
||||
__GLXpixmap *readPixmap = NULL;
|
||||
__GLXcontext *glxc, *prevglxc;
|
||||
__GLinterface *gc, *prevgc;
|
||||
__GLXdrawablePrivate *drawPriv = NULL;
|
||||
__GLXdrawablePrivate *readPriv = NULL;
|
||||
GLint error;
|
||||
|
|
@ -552,10 +532,8 @@ int DoMakeCurrent( __GLXclientState *cl,
|
|||
client->errorValue = prevglxc->id;
|
||||
return __glXBadContextState;
|
||||
}
|
||||
prevgc = prevglxc->gc;
|
||||
} else {
|
||||
prevglxc = 0;
|
||||
prevgc = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -573,8 +551,6 @@ int DoMakeCurrent( __GLXclientState *cl,
|
|||
/* Context is current to somebody else */
|
||||
return BadAccess;
|
||||
}
|
||||
gc = glxc->gc;
|
||||
|
||||
|
||||
assert( drawId != None );
|
||||
assert( readId != None );
|
||||
|
|
@ -616,7 +592,6 @@ int DoMakeCurrent( __GLXclientState *cl,
|
|||
} else {
|
||||
/* Switching to no context. Ignore new drawable. */
|
||||
glxc = 0;
|
||||
gc = 0;
|
||||
pDraw = 0;
|
||||
pRead = 0;
|
||||
}
|
||||
|
|
@ -638,7 +613,14 @@ int DoMakeCurrent( __GLXclientState *cl,
|
|||
/*
|
||||
** Make the previous context not current.
|
||||
*/
|
||||
if (!(*prevgc->exports.loseCurrent)((__GLcontext *)prevgc)) {
|
||||
|
||||
/* FIXME-KRH: this is where we need the looseContext function
|
||||
* in the DRIcontext interface. */
|
||||
|
||||
if (!(*prevglxc->driContext.unbindContext)(NULL, pDraw->pScreen->myNum,
|
||||
0, /* prev draw */
|
||||
0, /* prev read */
|
||||
&prevglxc->driContext)) {
|
||||
return __glXBadContext;
|
||||
}
|
||||
__glXDeassociateContext(prevglxc);
|
||||
|
|
@ -649,25 +631,19 @@ int DoMakeCurrent( __GLXclientState *cl,
|
|||
|
||||
glxc->drawPriv = drawPriv;
|
||||
glxc->readPriv = readPriv;
|
||||
__glXCacheDrawableSize(drawPriv);
|
||||
|
||||
/* make the context current */
|
||||
if (!(*gc->exports.makeCurrent)((__GLcontext *)gc)) {
|
||||
glxc->drawPriv = NULL;
|
||||
glxc->readPriv = NULL;
|
||||
return __glXBadContext;
|
||||
}
|
||||
|
||||
/* resize the buffers */
|
||||
if (!__glXResizeDrawableBuffers(drawPriv)) {
|
||||
/* could not do initial resize. make current failed */
|
||||
(*gc->exports.loseCurrent)((__GLcontext *)gc);
|
||||
if (!(*glxc->driContext.bindContext)(NULL, pDraw->pScreen->myNum,
|
||||
drawId, readId,
|
||||
&glxc->driContext)) {
|
||||
glxc->drawPriv = NULL;
|
||||
glxc->readPriv = NULL;
|
||||
return __glXBadContext;
|
||||
}
|
||||
|
||||
glxc->isCurrent = GL_TRUE;
|
||||
/* FIXME: Is this assignment ok? Why wasn't it here already? */
|
||||
__glXLastContext = glxc;
|
||||
__glXAssociateContext(glxc);
|
||||
assert(drawPriv->drawGlxc == glxc);
|
||||
assert(readPriv->readGlxc == glxc);
|
||||
|
|
@ -842,7 +818,6 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
|
|||
GLXContextID source = req->source;
|
||||
GLXContextID dest = req->dest;
|
||||
GLXContextTag tag = req->contextTag;
|
||||
unsigned long mask = req->mask;
|
||||
__GLXcontext *src, *dst;
|
||||
int error;
|
||||
|
||||
|
|
@ -906,6 +881,11 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
|
|||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* FIXME: We probably need to add DRIcontext::copyContext for
|
||||
* this. */
|
||||
|
||||
/*
|
||||
** Issue copy. The only reason for failure is a bad mask.
|
||||
*/
|
||||
|
|
@ -915,6 +895,8 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
|
|||
client->errorValue = mask;
|
||||
return BadValue;
|
||||
}
|
||||
#endif
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
@ -1353,9 +1335,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
|
|||
}
|
||||
}
|
||||
|
||||
if ((*glxPriv->swapBuffers)(glxPriv) == GL_FALSE) {
|
||||
return __glXBadDrawable;
|
||||
}
|
||||
CALL_Finish( GET_DISPATCH(), () );
|
||||
(*glxPriv->driDrawable.swapBuffers)(NULL, glxPriv->driDrawable.private);
|
||||
}
|
||||
|
||||
return Success;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ typedef struct __GLXcontextRec __GLXcontext;
|
|||
#define CAPI
|
||||
|
||||
#include "GL/internal/glcore.h"
|
||||
#include "GL/internal/dri_interface.h"
|
||||
|
||||
struct __GLXcontextRec {
|
||||
/*
|
||||
|
|
@ -62,11 +63,9 @@ struct __GLXcontextRec {
|
|||
struct __GLXcontextRec *nextReadPriv;
|
||||
|
||||
/*
|
||||
** Opaque pointer the context object created by the GL that the
|
||||
** server is bound with. Never dereferenced by this code, but used
|
||||
** as a handle to feed to the routines in the screen info struct.
|
||||
** The DRI context initialized by the DRI driver.
|
||||
*/
|
||||
__GLinterface *gc;
|
||||
__DRIcontext driContext;
|
||||
|
||||
/*
|
||||
** mode struct for this context
|
||||
|
|
@ -120,11 +119,6 @@ struct __GLXcontextRec {
|
|||
*/
|
||||
GLboolean isDirect;
|
||||
|
||||
/*
|
||||
** Window pending state
|
||||
*/
|
||||
GLuint pendingState;
|
||||
|
||||
/*
|
||||
** This flag keeps track of whether there are unflushed GL commands.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -75,13 +75,6 @@ struct __GLXdrawablePrivateRec {
|
|||
*/
|
||||
__GLcontextModes *modes;
|
||||
|
||||
/*
|
||||
** cached drawable size and origin
|
||||
*/
|
||||
|
||||
GLint xorigin, yorigin;
|
||||
GLint width, height;
|
||||
|
||||
/*
|
||||
** Lists of contexts bound to this drawable. There are two lists here.
|
||||
** One list is of the contexts that have this drawable bound for drawing,
|
||||
|
|
@ -91,17 +84,7 @@ struct __GLXdrawablePrivateRec {
|
|||
struct __GLXcontextRec *drawGlxc;
|
||||
struct __GLXcontextRec *readGlxc;
|
||||
|
||||
/*
|
||||
** "methods" that the drawble should be able to respond to.
|
||||
*/
|
||||
void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
|
||||
void (*updatePalette)(struct __GLXdrawablePrivateRec *);
|
||||
GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
|
||||
|
||||
/*
|
||||
** The GL drawable (information shared between GLX and the GL core)
|
||||
*/
|
||||
__GLdrawablePrivate glPriv;
|
||||
__DRIdrawable driDrawable;
|
||||
|
||||
/*
|
||||
** reference count
|
||||
|
|
|
|||
151
GL/glx/glxext.c
151
GL/glx/glxext.c
|
|
@ -33,26 +33,28 @@
|
|||
#include "glxext.h"
|
||||
#include "micmap.h"
|
||||
|
||||
#include "glapi.h"
|
||||
#include "glthread.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
void GlxWrapInitVisuals(miInitVisualsProcPtr *);
|
||||
void GlxSetVisualConfigs(int nconfigs,
|
||||
__GLXvisualConfig *configs, void **privates);
|
||||
#include "xf86.h"
|
||||
#include "dri.h"
|
||||
|
||||
static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */;
|
||||
|
||||
/*
|
||||
** Forward declarations.
|
||||
*/
|
||||
static int __glXSwapDispatch(ClientPtr);
|
||||
static int __glXDispatch(ClientPtr);
|
||||
|
||||
void __glXVisualsReset(void);
|
||||
|
||||
/*
|
||||
** Called when the extension is reset.
|
||||
*/
|
||||
static void ResetExtension(ExtensionEntry* extEntry)
|
||||
{
|
||||
__glXFlushContextCache();
|
||||
(*__glXExt->resetExtension)();
|
||||
__glXVisualsReset();
|
||||
__glXScreenReset();
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +100,11 @@ static int ContextGone(__GLXcontext* cx, XID id)
|
|||
{
|
||||
cx->idExists = GL_FALSE;
|
||||
if (!cx->isCurrent) {
|
||||
__glXFreeContext(cx);
|
||||
/* This is called from CloseDownCLient() in dix, not through
|
||||
* __glXDispatch, so we'll have to lift the DRM lock manually
|
||||
* to avoid deadlocks for cards that grab the lock during
|
||||
* context destruction. */
|
||||
DRIUnlockedCallback(__glXFreeContext, cx, 0);
|
||||
}
|
||||
|
||||
return True;
|
||||
|
|
@ -166,9 +172,8 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
|
|||
if (cx->idExists || cx->isCurrent) return GL_FALSE;
|
||||
|
||||
if (!cx->isDirect) {
|
||||
if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
(*cx->driContext.destroyContext)(NULL, cx->screen,
|
||||
cx->driContext.private);
|
||||
}
|
||||
if (cx->feedbackBuf) __glXFree(cx->feedbackBuf);
|
||||
if (cx->selectBuf) __glXFree(cx->selectBuf);
|
||||
|
|
@ -232,6 +237,7 @@ GLboolean __glXErrorOccured(void)
|
|||
/*
|
||||
** Initialize the GLX extension.
|
||||
*/
|
||||
|
||||
void GlxExtensionInit(void)
|
||||
{
|
||||
ExtensionEntry *extEntry;
|
||||
|
|
@ -246,7 +252,7 @@ void GlxExtensionInit(void)
|
|||
*/
|
||||
extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS,
|
||||
__GLX_NUMBER_ERRORS, __glXDispatch,
|
||||
__glXSwapDispatch, ResetExtension,
|
||||
__glXDispatch, ResetExtension,
|
||||
StandardMinorOpcode);
|
||||
if (!extEntry) {
|
||||
FatalError("__glXExtensionInit: AddExtensions failed\n");
|
||||
|
|
@ -287,46 +293,8 @@ void GlxExtensionInit(void)
|
|||
|
||||
Bool __glXCoreType(void)
|
||||
{
|
||||
return __glXExt->type;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
void GlxSetVisualConfigs(int nconfigs,
|
||||
__GLXvisualConfig *configs, void **privates)
|
||||
{
|
||||
(*__glXExt->setVisualConfigs)(nconfigs, configs, privates);
|
||||
}
|
||||
|
||||
static miInitVisualsProcPtr saveInitVisualsProc;
|
||||
|
||||
Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
|
||||
int *nvisualp, int *ndepthp,
|
||||
int *rootDepthp, VisualID *defaultVisp,
|
||||
unsigned long sizes, int bitsPerRGB,
|
||||
int preferredVis)
|
||||
{
|
||||
Bool ret;
|
||||
|
||||
if (saveInitVisualsProc) {
|
||||
ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
|
||||
rootDepthp, defaultVisp, sizes, bitsPerRGB,
|
||||
preferredVis);
|
||||
if (!ret)
|
||||
return False;
|
||||
}
|
||||
(*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp,
|
||||
defaultVisp, sizes, bitsPerRGB);
|
||||
return True;
|
||||
}
|
||||
|
||||
void
|
||||
GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
|
||||
{
|
||||
saveInitVisualsProc = *initVisProc;
|
||||
*initVisProc = GlxInitVisuals;
|
||||
/* HACK: this shouldn't be done here but it's the earliest time */
|
||||
__glXExt = __glXglDDXExtensionInfo(); /* from GLcore */
|
||||
/* This can't be right... what is this used for anyway? */
|
||||
return GL_CORE_MESA;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
|
@ -375,21 +343,44 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
|
|||
return cx;
|
||||
}
|
||||
|
||||
/* FIXME: A better solution would be to expose the forceCurrent
|
||||
* from the underlying __GLcontext in the DRIcontext. According
|
||||
* to idr, this is much faster for this purpose. */
|
||||
/* Make this context the current one for the GL. */
|
||||
|
||||
if (!cx->isDirect) {
|
||||
if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) {
|
||||
if (!(*cx->driContext.bindContext)(NULL, cx->drawPriv->pDraw->pScreen->myNum,
|
||||
cx->drawPriv->drawId,
|
||||
cx->readPriv->drawId,
|
||||
&cx->driContext)) {
|
||||
/* Bind failed, and set the error code. Bummer */
|
||||
cl->client->errorValue = cx->id;
|
||||
*error = __glXBadContextState;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
__glXLastContext = cx;
|
||||
return cx;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
int (*proc)(__GLXclientState *cl, GLbyte *pc);
|
||||
__GLXclientState *clientState;
|
||||
GLbyte *stuff;
|
||||
int retval;
|
||||
} __GLXdispatchData;
|
||||
|
||||
static void __glXCallDispatch(void *data)
|
||||
{
|
||||
__GLXdispatchData *dispatchData = data;
|
||||
|
||||
dispatchData->retval =
|
||||
(*dispatchData->proc)(dispatchData->clientState, dispatchData->stuff);
|
||||
}
|
||||
|
||||
/*
|
||||
** Top level dispatcher; all commands are executed from here down.
|
||||
*/
|
||||
|
|
@ -397,8 +388,8 @@ static int __glXDispatch(ClientPtr client)
|
|||
{
|
||||
REQUEST(xGLXSingleReq);
|
||||
CARD8 opcode;
|
||||
int (*proc)(__GLXclientState *cl, GLbyte *pc);
|
||||
__GLXclientState *cl;
|
||||
__GLXdispatchData dispatchData;
|
||||
|
||||
opcode = stuff->glxCode;
|
||||
cl = __glXClients[client->index];
|
||||
|
|
@ -443,54 +434,16 @@ static int __glXDispatch(ClientPtr client)
|
|||
/*
|
||||
** Use the opcode to index into the procedure table.
|
||||
*/
|
||||
proc = __glXSingleTable[opcode];
|
||||
return (*proc)(cl, (GLbyte *) stuff);
|
||||
}
|
||||
if (client->swapped)
|
||||
dispatchData.proc = __glXSwapSingleTable[opcode];
|
||||
else
|
||||
dispatchData.proc = __glXSingleTable[opcode];
|
||||
dispatchData.clientState = cl;
|
||||
dispatchData.stuff = (GLbyte *) stuff;
|
||||
|
||||
static int __glXSwapDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGLXSingleReq);
|
||||
CARD8 opcode;
|
||||
int (*proc)(__GLXclientState *cl, GLbyte *pc);
|
||||
__GLXclientState *cl;
|
||||
DRIUnlockedCallback(__glXCallDispatch, &dispatchData, 0);
|
||||
|
||||
opcode = stuff->glxCode;
|
||||
cl = __glXClients[client->index];
|
||||
if (!cl) {
|
||||
cl = (__GLXclientState *) __glXMalloc(sizeof(__GLXclientState));
|
||||
__glXClients[client->index] = cl;
|
||||
if (!cl) {
|
||||
return BadAlloc;
|
||||
}
|
||||
__glXMemset(cl, 0, sizeof(__GLXclientState));
|
||||
}
|
||||
|
||||
if (!cl->inUse) {
|
||||
/*
|
||||
** This is first request from this client. Associate a resource
|
||||
** with the client so we will be notified when the client dies.
|
||||
*/
|
||||
XID xid = FakeClientID(client->index);
|
||||
if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
|
||||
return BadAlloc;
|
||||
}
|
||||
ResetClientState(client->index);
|
||||
cl->inUse = GL_TRUE;
|
||||
cl->client = client;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check for valid opcode.
|
||||
*/
|
||||
if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
|
||||
return BadRequest;
|
||||
}
|
||||
|
||||
/*
|
||||
** Use the opcode to index into the procedure table.
|
||||
*/
|
||||
proc = __glXSwapSingleTable[opcode];
|
||||
return (*proc)(cl, (GLbyte *) stuff);
|
||||
return dispatchData.retval;
|
||||
}
|
||||
|
||||
int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
|
||||
|
|
|
|||
814
GL/glx/glxloader.c
Normal file
814
GL/glx/glxloader.c
Normal file
|
|
@ -0,0 +1,814 @@
|
|||
/*
|
||||
* Copyright © 2005 Red Hat, Inc.
|
||||
* (C) Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* RED HAT, INC, OR PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
||||
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* Brian Paul <brian@precisioninsight.com>
|
||||
* Kristian Høgsberg <krh@redhat.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <windowstr.h>
|
||||
#include <os.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/internal/dri_interface.h>
|
||||
|
||||
#define _XF86DRI_SERVER_
|
||||
#include <drm_sarea.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86dristr.h>
|
||||
#include <xf86str.h>
|
||||
#include <xf86.h>
|
||||
#include <dri.h>
|
||||
|
||||
#define DRI_NEW_INTERFACE_ONLY
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxloader.h"
|
||||
#include "glcontextmodes.h"
|
||||
|
||||
#ifndef DEFAULT_DRIVER_DIR
|
||||
/* this is normally defined in the Imakefile */
|
||||
#define DEFAULT_DRIVER_DIR "/usr/lib/dri"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** We keep a linked list of these structures, one per DRI device driver.
|
||||
*/
|
||||
|
||||
/* Not sure if the DRIdriver struct is really necessary... We could
|
||||
* just dlopen() the driver for every screen. This won't cause the
|
||||
* library to be loaded again, and the libraries are ref-counted so
|
||||
* dlclose()'ing the driver for one screen won't close it for
|
||||
* another. /KRH */
|
||||
|
||||
struct __DRIdriverRec {
|
||||
const char *name;
|
||||
void *handle;
|
||||
PFNCREATENEWSCREENFUNC createNewScreenFunc;
|
||||
struct __DRIdriverRec *next;
|
||||
};
|
||||
|
||||
static __DRIdriver *Drivers = NULL;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Extract the ith directory path out of a colon-separated list of paths. No
|
||||
* more than \c dirLen characters, including the terminating \c NUL, will be
|
||||
* written to \c dir.
|
||||
*
|
||||
* \param index Index of path to extract (starting at zero)
|
||||
* \param paths The colon-separated list of paths
|
||||
* \param dirLen Maximum length of result to store in \c dir
|
||||
* \param dir Buffer to hold the extracted directory path
|
||||
*
|
||||
* \returns
|
||||
* The number of characters that would have been written to \c dir had there
|
||||
* been enough room. This does not include the terminating \c NUL. When
|
||||
* extraction fails, zero will be returned.
|
||||
*
|
||||
* \todo
|
||||
* It seems like this function could be rewritten to use \c strchr.
|
||||
*/
|
||||
static size_t
|
||||
ExtractDir(int index, const char *paths, int dirLen, char *dir)
|
||||
{
|
||||
int i, len;
|
||||
const char *start, *end;
|
||||
|
||||
/* find ith colon */
|
||||
start = paths;
|
||||
i = 0;
|
||||
while (i < index) {
|
||||
if (*start == ':') {
|
||||
i++;
|
||||
start++;
|
||||
}
|
||||
else if (*start == 0) {
|
||||
/* end of string and couldn't find ith colon */
|
||||
dir[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
start++;
|
||||
}
|
||||
}
|
||||
|
||||
while (*start == ':')
|
||||
start++;
|
||||
|
||||
/* find next colon, or end of string */
|
||||
end = start + 1;
|
||||
while (*end != ':' && *end != 0) {
|
||||
end++;
|
||||
}
|
||||
|
||||
/* copy string between <start> and <end> into result string */
|
||||
len = end - start;
|
||||
if (len > dirLen - 1)
|
||||
len = dirLen - 1;
|
||||
strncpy(dir, start, len);
|
||||
dir[len] = 0;
|
||||
|
||||
return( end - start );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Versioned name of the expected \c __driCreateNewScreen function.
|
||||
*
|
||||
* The version of the last incompatible loader/driver inteface change is
|
||||
* appended to the name of the \c __driCreateNewScreen function. This
|
||||
* prevents loaders from trying to load drivers that are too old.
|
||||
*
|
||||
* \todo
|
||||
* Create a macro or something so that this is automatically updated.
|
||||
*/
|
||||
static const char createNewScreenName[] = "__driCreateNewScreen_20050727";
|
||||
|
||||
|
||||
/**
|
||||
* Try to \c dlopen the named driver.
|
||||
*
|
||||
* This function adds the "_dri.so" suffix to the driver name and searches the
|
||||
* directories specified by the \c LIBGL_DRIVERS_PATH environment variable in
|
||||
* order to find the driver.
|
||||
*
|
||||
* \param driverName - a name like "tdfx", "i810", "mga", etc.
|
||||
*
|
||||
* \returns
|
||||
* A handle from \c dlopen, or \c NULL if driver file not found.
|
||||
*/
|
||||
static __DRIdriver *OpenDriver(const char *driverName, ScreenPtr pScreen)
|
||||
{
|
||||
char *libPaths = NULL;
|
||||
char libDir[1000];
|
||||
int i;
|
||||
__DRIdriver *driver;
|
||||
|
||||
/* First, search Drivers list to see if we've already opened this driver */
|
||||
for (driver = Drivers; driver; driver = driver->next) {
|
||||
if (strcmp(driver->name, driverName) == 0) {
|
||||
/* found it */
|
||||
return driver;
|
||||
}
|
||||
}
|
||||
|
||||
/* We probably want to control this similar to how we handle the
|
||||
* -modulepath cmd line option. For now, this is convenient
|
||||
* though. */
|
||||
libPaths = getenv("LIBGL_DRIVERS_PATH");
|
||||
if (!libPaths)
|
||||
libPaths = getenv("LIBGL_DRIVERS_DIR"); /* deprecated */
|
||||
if (!libPaths)
|
||||
libPaths = DEFAULT_DRIVER_DIR;
|
||||
|
||||
for ( i = 0 ; ExtractDir(i, libPaths, sizeof libDir, libDir) != 0 ; i++ ) {
|
||||
char realDriverName[200];
|
||||
void *handle = NULL;
|
||||
|
||||
snprintf(realDriverName, sizeof realDriverName,
|
||||
"%s/%s_dri.so", libDir, driverName);
|
||||
|
||||
xf86DrvMsg(pScreen->myNum, X_INFO,
|
||||
"OpenDriver: trying %s\n", realDriverName);
|
||||
handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
|
||||
|
||||
if ( handle != NULL ) {
|
||||
/* allocate __DRIdriver struct */
|
||||
driver = (__DRIdriver *) __glXMalloc(sizeof(__DRIdriver));
|
||||
if (!driver)
|
||||
return NULL; /* out of memory! */
|
||||
/* init the struct */
|
||||
driver->name = Xstrdup(driverName);
|
||||
if (!driver->name) {
|
||||
Xfree(driver);
|
||||
return NULL; /* out of memory! */
|
||||
}
|
||||
|
||||
driver->createNewScreenFunc = (PFNCREATENEWSCREENFUNC)
|
||||
dlsym(handle, createNewScreenName);
|
||||
|
||||
if ( driver->createNewScreenFunc == NULL ) {
|
||||
/* If the driver doesn't have this symbol then something's
|
||||
* really, really wrong.
|
||||
*/
|
||||
xf86DrvMsg(pScreen->myNum, X_ERROR,
|
||||
"%s not defined in %s_dri.so!\n"
|
||||
"Your driver may be too old for this GLX module.\n",
|
||||
createNewScreenName, driverName);
|
||||
Xfree(driver);
|
||||
dlclose(handle);
|
||||
continue;
|
||||
}
|
||||
driver->handle = handle;
|
||||
/* put at head of linked list */
|
||||
driver->next = Drivers;
|
||||
Drivers = driver;
|
||||
|
||||
return driver;
|
||||
}
|
||||
else {
|
||||
xf86DrvMsg(pScreen->myNum, X_ERROR,
|
||||
"dlopen %s failed (%s)\n", realDriverName, dlerror());
|
||||
}
|
||||
}
|
||||
|
||||
xf86DrvMsg(pScreen->myNum, X_ERROR,
|
||||
"unable to find driver: %s_dri.so\n", driverName);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Given a display pointer and screen number, determine the name of
|
||||
* the DRI driver for the screen. (I.e. "r128", "tdfx", etc).
|
||||
* Return True for success, False for failure.
|
||||
*/
|
||||
static Bool GetDriverName(ScreenPtr pScreen, char **driverName)
|
||||
{
|
||||
int directCapable;
|
||||
Bool b;
|
||||
int driverMajor, driverMinor, driverPatch;
|
||||
|
||||
*driverName = NULL;
|
||||
|
||||
if (!DRIQueryDirectRenderingCapable(pScreen, &directCapable)) {
|
||||
xf86DrvMsg(pScreen->myNum, X_ERROR,
|
||||
"DRIQueryDirectRenderingCapable failed\n");
|
||||
return False;
|
||||
}
|
||||
if (!directCapable) {
|
||||
xf86DrvMsg(pScreen->myNum, X_ERROR,
|
||||
"DRIQueryDirectRenderingCapable returned false\n");
|
||||
return False;
|
||||
}
|
||||
|
||||
b = DRIGetClientDriverName(pScreen, &driverMajor, &driverMinor,
|
||||
&driverPatch, driverName);
|
||||
if (!b) {
|
||||
xf86DrvMsg(pScreen->myNum, X_ERROR,
|
||||
"Cannot determine driver name for screen %d\n",
|
||||
pScreen->myNum);
|
||||
return False;
|
||||
}
|
||||
|
||||
xf86DrvMsg(pScreen->myNum, X_INFO,
|
||||
"DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
|
||||
driverMajor, driverMinor, driverPatch,
|
||||
*driverName, pScreen->myNum);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Given a display pointer and screen number, return a __DRIdriver handle.
|
||||
* Return NULL if anything goes wrong.
|
||||
*/
|
||||
static __DRIdriver *driGetDriver(ScreenPtr pScreen)
|
||||
{
|
||||
char *driverName;
|
||||
|
||||
if (GetDriverName(pScreen, &driverName)) {
|
||||
__DRIdriver *ret;
|
||||
ret = OpenDriver(driverName, pScreen);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
filter_modes(__GLcontextModes **server_modes,
|
||||
const __GLcontextModes *driver_modes)
|
||||
{
|
||||
__GLcontextModes * m;
|
||||
__GLcontextModes ** prev_next;
|
||||
const __GLcontextModes * check;
|
||||
unsigned modes_count = 0;
|
||||
|
||||
if ( driver_modes == NULL ) {
|
||||
fprintf(stderr, "libGL warning: 3D driver returned no fbconfigs.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* For each mode in server_modes, check to see if a matching mode exists
|
||||
* in driver_modes. If not, then the mode is not available.
|
||||
*/
|
||||
|
||||
prev_next = server_modes;
|
||||
for ( m = *prev_next ; m != NULL ; m = *prev_next ) {
|
||||
GLboolean do_delete = GL_TRUE;
|
||||
|
||||
for ( check = driver_modes ; check != NULL ; check = check->next ) {
|
||||
if ( _gl_context_modes_are_same( m, check ) ) {
|
||||
do_delete = GL_FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The 3D has to support all the modes that match the GLX visuals
|
||||
* sent from the X server.
|
||||
*/
|
||||
if ( do_delete && (m->visualID != 0) ) {
|
||||
do_delete = GL_FALSE;
|
||||
|
||||
fprintf(stderr, "libGL warning: 3D driver claims to not support "
|
||||
"visual 0x%02x\n", m->visualID);
|
||||
}
|
||||
|
||||
if ( do_delete ) {
|
||||
*prev_next = m->next;
|
||||
|
||||
m->next = NULL;
|
||||
_gl_context_modes_destroy( m );
|
||||
}
|
||||
else {
|
||||
modes_count++;
|
||||
prev_next = & m->next;
|
||||
}
|
||||
}
|
||||
|
||||
return modes_count;
|
||||
}
|
||||
|
||||
|
||||
static __DRIfuncPtr getProcAddress(const char *proc_name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static __DRIscreen *findScreen(__DRInativeDisplay *dpy, int scrn)
|
||||
{
|
||||
return &__glXActiveScreens[scrn].driScreen;
|
||||
}
|
||||
|
||||
static GLboolean windowExists(__DRInativeDisplay *dpy, __DRIid draw)
|
||||
{
|
||||
WindowPtr pWin = (WindowPtr) LookupIDByType(draw, RT_WINDOW);
|
||||
|
||||
return pWin == NULL ? GL_FALSE : GL_TRUE;
|
||||
}
|
||||
|
||||
static GLboolean createContext(__DRInativeDisplay *dpy, int screen,
|
||||
int configID, void *contextID,
|
||||
drm_context_t *hw_context)
|
||||
{
|
||||
XID fakeID;
|
||||
VisualPtr visual;
|
||||
int i;
|
||||
ScreenPtr pScreen;
|
||||
|
||||
pScreen = screenInfo.screens[screen];
|
||||
|
||||
/* Find the requested X visual */
|
||||
visual = pScreen->visuals;
|
||||
for (i = 0; i < pScreen->numVisuals; i++, visual++)
|
||||
if (visual->vid == configID)
|
||||
break;
|
||||
if (i == pScreen->numVisuals)
|
||||
return GL_FALSE;
|
||||
|
||||
fakeID = FakeClientID(0);
|
||||
*(XID *) contextID = fakeID;
|
||||
|
||||
return DRICreateContext(pScreen, visual, fakeID, hw_context);
|
||||
}
|
||||
|
||||
static GLboolean destroyContext(__DRInativeDisplay *dpy, int screen,
|
||||
__DRIid context)
|
||||
{
|
||||
return DRIDestroyContext(screenInfo.screens[screen], context);
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
createDrawable(__DRInativeDisplay *dpy, int screen,
|
||||
__DRIid drawable, drm_drawable_t *hHWDrawable)
|
||||
{
|
||||
DrawablePtr pDrawable;
|
||||
|
||||
pDrawable = (DrawablePtr) LookupIDByClass(drawable, RC_DRAWABLE);
|
||||
if (!pDrawable)
|
||||
return GL_FALSE;
|
||||
|
||||
return DRICreateDrawable(screenInfo.screens[screen],
|
||||
drawable,
|
||||
pDrawable,
|
||||
hHWDrawable);
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
destroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable)
|
||||
{
|
||||
DrawablePtr pDrawable;
|
||||
|
||||
pDrawable = (DrawablePtr) LookupIDByClass(drawable, RC_DRAWABLE);
|
||||
if (!pDrawable)
|
||||
return GL_FALSE;
|
||||
|
||||
return DRIDestroyDrawable(screenInfo.screens[screen],
|
||||
drawable,
|
||||
pDrawable);
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
getDrawableInfo(__DRInativeDisplay *dpy, int screen,
|
||||
__DRIid drawable, unsigned int *index, unsigned int *stamp,
|
||||
int *x, int *y, int *width, int *height,
|
||||
int *numClipRects, drm_clip_rect_t **ppClipRects,
|
||||
int *backX, int *backY,
|
||||
int *numBackClipRects, drm_clip_rect_t **ppBackClipRects)
|
||||
{
|
||||
DrawablePtr pDrawable;
|
||||
drm_clip_rect_t *pClipRects, *pBackClipRects;
|
||||
GLboolean retval;
|
||||
size_t size;
|
||||
|
||||
pDrawable = (DrawablePtr) LookupIDByClass(drawable, RC_DRAWABLE);
|
||||
if (!pDrawable)
|
||||
return GL_FALSE;
|
||||
|
||||
retval = DRIGetDrawableInfo(screenInfo.screens[screen],
|
||||
pDrawable, index, stamp,
|
||||
x, y, width, height,
|
||||
numClipRects, &pClipRects,
|
||||
backX, backY,
|
||||
numBackClipRects, &pBackClipRects);
|
||||
|
||||
if (*numClipRects > 0) {
|
||||
size = sizeof (drm_clip_rect_t) * *numClipRects;
|
||||
*ppClipRects = __glXMalloc (size);
|
||||
if (*ppClipRects != NULL)
|
||||
memcpy (*ppClipRects, pClipRects, size);
|
||||
}
|
||||
else {
|
||||
*ppClipRects = NULL;
|
||||
}
|
||||
|
||||
if (*numBackClipRects > 0) {
|
||||
size = sizeof (drm_clip_rect_t) * *numBackClipRects;
|
||||
*ppBackClipRects = __glXMalloc (size);
|
||||
if (*ppBackClipRects != NULL)
|
||||
memcpy (*ppBackClipRects, pBackClipRects, size);
|
||||
}
|
||||
else {
|
||||
*ppBackClipRects = NULL;
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
getUST(int64_t *ust)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
if (ust == NULL)
|
||||
return -EFAULT;
|
||||
|
||||
if (gettimeofday(&tv, NULL) == 0) {
|
||||
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
|
||||
return 0;
|
||||
} else {
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
|
||||
/* Table of functions exported by the loader to the driver. */
|
||||
static const __DRIinterfaceMethods interface_methods = {
|
||||
getProcAddress,
|
||||
|
||||
_gl_context_modes_create,
|
||||
_gl_context_modes_destroy,
|
||||
|
||||
findScreen,
|
||||
windowExists,
|
||||
|
||||
createContext,
|
||||
destroyContext,
|
||||
|
||||
createDrawable,
|
||||
destroyDrawable,
|
||||
getDrawableInfo,
|
||||
|
||||
getUST,
|
||||
NULL, /* glXGetMscRateOML, */
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the verion of the internal libGL API in YYYYMMDD format. This
|
||||
* might be used by the DRI drivers to determine how new libGL is at runtime.
|
||||
* Drivers should not call this function directly. They should instead use
|
||||
* \c glXGetProcAddress to obtain a pointer to the function.
|
||||
*
|
||||
* \returns An 8-digit decimal number representing the internal libGL API in
|
||||
* YYYYMMDD format.
|
||||
*
|
||||
* \sa glXGetProcAddress, PFNGLXGETINTERNALVERSIONPROC
|
||||
*
|
||||
* \since Internal API version 20021121.
|
||||
*/
|
||||
static int __glXGetInternalVersion(void)
|
||||
{
|
||||
/* History:
|
||||
* 20021121 - Initial version
|
||||
* 20021128 - Added __glXWindowExists() function
|
||||
* 20021207 - Added support for dynamic GLX extensions,
|
||||
* GLX_SGI_swap_control, GLX_SGI_video_sync,
|
||||
* GLX_OML_sync_control, and GLX_MESA_swap_control.
|
||||
* Never officially released. Do NOT test against
|
||||
* this version. Use 20030317 instead.
|
||||
* 20030317 - Added support GLX_SGIX_fbconfig,
|
||||
* GLX_MESA_swap_frame_usage, GLX_OML_swap_method,
|
||||
* GLX_{ARB,SGIS}_multisample, and
|
||||
* GLX_SGIX_visual_select_group.
|
||||
* 20030606 - Added support for GLX_SGI_make_current_read.
|
||||
* 20030813 - Made support for dynamic extensions multi-head aware.
|
||||
* 20030818 - Added support for GLX_MESA_allocate_memory in place of the
|
||||
* deprecated GLX_NV_vertex_array_range & GLX_MESA_agp_offset
|
||||
* interfaces.
|
||||
* 20031201 - Added support for the first round of DRI interface changes.
|
||||
* Do NOT test against this version! It has binary
|
||||
* compatibility bugs, use 20040317 instead.
|
||||
* 20040317 - Added the 'mode' field to __DRIcontextRec.
|
||||
* 20040415 - Added support for bindContext3 and unbindContext3.
|
||||
* 20040602 - Add __glXGetDrawableInfo. I though that was there
|
||||
* months ago. :(
|
||||
* 20050727 - Gut all the old interfaces. This breaks compatability with
|
||||
* any DRI driver built to any previous version.
|
||||
*/
|
||||
return 20050727;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the required libGL-side initialization and call the client-side
|
||||
* driver's \c __driCreateNewScreen function.
|
||||
*
|
||||
* \param dpy Display pointer.
|
||||
* \param scrn Screen number on the display.
|
||||
* \param psc DRI screen information.
|
||||
* \param driDpy DRI display information.
|
||||
* \param createNewScreen Pointer to the client-side driver's
|
||||
* \c __driCreateNewScreen function.
|
||||
* \returns A pointer to the \c __DRIscreenPrivate structure returned by
|
||||
* the client-side driver on success, or \c NULL on failure.
|
||||
*
|
||||
* \todo This function needs to be modified to remove context-modes from the
|
||||
* list stored in the \c __GLXscreenConfigsRec to match the list
|
||||
* returned by the client-side driver.
|
||||
*/
|
||||
static void *
|
||||
CallCreateNewScreen(ScreenPtr pScreen, __DRIscreen *psc,
|
||||
PFNCREATENEWSCREENFUNC createNewScreen)
|
||||
{
|
||||
drm_handle_t hSAREA;
|
||||
drmAddress pSAREA = MAP_FAILED;
|
||||
char *BusID;
|
||||
__DRIversion ddx_version;
|
||||
__DRIversion dri_version;
|
||||
__DRIversion drm_version;
|
||||
__DRIframebuffer framebuffer;
|
||||
int fd = -1;
|
||||
int status;
|
||||
const char * err_msg;
|
||||
const char * err_extra = NULL;
|
||||
int api_ver = __glXGetInternalVersion();
|
||||
drm_magic_t magic;
|
||||
drmVersionPtr version;
|
||||
char *driverName;
|
||||
drm_handle_t hFB;
|
||||
int junk;
|
||||
__GLcontextModes * driver_modes;
|
||||
__GLXscreenInfo *pGlxScreen;
|
||||
|
||||
/* DRI protocol version. */
|
||||
dri_version.major = XF86DRI_MAJOR_VERSION;
|
||||
dri_version.minor = XF86DRI_MINOR_VERSION;
|
||||
dri_version.patch = XF86DRI_PATCH_VERSION;
|
||||
|
||||
framebuffer.base = MAP_FAILED;
|
||||
framebuffer.dev_priv = NULL;
|
||||
|
||||
if (!DRIOpenConnection(pScreen, &hSAREA, &BusID)) {
|
||||
err_msg = "DRIOpenConnection";
|
||||
err_extra = NULL;
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
fd = drmOpen(NULL, BusID);
|
||||
Xfree(BusID); /* No longer needed */
|
||||
|
||||
if (fd < 0) {
|
||||
err_msg = "open DRM";
|
||||
err_extra = strerror( -fd );
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
if (drmGetMagic(fd, &magic)) {
|
||||
err_msg = "drmGetMagic";
|
||||
err_extra = NULL;
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
version = drmGetVersion(fd);
|
||||
if (version) {
|
||||
drm_version.major = version->version_major;
|
||||
drm_version.minor = version->version_minor;
|
||||
drm_version.patch = version->version_patchlevel;
|
||||
drmFreeVersion(version);
|
||||
}
|
||||
else {
|
||||
drm_version.major = -1;
|
||||
drm_version.minor = -1;
|
||||
drm_version.patch = -1;
|
||||
}
|
||||
|
||||
if (!DRIAuthConnection(pScreen, magic)) {
|
||||
err_msg = "DRIAuthConnection";
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
/* Get device name (like "tdfx") and the ddx version numbers.
|
||||
* We'll check the version in each DRI driver's "createNewScreen"
|
||||
* function. */
|
||||
if (!DRIGetClientDriverName(pScreen,
|
||||
&ddx_version.major,
|
||||
&ddx_version.minor,
|
||||
&ddx_version.patch,
|
||||
&driverName)) {
|
||||
err_msg = "DRIGetClientDriverName";
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get device-specific info. pDevPriv will point to a struct
|
||||
* (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) that
|
||||
* has information about the screen size, depth, pitch, ancilliary
|
||||
* buffers, DRM mmap handles, etc.
|
||||
*/
|
||||
if (!DRIGetDeviceInfo(pScreen, &hFB, &junk,
|
||||
&framebuffer.size, &framebuffer.stride,
|
||||
&framebuffer.dev_priv_size, &framebuffer.dev_priv)) {
|
||||
err_msg = "XF86DRIGetDeviceInfo";
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
framebuffer.width = pScreen->width;
|
||||
framebuffer.height = pScreen->height;
|
||||
|
||||
/* Map the framebuffer region. */
|
||||
status = drmMap(fd, hFB, framebuffer.size,
|
||||
(drmAddressPtr)&framebuffer.base);
|
||||
if (status != 0) {
|
||||
err_msg = "drmMap of framebuffer";
|
||||
err_extra = strerror( -status );
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
/* Map the SAREA region. Further mmap regions may be setup in
|
||||
* each DRI driver's "createNewScreen" function.
|
||||
*/
|
||||
status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA);
|
||||
if (status != 0) {
|
||||
err_msg = "drmMap of sarea";
|
||||
err_extra = strerror( -status );
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
driver_modes = NULL;
|
||||
|
||||
pGlxScreen = &__glXActiveScreens[pScreen->myNum];
|
||||
|
||||
__glXActiveScreens[pScreen->myNum].driScreen.private =
|
||||
(*createNewScreen)(NULL, pScreen->myNum,
|
||||
&__glXActiveScreens[pScreen->myNum].driScreen,
|
||||
pGlxScreen->modes,
|
||||
&ddx_version,
|
||||
&dri_version,
|
||||
&drm_version,
|
||||
&framebuffer,
|
||||
pSAREA,
|
||||
fd,
|
||||
api_ver,
|
||||
&interface_methods,
|
||||
&driver_modes);
|
||||
|
||||
if (__glXActiveScreens[pScreen->myNum].driScreen.private == NULL) {
|
||||
err_msg = "InitDriver";
|
||||
err_extra = NULL;
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
filter_modes(&pGlxScreen->modes, driver_modes);
|
||||
_gl_context_modes_destroy(driver_modes);
|
||||
|
||||
return __glXActiveScreens[pScreen->myNum].driScreen.private;
|
||||
|
||||
handle_error:
|
||||
if (pSAREA != MAP_FAILED)
|
||||
drmUnmap(pSAREA, SAREA_MAX);
|
||||
|
||||
if (framebuffer.base != MAP_FAILED)
|
||||
drmUnmap((drmAddress)framebuffer.base, framebuffer.size);
|
||||
|
||||
if (framebuffer.dev_priv != NULL)
|
||||
Xfree(framebuffer.dev_priv);
|
||||
|
||||
if (fd >= 0)
|
||||
drmClose(fd);
|
||||
|
||||
DRICloseConnection(pScreen);
|
||||
|
||||
if (err_extra != NULL)
|
||||
fprintf(stderr, "libGL error: %s failed (%s)\n", err_msg,
|
||||
err_extra);
|
||||
else
|
||||
fprintf(stderr, "libGL error: %s failed\n", err_msg );
|
||||
|
||||
fprintf(stderr, "libGL error: reverting to (slow) indirect rendering\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* This function isn't currently used.
|
||||
*/
|
||||
static void driDestroyDisplay(Display *dpy, void *private)
|
||||
{
|
||||
__DRIdisplayPrivate *pdpyp = (__DRIdisplayPrivate *)private;
|
||||
|
||||
if (pdpyp) {
|
||||
const int numScreens = ScreenCount(dpy);
|
||||
int i;
|
||||
for (i = 0; i < numScreens; i++) {
|
||||
if (pdpyp->libraryHandles[i])
|
||||
dlclose(pdpyp->libraryHandles[i]);
|
||||
}
|
||||
Xfree(pdpyp->libraryHandles);
|
||||
Xfree(pdpyp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void __glXLoaderInitScreen(int screen)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
__DRIdriver *driver;
|
||||
|
||||
/* dynamically discover DRI drivers for all screens, saving each
|
||||
* driver's "__driCreateScreen" function pointer. That's the bootstrap
|
||||
* entrypoint for all DRI drivers.
|
||||
*/
|
||||
pScreen = screenInfo.screens[screen];
|
||||
driver = driGetDriver(pScreen);
|
||||
|
||||
if (driver) {
|
||||
__glXActiveScreens[screen].driver = driver;
|
||||
|
||||
CallCreateNewScreen(pScreen,
|
||||
&__glXActiveScreens[screen].driScreen,
|
||||
driver->createNewScreenFunc);
|
||||
__glXActiveScreens[screen].driScreen.screenConfigs =
|
||||
&__glXActiveScreens[screen];
|
||||
}
|
||||
else {
|
||||
/* FIXME: Fall back to loading sw dri driver here. */
|
||||
}
|
||||
}
|
||||
30
GL/glx/glxloader.h
Normal file
30
GL/glx/glxloader.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright © 2005 Red Hat, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* RED HAT, INC, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __GLX_LOADER_H__
|
||||
#define __GLX_LOADER_H__
|
||||
|
||||
void __glXLoaderInitScreen(int screen);
|
||||
|
||||
#endif /* __GLX_LOADER_H__ */
|
||||
|
|
@ -48,8 +48,10 @@
|
|||
#include <windowstr.h>
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxvisuals.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxext.h"
|
||||
#include "glxloader.h"
|
||||
|
||||
const char GLServerVersion[] = "1.2";
|
||||
static const char GLServerExtensions[] =
|
||||
|
|
@ -142,18 +144,6 @@ static char GLXServerExtensions[] =
|
|||
"GLX_SGIX_fbconfig "
|
||||
;
|
||||
|
||||
/*
|
||||
* __glDDXScreenInfo comes from GLcore, so we can't resolve this symbol at
|
||||
* module open time. Leave a placeholder, and fill this in when we first
|
||||
* need it (in __glXScreenInit). XXX Why make this an array?
|
||||
*/
|
||||
static __GLXscreenInfo *__glXScreens[] = {
|
||||
NULL /* &__glDDXScreenInfo */ ,
|
||||
};
|
||||
|
||||
static GLint __glXNumStaticScreens =
|
||||
(sizeof __glXScreens / sizeof __glXScreens[0]);
|
||||
|
||||
__GLXscreenInfo *__glXActiveScreens;
|
||||
GLint __glXNumActiveScreens;
|
||||
|
||||
|
|
@ -175,110 +165,11 @@ __GLXscreenInfo *__glXgetActiveScreen(int num) {
|
|||
*/
|
||||
static Bool DrawableGone(__GLXdrawablePrivate *glxPriv, XID xid)
|
||||
{
|
||||
__GLXcontext *cx, *cx1;
|
||||
|
||||
/*
|
||||
** Use glxPriv->type to figure out what kind of drawable this is. Don't
|
||||
** use glxPriv->pDraw->type because by the time this routine is called,
|
||||
** the pDraw might already have been freed.
|
||||
*/
|
||||
if (glxPriv->type == DRAWABLE_WINDOW) {
|
||||
/*
|
||||
** When a window is destroyed, notify all context bound to
|
||||
** it, that there are no longer bound to anything.
|
||||
*/
|
||||
for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
|
||||
cx1 = cx->nextDrawPriv;
|
||||
cx->pendingState |= __GLX_PENDING_DESTROY;
|
||||
}
|
||||
|
||||
for (cx = glxPriv->readGlxc; cx; cx = cx1) {
|
||||
cx1 = cx->nextReadPriv;
|
||||
cx->pendingState |= __GLX_PENDING_DESTROY;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** set the size to 0, so that context that may still be using this
|
||||
** drawable not do anything harmful
|
||||
*/
|
||||
glxPriv->xorigin = 0;
|
||||
glxPriv->yorigin = 0;
|
||||
glxPriv->width = 0;
|
||||
glxPriv->height = 0;
|
||||
|
||||
__glXUnrefDrawablePrivate(glxPriv);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
** This hook gets called when a window moves or changes size.
|
||||
*/
|
||||
static Bool PositionWindow(WindowPtr pWin, int x, int y)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
__GLXcontext *glxc;
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
Bool ret;
|
||||
|
||||
/*
|
||||
** Call wrapped position window routine
|
||||
*/
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
pScreen->PositionWindow =
|
||||
__glXActiveScreens[pScreen->myNum].WrappedPositionWindow;
|
||||
ret = (*pScreen->PositionWindow)(pWin, x, y);
|
||||
pScreen->PositionWindow = PositionWindow;
|
||||
|
||||
/*
|
||||
** Tell all contexts rendering into this window that the window size
|
||||
** has changed.
|
||||
*/
|
||||
glxPriv = (__GLXdrawablePrivate *) LookupIDByType(pWin->drawable.id,
|
||||
__glXDrawableRes);
|
||||
if (glxPriv == NULL) {
|
||||
/*
|
||||
** This window is not being used by the OpenGL.
|
||||
*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
** resize the drawable
|
||||
*/
|
||||
/* first change the drawable size */
|
||||
if (__glXResizeDrawableBuffers(glxPriv) == GL_FALSE) {
|
||||
/* resize failed! */
|
||||
/* XXX: what can we possibly do here? */
|
||||
ret = False;
|
||||
}
|
||||
|
||||
/* mark contexts as needing resize */
|
||||
|
||||
for (glxc = glxPriv->drawGlxc; glxc; glxc = glxc->nextDrawPriv) {
|
||||
glxc->pendingState |= __GLX_PENDING_RESIZE;
|
||||
}
|
||||
|
||||
for (glxc = glxPriv->readGlxc; glxc; glxc = glxc->nextReadPriv) {
|
||||
glxc->pendingState |= __GLX_PENDING_RESIZE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
** Wrap our own PositionWindow routine around the server's, so we can
|
||||
** be notified when a window changes size
|
||||
*/
|
||||
static void wrapPositionWindow(int screen)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[screen];
|
||||
|
||||
__glXActiveScreens[screen].WrappedPositionWindow = pScreen->PositionWindow;
|
||||
pScreen->PositionWindow = PositionWindow;
|
||||
}
|
||||
|
||||
/*
|
||||
* If your DDX driver wants to register support for swap barriers or hyperpipe
|
||||
* topology, it should call __glXHyperpipeInit() or __glXSwapBarrierInit()
|
||||
|
|
@ -324,9 +215,7 @@ void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs)
|
|||
|
||||
void __glXScreenInit(GLint numscreens)
|
||||
{
|
||||
GLint i,j;
|
||||
|
||||
__glXScreens[0] = __glXglDDXScreenInfo(); /* from GLcore */
|
||||
GLint i;
|
||||
|
||||
/*
|
||||
** This alloc has to work or else the server might as well core dump.
|
||||
|
|
@ -334,24 +223,16 @@ void __glXScreenInit(GLint numscreens)
|
|||
__glXActiveScreens =
|
||||
(__GLXscreenInfo *) __glXMalloc(sizeof(__GLXscreenInfo) * numscreens);
|
||||
|
||||
for (i=0; i < numscreens; i++) {
|
||||
/*
|
||||
** Probe each static screen to see which exists.
|
||||
*/
|
||||
for (j=0; j < __glXNumStaticScreens; j++) {
|
||||
if ((*__glXScreens[j]->screenProbe)(i)) {
|
||||
__glXActiveScreens[i] = *__glXScreens[j];
|
||||
for (i = 0; i < numscreens; i++) {
|
||||
__glXVisualsInitScreen(&__glXActiveScreens[i], i);
|
||||
__glXActiveScreens[i].GLextensions = __glXStrdup(GLServerExtensions);
|
||||
__glXActiveScreens[i].GLXvendor = __glXStrdup(GLXServerVendorName);
|
||||
__glXActiveScreens[i].GLXversion = __glXStrdup(GLXServerVersion);
|
||||
__glXActiveScreens[i].GLXextensions = __glXStrdup(GLXServerExtensions);
|
||||
|
||||
__glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals;
|
||||
__glXActiveScreens[i].GLextensions = __glXStrdup(GLServerExtensions);
|
||||
__glXActiveScreens[i].GLXvendor = __glXStrdup(GLXServerVendorName);
|
||||
__glXActiveScreens[i].GLXversion = __glXStrdup(GLXServerVersion);
|
||||
__glXActiveScreens[i].GLXextensions = __glXStrdup(GLXServerExtensions);
|
||||
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
||||
|
||||
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
||||
wrapPositionWindow(i);
|
||||
}
|
||||
}
|
||||
__glXLoaderInitScreen(i);
|
||||
}
|
||||
__glXNumActiveScreens = numscreens;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@
|
|||
/* XXX: should be defined somewhere globally */
|
||||
#define CAPI
|
||||
|
||||
#include <stdint.h>
|
||||
#include "GL/internal/glcore.h"
|
||||
#include "GL/internal/dri_interface.h"
|
||||
|
||||
/*
|
||||
** Screen dependent data. These methods are the interface between the DIX
|
||||
|
|
@ -52,28 +54,6 @@
|
|||
** interface for context management on a screen.
|
||||
*/
|
||||
typedef struct {
|
||||
/*
|
||||
** Probe the screen and see if it supports GL rendering. It will
|
||||
** return GL_FALSE if it doesn't, GL_TRUE otherwise.
|
||||
*/
|
||||
Bool (*screenProbe)(int screen);
|
||||
|
||||
/*
|
||||
** Create a context using configuration information from modes.
|
||||
** Use imports as callbacks back to the OS. Return an opaque handle
|
||||
** on the context (NULL if failure).
|
||||
*/
|
||||
__GLinterface *(*createContext)(__GLimports *imports,
|
||||
__GLcontextModes *modes,
|
||||
__GLinterface *shareGC);
|
||||
|
||||
/*
|
||||
** Create a buffer using information from glxPriv. This routine
|
||||
** sets up any wrappers necessary to resize, swap or destroy the
|
||||
** buffer.
|
||||
*/
|
||||
void (*createBuffer)(__GLXdrawablePrivate *glxPriv);
|
||||
|
||||
/**
|
||||
* Linked list of valid context modes for this screen.
|
||||
*/
|
||||
|
|
@ -89,6 +69,9 @@ typedef struct {
|
|||
char *GLXversion;
|
||||
char *GLXextensions;
|
||||
|
||||
void *driver;
|
||||
__DRIscreen driScreen;
|
||||
|
||||
/*
|
||||
** Things that are not statically set.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
#include <resource.h>
|
||||
#include <scrnintstr.h>
|
||||
#include "GL/glx_ansic.h"
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
#include <GL/gl.h>
|
||||
#include <GL/glxproto.h>
|
||||
#include <GL/glxint.h>
|
||||
#include <GL/internal/dri_interface.h>
|
||||
|
||||
/* For glxscreens.h */
|
||||
typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
|
||||
|
|
|
|||
231
GL/glx/glxutil.c
231
GL/glx/glxutil.c
|
|
@ -195,84 +195,6 @@ __glXDeassociateContext(__GLXcontext *glxc)
|
|||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
void
|
||||
__glXGetDrawableSize(__GLdrawablePrivate *glPriv,
|
||||
GLint *x, GLint *y, GLuint *width, GLuint *height)
|
||||
{
|
||||
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
|
||||
|
||||
if (glxPriv) {
|
||||
*x = glxPriv->xorigin;
|
||||
*y = glxPriv->yorigin;
|
||||
*width = glxPriv->width;
|
||||
*height = glxPriv->height;
|
||||
} else {
|
||||
*x = *y = *width = *height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean
|
||||
__glXResizeDrawable(__GLdrawablePrivate *glPriv)
|
||||
{
|
||||
/* nothing to be done here */
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* accessing the drawable private */
|
||||
|
||||
static void
|
||||
LockDP(__GLdrawablePrivate *glPriv, __GLcontext *gc)
|
||||
{
|
||||
__GLinterface *glci = (__GLinterface *) gc;
|
||||
__GLXcontext *glxc = (__GLXcontext *) glci->imports.other;
|
||||
|
||||
/* quick exit test */
|
||||
if ((glxc->pendingState &
|
||||
(__GLX_PENDING_RESIZE |
|
||||
__GLX_PENDING_DESTROY |
|
||||
__GLX_PENDING_SWAP)) == 0x0)
|
||||
return;
|
||||
|
||||
/* some pending state. Deal with it */
|
||||
if (glxc->pendingState & __GLX_PENDING_RESIZE) {
|
||||
glxc->pendingState &= ~__GLX_PENDING_RESIZE;
|
||||
|
||||
(*glci->exports.notifyResize)(gc);
|
||||
assert((glxc->pendingState & __GLX_PENDING_RESIZE) == 0x0);
|
||||
}
|
||||
if (glxc->pendingState & __GLX_PENDING_DESTROY) {
|
||||
glxc->pendingState &= ~__GLX_PENDING_DESTROY;
|
||||
|
||||
assert(glxc->drawPriv->xorigin == 0);
|
||||
assert(glxc->drawPriv->yorigin == 0);
|
||||
assert(glxc->drawPriv->width == 0);
|
||||
assert(glxc->drawPriv->height == 0);
|
||||
assert(glxc->readPriv->xorigin == 0);
|
||||
assert(glxc->readPriv->yorigin == 0);
|
||||
assert(glxc->readPriv->width == 0);
|
||||
assert(glxc->readPriv->height == 0);
|
||||
(*glci->exports.notifyDestroy)(gc);
|
||||
__glXDeassociateContext(glxc);
|
||||
assert((glxc->pendingState & __GLX_PENDING_DESTROY) == 0x0);
|
||||
}
|
||||
if (glxc->pendingState & __GLX_PENDING_SWAP) {
|
||||
|
||||
glxc->pendingState &= ~__GLX_PENDING_SWAP;
|
||||
|
||||
(*glci->exports.notifySwapBuffers)(gc);
|
||||
assert((glxc->pendingState & __GLX_PENDING_SWAP) == 0x0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
UnlockDP(__GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Drawable private stuff */
|
||||
|
||||
|
|
@ -296,7 +218,6 @@ __glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
|
|||
__GLcontextModes *modes)
|
||||
{
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
__GLdrawablePrivate *glPriv;
|
||||
__GLXscreenInfo *pGlxScreen;
|
||||
|
||||
glxPriv = (__GLXdrawablePrivate *) __glXMalloc(sizeof(*glxPriv));
|
||||
|
|
@ -316,44 +237,17 @@ __glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* fill up glPriv */
|
||||
glPriv = &glxPriv->glPriv;
|
||||
glPriv->modes = (__GLcontextModes *) __glXMalloc(sizeof(__GLcontextModes));
|
||||
*glPriv->modes = *modes;
|
||||
glPriv->malloc = __glXMalloc;
|
||||
glPriv->calloc = __glXCalloc;
|
||||
glPriv->realloc = __glXRealloc;
|
||||
glPriv->free = __glXFree;
|
||||
glPriv->addSwapRect = NULL;
|
||||
glPriv->setClipRect = (void (*)(__GLdrawablePrivate *, GLint, GLint, GLsizei, GLsizei)) __glXNop;
|
||||
glPriv->lockDP = LockDP;
|
||||
glPriv->unlockDP = UnlockDP;
|
||||
glPriv->getDrawableSize = __glXGetDrawableSize;
|
||||
glPriv->resize = __glXResizeDrawable;
|
||||
glPriv->other = glxPriv;
|
||||
|
||||
/* allocate a one-rect ownership region */
|
||||
glPriv->ownershipRegion.rects =
|
||||
(__GLregionRect *)__glXCalloc(1, sizeof(__GLregionRect));
|
||||
glPriv->ownershipRegion.numRects = 1;
|
||||
|
||||
glxPriv->freeBuffers = __glXFreeBuffers;
|
||||
glxPriv->updatePalette = (void (*)(__GLXdrawablePrivate *)) __glXNop;
|
||||
|
||||
pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
|
||||
|
||||
if (glxPriv->type == DRAWABLE_WINDOW) {
|
||||
VisualID vid = wVisual((WindowPtr)pDraw);
|
||||
/* The last argument is 'attrs', which is used with pbuffers which
|
||||
* we currently don't support. */
|
||||
|
||||
glxPriv->modes = _gl_context_modes_find_visual( pGlxScreen->modes, vid );
|
||||
__glXFBInitDrawable(glxPriv, modes);
|
||||
} else {
|
||||
glxPriv->modes = glxPriv->pGlxPixmap->modes;
|
||||
__glXPixInitDrawable(glxPriv, modes);
|
||||
}
|
||||
|
||||
/* initialize the core's private buffer information */
|
||||
(*pGlxScreen->createBuffer)(glxPriv);
|
||||
glxPriv->driDrawable.private =
|
||||
(pGlxScreen->driScreen.createNewDrawable)(NULL, modes,
|
||||
drawId,
|
||||
&glxPriv->driDrawable,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
return glxPriv;
|
||||
}
|
||||
|
|
@ -361,24 +255,13 @@ __glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
|
|||
GLboolean
|
||||
__glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
|
||||
|
||||
/* remove the drawable from the drawable list */
|
||||
FreeResourceByType(glxPriv->drawId, __glXDrawableRes, FALSE);
|
||||
|
||||
/* Have the core free any memory it may have attached to the drawable */
|
||||
if (glPriv->freePrivate) {
|
||||
(*glPriv->freePrivate)(glPriv);
|
||||
}
|
||||
|
||||
/* Free any framebuffer memory attached to the drawable */
|
||||
if (glxPriv->freeBuffers) {
|
||||
(*glxPriv->freeBuffers)(glxPriv);
|
||||
}
|
||||
(*glxPriv->driDrawable.destroyDrawable)(NULL,
|
||||
glxPriv->driDrawable.private);
|
||||
|
||||
/* Free the drawable Private */
|
||||
__glXFree(glxPriv->glPriv.modes);
|
||||
__glXFree(glxPriv->glPriv.ownershipRegion.rects);
|
||||
__glXFree(glxPriv);
|
||||
|
||||
return GL_TRUE;
|
||||
|
|
@ -411,97 +294,3 @@ __glXGetDrawablePrivate(DrawablePtr pDraw, XID drawId,
|
|||
|
||||
return glxPriv;
|
||||
}
|
||||
|
||||
void
|
||||
__glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
if (glxPriv) {
|
||||
if (glxPriv->pDraw) {
|
||||
glxPriv->xorigin = glxPriv->pDraw->x;
|
||||
glxPriv->yorigin = glxPriv->pDraw->y;
|
||||
glxPriv->width = glxPriv->pDraw->width;
|
||||
glxPriv->height = glxPriv->pDraw->height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** resize/move the drawable. Called during the actual resize callback
|
||||
** to update the drawable side of the buffers
|
||||
*/
|
||||
GLboolean
|
||||
__glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
|
||||
GLint x, y;
|
||||
GLuint w, h;
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
GLint xAlignment, yAlignment;
|
||||
GLint xOffset, yOffset;
|
||||
GLint xStart, xEnd;
|
||||
GLint yStart, yEnd;
|
||||
GLuint xAlignedMask, yAlignedMask;
|
||||
#endif
|
||||
GLboolean status = GL_TRUE;
|
||||
|
||||
__glXCacheDrawableSize(glxPriv);
|
||||
|
||||
w = glxPriv->width;
|
||||
h = glxPriv->height;
|
||||
x = glxPriv->xorigin;
|
||||
y = glxPriv->yorigin;
|
||||
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
xAlignment = glPriv->xAlignment;
|
||||
yAlignment = glPriv->yAlignment;
|
||||
|
||||
xOffset = x & (xAlignment-1);
|
||||
yOffset = y & (yAlignment-1);
|
||||
|
||||
xAlignedMask = ~(xAlignment-1);
|
||||
yAlignedMask = ~(yAlignment-1);
|
||||
|
||||
xStart = x; xEnd = x+w;
|
||||
yStart = y; yEnd = y+h;
|
||||
|
||||
xStart &= xAlignedMask;
|
||||
if (xEnd & ~xAlignedMask) {
|
||||
xEnd = (xEnd&xAlignedMask) + xAlignment;
|
||||
}
|
||||
yStart &= yAlignedMask;
|
||||
if (yEnd & ~yAlignedMask) {
|
||||
yEnd = (yEnd&yAlignedMask) + yAlignment;
|
||||
}
|
||||
|
||||
x = xStart; y = yStart;
|
||||
w = xEnd-xStart; h = yEnd-yStart;
|
||||
#endif
|
||||
|
||||
if ((x != glPriv->xOrigin) ||
|
||||
(y != glPriv->yOrigin) ||
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
(xOffset != glPriv->xOffset) ||
|
||||
(yOffset != glPriv->yOffset) ||
|
||||
#endif
|
||||
(w != glPriv->width) ||
|
||||
(h != glPriv->height) ||
|
||||
(!w && !h)) {
|
||||
/* set up the glPriv info */
|
||||
glPriv->width = w;
|
||||
glPriv->height = h;
|
||||
glPriv->xOrigin = x;
|
||||
glPriv->yOrigin = y;
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
glPriv->xOffset = xOffset;
|
||||
glPriv->yOffset = yOffset;
|
||||
#endif
|
||||
|
||||
/* notify the buffers */
|
||||
status = __glXResizeBuffers(glPriv, x, y, w, h);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
|
|
|
|||
519
GL/glx/glxvisuals.c
Normal file
519
GL/glx/glxvisuals.c
Normal file
|
|
@ -0,0 +1,519 @@
|
|||
/*
|
||||
* Copyright © 2005 Red Hat, Inc.
|
||||
* (C) Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* RED HAT, INC, OR PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
||||
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* Brian Paul <brian@precisioninsight.com>
|
||||
* Kristian Høgsberg <krh@redhat.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <regionstr.h>
|
||||
#include <resource.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glxint.h>
|
||||
#include <GL/glxtokens.h>
|
||||
#include <GL/internal/glcore.h>
|
||||
#include <scrnintstr.h>
|
||||
#include <config.h>
|
||||
#include <glxserver.h>
|
||||
#include <glxscreens.h>
|
||||
#include <glxdrawable.h>
|
||||
#include <glxvisuals.h>
|
||||
#include <glxcontext.h>
|
||||
#include <glxext.h>
|
||||
#include <glxutil.h>
|
||||
#include <micmap.h>
|
||||
|
||||
void GlxWrapInitVisuals(miInitVisualsProcPtr *);
|
||||
|
||||
#include "glcontextmodes.h"
|
||||
|
||||
struct ScreenVisualsRec {
|
||||
int num_vis;
|
||||
void *private;
|
||||
__GLcontextModes *modes;
|
||||
};
|
||||
typedef struct ScreenVisualsRec ScreenVisuals;
|
||||
|
||||
static ScreenVisuals screenVisuals[MAXSCREENS];
|
||||
|
||||
static int numConfigs = 0;
|
||||
static __GLXvisualConfig *visualConfigs = NULL;
|
||||
static void **visualPrivates = NULL;
|
||||
|
||||
static int count_bits(unsigned int n)
|
||||
{
|
||||
int bits = 0;
|
||||
|
||||
while (n > 0) {
|
||||
if (n & 1) bits++;
|
||||
n >>= 1;
|
||||
}
|
||||
return bits;
|
||||
}
|
||||
|
||||
/*
|
||||
* In the case the driver defines no GLX visuals we'll use these.
|
||||
* Note that for TrueColor and DirectColor visuals, bufferSize is the
|
||||
* sum of redSize, greenSize, blueSize and alphaSize, which may be larger
|
||||
* than the nplanes/rootDepth of the server's X11 visuals
|
||||
*/
|
||||
#define NUM_FALLBACK_CONFIGS 5
|
||||
static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
|
||||
/* [0] = RGB, double buffered, Z */
|
||||
{
|
||||
-1, /* vid */
|
||||
-1, /* class */
|
||||
True, /* rgba */
|
||||
-1, -1, -1, 0, /* rgba sizes */
|
||||
-1, -1, -1, 0, /* rgba masks */
|
||||
0, 0, 0, 0, /* rgba accum sizes */
|
||||
True, /* doubleBuffer */
|
||||
False, /* stereo */
|
||||
-1, /* bufferSize */
|
||||
16, /* depthSize */
|
||||
0, /* stencilSize */
|
||||
0, /* auxBuffers */
|
||||
0, /* level */
|
||||
GLX_NONE, /* visualRating */
|
||||
GLX_NONE, /* transparentPixel */
|
||||
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
|
||||
0 /* transparentIndex */
|
||||
},
|
||||
/* [1] = RGB, double buffered, Z, stencil, accum */
|
||||
{
|
||||
-1, /* vid */
|
||||
-1, /* class */
|
||||
True, /* rgba */
|
||||
-1, -1, -1, 0, /* rgba sizes */
|
||||
-1, -1, -1, 0, /* rgba masks */
|
||||
16, 16, 16, 0, /* rgba accum sizes */
|
||||
True, /* doubleBuffer */
|
||||
False, /* stereo */
|
||||
-1, /* bufferSize */
|
||||
16, /* depthSize */
|
||||
8, /* stencilSize */
|
||||
0, /* auxBuffers */
|
||||
0, /* level */
|
||||
GLX_NONE, /* visualRating */
|
||||
GLX_NONE, /* transparentPixel */
|
||||
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
|
||||
0 /* transparentIndex */
|
||||
},
|
||||
/* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
|
||||
{
|
||||
-1, /* vid */
|
||||
-1, /* class */
|
||||
True, /* rgba */
|
||||
-1, -1, -1, 8, /* rgba sizes */
|
||||
-1, -1, -1, -1, /* rgba masks */
|
||||
16, 16, 16, 16, /* rgba accum sizes */
|
||||
True, /* doubleBuffer */
|
||||
False, /* stereo */
|
||||
-1, /* bufferSize */
|
||||
16, /* depthSize */
|
||||
8, /* stencilSize */
|
||||
0, /* auxBuffers */
|
||||
0, /* level */
|
||||
GLX_NONE, /* visualRating */
|
||||
GLX_NONE, /* transparentPixel */
|
||||
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
|
||||
0 /* transparentIndex */
|
||||
},
|
||||
/* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
|
||||
{
|
||||
-1, /* vid */
|
||||
-1, /* class */
|
||||
True, /* rgba */
|
||||
-1, -1, -1, 8, /* rgba sizes */
|
||||
-1, -1, -1, -1, /* rgba masks */
|
||||
16, 16, 16, 16, /* rgba accum sizes */
|
||||
False, /* doubleBuffer */
|
||||
False, /* stereo */
|
||||
-1, /* bufferSize */
|
||||
16, /* depthSize */
|
||||
8, /* stencilSize */
|
||||
0, /* auxBuffers */
|
||||
0, /* level */
|
||||
GLX_NONE, /* visualRating */
|
||||
GLX_NONE, /* transparentPixel */
|
||||
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
|
||||
0 /* transparentIndex */
|
||||
},
|
||||
/* [4] = CI, double buffered, Z */
|
||||
{
|
||||
-1, /* vid */
|
||||
-1, /* class */
|
||||
False, /* rgba? (false = color index) */
|
||||
-1, -1, -1, 0, /* rgba sizes */
|
||||
-1, -1, -1, 0, /* rgba masks */
|
||||
0, 0, 0, 0, /* rgba accum sizes */
|
||||
True, /* doubleBuffer */
|
||||
False, /* stereo */
|
||||
-1, /* bufferSize */
|
||||
16, /* depthSize */
|
||||
0, /* stencilSize */
|
||||
0, /* auxBuffers */
|
||||
0, /* level */
|
||||
GLX_NONE, /* visualRating */
|
||||
GLX_NONE, /* transparentPixel */
|
||||
0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
|
||||
0 /* transparentIndex */
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
|
||||
VisualID *defaultVisp,
|
||||
int ndepth, DepthPtr pdepth,
|
||||
int rootDepth)
|
||||
{
|
||||
int numRGBconfigs;
|
||||
int numCIconfigs;
|
||||
int numVisuals = *nvisualp;
|
||||
int numNewVisuals;
|
||||
int numNewConfigs;
|
||||
VisualPtr pVisual = *visualp;
|
||||
VisualPtr pVisualNew = NULL;
|
||||
VisualID *orig_vid = NULL;
|
||||
__GLcontextModes *modes;
|
||||
__GLXvisualConfig *pNewVisualConfigs = NULL;
|
||||
void **glXVisualPriv;
|
||||
void **pNewVisualPriv;
|
||||
int found_default;
|
||||
int i, j, k;
|
||||
|
||||
if (numConfigs > 0)
|
||||
numNewConfigs = numConfigs;
|
||||
else
|
||||
numNewConfigs = NUM_FALLBACK_CONFIGS;
|
||||
|
||||
/* Alloc space for the list of new GLX visuals */
|
||||
pNewVisualConfigs = (__GLXvisualConfig *)
|
||||
__glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
|
||||
if (!pNewVisualConfigs) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Alloc space for the list of new GLX visual privates */
|
||||
pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *));
|
||||
if (!pNewVisualPriv) {
|
||||
__glXFree(pNewVisualConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** If SetVisualConfigs was not called, then use default GLX
|
||||
** visual configs.
|
||||
*/
|
||||
if (numConfigs == 0) {
|
||||
memcpy(pNewVisualConfigs, FallbackConfigs,
|
||||
NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
|
||||
memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
|
||||
}
|
||||
else {
|
||||
/* copy driver's visual config info */
|
||||
for (i = 0; i < numConfigs; i++) {
|
||||
pNewVisualConfigs[i] = visualConfigs[i];
|
||||
pNewVisualPriv[i] = visualPrivates[i];
|
||||
}
|
||||
}
|
||||
|
||||
/* Count the number of RGB and CI visual configs */
|
||||
numRGBconfigs = 0;
|
||||
numCIconfigs = 0;
|
||||
for (i = 0; i < numNewConfigs; i++) {
|
||||
if (pNewVisualConfigs[i].rgba)
|
||||
numRGBconfigs++;
|
||||
else
|
||||
numCIconfigs++;
|
||||
}
|
||||
|
||||
/* Count the total number of visuals to compute */
|
||||
numNewVisuals = 0;
|
||||
for (i = 0; i < numVisuals; i++) {
|
||||
numNewVisuals +=
|
||||
(pVisual[i].class == TrueColor || pVisual[i].class == DirectColor)
|
||||
? numRGBconfigs : numCIconfigs;
|
||||
}
|
||||
|
||||
/* Reset variables for use with the next screen/driver's visual configs */
|
||||
visualConfigs = NULL;
|
||||
numConfigs = 0;
|
||||
|
||||
/* Alloc temp space for the list of orig VisualIDs for each new visual */
|
||||
orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
|
||||
if (!orig_vid) {
|
||||
__glXFree(pNewVisualPriv);
|
||||
__glXFree(pNewVisualConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Alloc space for the list of glXVisuals */
|
||||
modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
|
||||
if (modes == NULL) {
|
||||
__glXFree(orig_vid);
|
||||
__glXFree(pNewVisualPriv);
|
||||
__glXFree(pNewVisualConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Alloc space for the list of glXVisualPrivates */
|
||||
glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
|
||||
if (!glXVisualPriv) {
|
||||
_gl_context_modes_destroy( modes );
|
||||
__glXFree(orig_vid);
|
||||
__glXFree(pNewVisualPriv);
|
||||
__glXFree(pNewVisualConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Alloc space for the new list of the X server's visuals */
|
||||
pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
|
||||
if (!pVisualNew) {
|
||||
__glXFree(glXVisualPriv);
|
||||
_gl_context_modes_destroy( modes );
|
||||
__glXFree(orig_vid);
|
||||
__glXFree(pNewVisualPriv);
|
||||
__glXFree(pNewVisualConfigs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Initialize the new visuals */
|
||||
found_default = FALSE;
|
||||
screenVisuals[screenInfo.numScreens-1].modes = modes;
|
||||
for (i = j = 0; i < numVisuals; i++) {
|
||||
int is_rgb = (pVisual[i].class == TrueColor ||
|
||||
pVisual[i].class == DirectColor);
|
||||
|
||||
for (k = 0; k < numNewConfigs; k++) {
|
||||
if (pNewVisualConfigs[k].rgba != is_rgb)
|
||||
continue;
|
||||
|
||||
assert( modes != NULL );
|
||||
|
||||
/* Initialize the new visual */
|
||||
pVisualNew[j] = pVisual[i];
|
||||
pVisualNew[j].vid = FakeClientID(0);
|
||||
|
||||
/* Check for the default visual */
|
||||
if (!found_default && pVisual[i].vid == *defaultVisp) {
|
||||
*defaultVisp = pVisualNew[j].vid;
|
||||
found_default = TRUE;
|
||||
}
|
||||
|
||||
/* Save the old VisualID */
|
||||
orig_vid[j] = pVisual[i].vid;
|
||||
|
||||
/* Initialize the glXVisual */
|
||||
_gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
|
||||
modes->visualID = pVisualNew[j].vid;
|
||||
if (modes->fbconfigID == GLX_DONT_CARE)
|
||||
modes->fbconfigID = modes->visualID;
|
||||
|
||||
/*
|
||||
* If the class is -1, then assume the X visual information
|
||||
* is identical to what GLX needs, and take them from the X
|
||||
* visual. NOTE: if class != -1, then all other fields MUST
|
||||
* be initialized.
|
||||
*/
|
||||
if (modes->visualType == GLX_NONE) {
|
||||
modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
|
||||
modes->redBits = count_bits(pVisual[i].redMask);
|
||||
modes->greenBits = count_bits(pVisual[i].greenMask);
|
||||
modes->blueBits = count_bits(pVisual[i].blueMask);
|
||||
modes->alphaBits = modes->alphaBits;
|
||||
modes->redMask = pVisual[i].redMask;
|
||||
modes->greenMask = pVisual[i].greenMask;
|
||||
modes->blueMask = pVisual[i].blueMask;
|
||||
modes->alphaMask = modes->alphaMask;
|
||||
modes->rgbBits = (is_rgb)
|
||||
? (modes->redBits + modes->greenBits +
|
||||
modes->blueBits + modes->alphaBits)
|
||||
: rootDepth;
|
||||
}
|
||||
|
||||
/* Save the device-dependent private for this visual */
|
||||
glXVisualPriv[j] = pNewVisualPriv[k];
|
||||
|
||||
j++;
|
||||
modes = modes->next;
|
||||
}
|
||||
}
|
||||
|
||||
assert(j <= numNewVisuals);
|
||||
|
||||
/* Save the GLX visuals in the screen structure */
|
||||
screenVisuals[screenInfo.numScreens-1].num_vis = numNewVisuals;
|
||||
screenVisuals[screenInfo.numScreens-1].private = glXVisualPriv;
|
||||
|
||||
/* Set up depth's VisualIDs */
|
||||
for (i = 0; i < ndepth; i++) {
|
||||
int numVids = 0;
|
||||
VisualID *pVids = NULL;
|
||||
int k, n = 0;
|
||||
|
||||
/* Count the new number of VisualIDs at this depth */
|
||||
for (j = 0; j < pdepth[i].numVids; j++)
|
||||
for (k = 0; k < numNewVisuals; k++)
|
||||
if (pdepth[i].vids[j] == orig_vid[k])
|
||||
numVids++;
|
||||
|
||||
/* Allocate a new list of VisualIDs for this depth */
|
||||
pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
|
||||
|
||||
/* Initialize the new list of VisualIDs for this depth */
|
||||
for (j = 0; j < pdepth[i].numVids; j++)
|
||||
for (k = 0; k < numNewVisuals; k++)
|
||||
if (pdepth[i].vids[j] == orig_vid[k])
|
||||
pVids[n++] = pVisualNew[k].vid;
|
||||
|
||||
/* Update this depth's list of VisualIDs */
|
||||
__glXFree(pdepth[i].vids);
|
||||
pdepth[i].vids = pVids;
|
||||
pdepth[i].numVids = numVids;
|
||||
}
|
||||
|
||||
/* Update the X server's visuals */
|
||||
*nvisualp = numNewVisuals;
|
||||
*visualp = pVisualNew;
|
||||
|
||||
/* Free the old list of the X server's visuals */
|
||||
__glXFree(pVisual);
|
||||
|
||||
/* Clean up temporary allocations */
|
||||
__glXFree(orig_vid);
|
||||
__glXFree(pNewVisualPriv);
|
||||
__glXFree(pNewVisualConfigs);
|
||||
|
||||
/* Free the private list created by DDX HW driver */
|
||||
if (visualPrivates)
|
||||
xfree(visualPrivates);
|
||||
visualPrivates = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void GlxSetVisualConfigs(int nconfigs,
|
||||
__GLXvisualConfig *configs, void **privates)
|
||||
{
|
||||
numConfigs = nconfigs;
|
||||
visualConfigs = configs;
|
||||
visualPrivates = privates;
|
||||
}
|
||||
|
||||
static miInitVisualsProcPtr saveInitVisualsProc;
|
||||
|
||||
static Bool __glXInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
|
||||
int *nvisualp, int *ndepthp,
|
||||
int *rootDepthp, VisualID *defaultVisp,
|
||||
unsigned long sizes, int bitsPerRGB,
|
||||
int preferredVis)
|
||||
{
|
||||
Bool ret;
|
||||
|
||||
if (saveInitVisualsProc) {
|
||||
ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
|
||||
rootDepthp, defaultVisp, sizes, bitsPerRGB,
|
||||
preferredVis);
|
||||
if (!ret)
|
||||
return False;
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup the visuals supported by this particular screen.
|
||||
*/
|
||||
return init_visuals(nvisualp, visualp, defaultVisp,
|
||||
*ndepthp, *depthp, *rootDepthp);
|
||||
}
|
||||
|
||||
void
|
||||
GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
|
||||
{
|
||||
saveInitVisualsProc = *initVisProc;
|
||||
*initVisProc = __glXInitVisuals;
|
||||
}
|
||||
|
||||
static void fixup_visuals(int screen)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[screen];
|
||||
ScreenVisuals *psv = &screenVisuals[screen];
|
||||
int j;
|
||||
__GLcontextModes *modes;
|
||||
|
||||
for ( modes = psv->modes ; modes != NULL ; modes = modes->next ) {
|
||||
const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
|
||||
const int nplanes = (modes->rgbBits - modes->alphaBits);
|
||||
const VisualPtr pVis = pScreen->visuals;
|
||||
|
||||
/* Find a visual that matches the GLX visual's class and size */
|
||||
for (j = 0; j < pScreen->numVisuals; j++) {
|
||||
if (pVis[j].class == vis_class &&
|
||||
pVis[j].nplanes == nplanes) {
|
||||
|
||||
/* Fixup the masks */
|
||||
modes->redMask = pVis[j].redMask;
|
||||
modes->greenMask = pVis[j].greenMask;
|
||||
modes->blueMask = pVis[j].blueMask;
|
||||
|
||||
/* Recalc the sizes */
|
||||
modes->redBits = count_bits(modes->redMask);
|
||||
modes->greenBits = count_bits(modes->greenMask);
|
||||
modes->blueBits = count_bits(modes->blueMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __glXVisualsInitScreen(__GLXscreenInfo *info, int screen)
|
||||
{
|
||||
info->modes = screenVisuals[screen].modes;
|
||||
info->pVisualPriv = screenVisuals[screen].private;
|
||||
info->numVisuals = screenVisuals[screen].num_vis;
|
||||
info->numUsableVisuals = screenVisuals[screen].num_vis;
|
||||
fixup_visuals(screen);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void __glXVisualsReset(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
_gl_context_modes_destroy(screenVisuals[i].modes );
|
||||
screenVisuals[i].modes = NULL;
|
||||
__glXFree(screenVisuals[i].private);
|
||||
screenVisuals[i].private = NULL;
|
||||
screenVisuals[i].num_vis = 0;
|
||||
}
|
||||
}
|
||||
33
GL/glx/glxvisuals.h
Normal file
33
GL/glx/glxvisuals.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright © 2005 Red Hat, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* RED HAT, INC, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __GLX_VISUALS_H__
|
||||
#define __GLX_VISUALS_H__
|
||||
|
||||
void __glXVisualsInitScreen(__GLXscreenInfo *info, int screen);
|
||||
|
||||
void GlxSetVisualConfigs(int nconfigs,
|
||||
__GLXvisualConfig *configs, void **privates);
|
||||
|
||||
#endif /* __GLX_VISUALS_H__ */
|
||||
|
|
@ -535,7 +535,7 @@ if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
|
|||
PKG_CHECK_MODULES([XLIB], [x11])
|
||||
AC_SUBST(XLIB_CFLAGS)
|
||||
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
|
||||
GLX_LIBS='$(top_builddir)/GL/glx/libglx.la $(top_builddir)/GL/mesa/libGLcore.la'
|
||||
GLX_LIBS='$(top_builddir)/GL/glx/libglx.la'
|
||||
test -d GL || mkdir GL
|
||||
$srcdir/GL/symlink-mesa.sh $MESA_SOURCE GL/
|
||||
if test $? -ne 0; then
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la
|
|||
SUBDIRS = extmod
|
||||
|
||||
if GLX
|
||||
GLXMODS = libglx.la libGLcore.la
|
||||
GLXMODS = libglx.la
|
||||
endif
|
||||
|
||||
if XTRAP
|
||||
|
|
@ -44,10 +44,6 @@ INCLUDES = @XORG_INCS@ \
|
|||
-I$(top_srcdir)/hw/xfree86/loader \
|
||||
-I$(top_srcdir)/miext/shadow
|
||||
|
||||
libGLcore_la_LDFLAGS = -avoid-version
|
||||
libGLcore_la_LIBADD = $(top_builddir)/GL/mesa/libGLcore.la
|
||||
libGLcore_la_SOURCES = GLcoremodule.c
|
||||
|
||||
libafb_la_LDFLAGS = -avoid-version
|
||||
libafb_la_LIBADD = $(top_builddir)/afb/libafb.la
|
||||
libafb_la_SOURCES = afbmodule.c
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -43,6 +43,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "xf86_ansic.h"
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -1057,6 +1058,11 @@ DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable)
|
|||
if (pDrawable->type == DRAWABLE_WINDOW) {
|
||||
pWin = (WindowPtr)pDrawable;
|
||||
pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
|
||||
/* Workaround to handle the case where both the DRI resource
|
||||
* cleanup and the glx resource clean up calls this
|
||||
* function. */
|
||||
if (pDRIDrawablePriv == NULL)
|
||||
return TRUE;
|
||||
pDRIDrawablePriv->refCount--;
|
||||
if (pDRIDrawablePriv->refCount <= 0) {
|
||||
/* This calls back DRIDrawablePrivDelete which frees private area */
|
||||
|
|
@ -1905,6 +1911,53 @@ DRIUnlock(ScreenPtr pScreen)
|
|||
DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext);
|
||||
}
|
||||
|
||||
void
|
||||
DRIUnlockedCallback(DRICallback callback, void *data, int flags)
|
||||
{
|
||||
int blocked;
|
||||
int i;
|
||||
|
||||
blocked = xf86BlockSIGIO();
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
ScreenPtr pScreen = screenInfo.screens[i];
|
||||
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
||||
|
||||
if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
|
||||
/* hide X context by swapping 2D component here */
|
||||
(*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
|
||||
DRI_2D_SYNC,
|
||||
DRI_NO_CONTEXT,
|
||||
NULL,
|
||||
DRI_2D_CONTEXT,
|
||||
pDRIPriv->partial3DContextStore);
|
||||
}
|
||||
|
||||
DRIUnlock(pScreen);
|
||||
}
|
||||
|
||||
callback(data);
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
ScreenPtr pScreen = screenInfo.screens[i];
|
||||
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
||||
|
||||
DRILock(pScreen, 0);
|
||||
|
||||
if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
|
||||
/* hide X context by swapping 2D component here */
|
||||
(*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
|
||||
DRI_3D_SYNC,
|
||||
DRI_2D_CONTEXT,
|
||||
pDRIPriv->partial3DContextStore,
|
||||
DRI_2D_CONTEXT,
|
||||
pDRIPriv->hiddenContextStore);
|
||||
}
|
||||
}
|
||||
|
||||
xf86UnblockSIGIO(blocked);
|
||||
}
|
||||
|
||||
void *
|
||||
DRIGetSAREAPrivate(ScreenPtr pScreen)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#ifndef _DRI_H_
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "xf86dri.h"
|
||||
#include "drm.h"
|
||||
|
||||
typedef int DRISyncType;
|
||||
|
||||
|
|
@ -306,6 +306,9 @@ extern void DRILock(ScreenPtr pScreen, int flags);
|
|||
|
||||
extern void DRIUnlock(ScreenPtr pScreen);
|
||||
|
||||
typedef void (*DRICallback)(void *);
|
||||
extern void DRIUnlockedCallback(DRICallback callback, void *data, int flags);
|
||||
|
||||
extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
|
||||
|
||||
extern void *DRIGetSAREAPrivate(ScreenPtr pScreen);
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ xf86cos(double x)
|
|||
|
||||
|
||||
|
||||
$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.10 2001/12/17 20:00:45 dawes Exp $
|
||||
$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.9 2001/07/23 13:15:48 dawes Exp $
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.h,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
|
||||
/* $XFree86$ */
|
||||
|
||||
extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
|
||||
CARD8 *pModMap);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.3,v 1.1 2000/02/11 18:06:50 dawes Exp $
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usb.3,v 1.1.2.2 1999/12/03 10:12:42 hohndel Exp $
|
||||
.\"
|
||||
.Dd May 11, 1999
|
||||
.Dt USB 3
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usb.h,v 1.1.2.2 1999/12/03 10:12:43 hohndel Exp $ */
|
||||
|
||||
#define _DIAGASSERT(e) assert(e)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usbvar.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usbvar.h,v 1.1.2.2 1999/12/03 10:12:43 hohndel Exp $ */
|
||||
|
||||
struct report_desc {
|
||||
unsigned int size;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.h,v 1.1 2002/10/11 01:40:35 dawes Exp $ */
|
||||
/* $XFree86$ */
|
||||
|
||||
extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
|
||||
CARD8 *pModMap);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.c,v 1.1 2002/12/14 04:41:14 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.S,v 1.1 1999/07/10 07:24:49 dawes Exp $ */
|
||||
/*
|
||||
* Copyright 1998 by Metro Link Incorporated
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.S,v 1.1 1999/07/10 07:24:50 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.s,v 1.2 1998/07/25 16:56:49 dawes Exp $ */
|
||||
/*******************************************************************************
|
||||
Copyright 1994 by Glenn G. Lai
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.S,v 1.1 1999/07/10 07:24:51 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.s,v 1.2 1998/07/25 16:56:50 dawes Exp $ */
|
||||
/*******************************************************************************
|
||||
Copyright 1994 by Glenn G. Lai
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.S,v 1.1 1999/07/10 07:24:52 dawes Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.s,v 3.5 1996/12/23 06:50:58 dawes Exp $ */
|
||||
|
||||
#include "assyntax.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $
|
||||
/ $XFree86$
|
||||
/
|
||||
/ Copyright 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
|
||||
/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue