Commit be2e0d8a authored by brianp's avatar brianp
Browse files

removed - obsolete

parent 9828dbde
This diff is collapsed.
/* $XFree86: xc/lib/GL/dri/dri_mesa.h,v 1.1 1999/06/14 07:23:31 dawes Exp $ */
/**************************************************************************
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 PRECISION INSIGHT AND/OR ITS 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>
*
* $PI: xc/lib/GL/dri/dri_mesa.h,v 1.5 1999/04/05 05:24:31 martin Exp $
*/
#ifndef _DRI_MESA_H_
#define _DRI_MESA_H_
#ifdef GLX_DIRECT_RENDERING
typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate;
typedef struct __DRIscreenPrivateRec __DRIscreenPrivate;
typedef struct __DRIvisualPrivateRec __DRIvisualPrivate;
typedef struct __DRIcontextPrivateRec __DRIcontextPrivate;
typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate;
#endif
#endif /* _DRI_MESA_H_ */
/* $XFree86: xc/lib/GL/dri/dri_mesa_init.c,v 1.2 1999/06/27 14:07:23 dawes Exp $ */
/**************************************************************************
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 PRECISION INSIGHT AND/OR ITS 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>
*
* $PI: xc/lib/GL/dri/dri_mesa_init.c,v 1.5 1999/06/21 05:13:54 martin Exp $
*/
#ifdef GLX_DIRECT_RENDERING
#ifdef GLX_USE_DLOPEN
#include <stdio.h>
#include <dlfcn.h>
#endif
#include "dri_mesa.h"
#include "dri_xmesaapi.h"
#include "dri_mesa_init.h"
int dlopen_error;
#ifdef GLX_USE_DLOPEN
static void *resolveSymbol(void *handle, char *name)
{
char *error;
void *func;
func = dlsym(handle, name);
if ((error = dlerror()) != NULL) {
fputs(error, stderr);
fputs("\n", stderr);
dlopen_error = True;
return NULL;
}
return func;
}
#endif
void *driMesaInitAPI(char *name, __XMESAapi *XMesaAPI)
{
void *handle = (void *)NULL;
#ifdef GLX_USE_DLOPEN
char libname[256];
dlopen_error = False;
if (name) {
snprintf(libname, 256, "%s_dri.so", name);
} else {
return NULL;
}
handle = dlopen(libname, RTLD_NOW);
if (!handle) {
fputs(dlerror(), stderr);
fputs("\n", stderr);
return NULL;
}
XMesaAPI->InitDriver = resolveSymbol(handle, "XMesaInitDriver");
XMesaAPI->ResetDriver = resolveSymbol(handle, "XMesaResetDriver");
XMesaAPI->CreateVisual = resolveSymbol(handle, "XMesaCreateVisual");
XMesaAPI->DestroyVisual = resolveSymbol(handle, "XMesaDestroyVisual");
XMesaAPI->CreateContext = resolveSymbol(handle, "XMesaCreateContext");
XMesaAPI->DestroyContext = resolveSymbol(handle, "XMesaDestroyContext");
XMesaAPI->CreateWindowBuffer =
resolveSymbol(handle, "XMesaCreateWindowBuffer");
XMesaAPI->CreatePixmapBuffer =
resolveSymbol(handle, "XMesaCreatePixmapBuffer");
XMesaAPI->DestroyBuffer = resolveSymbol(handle, "XMesaDestroyBuffer");
XMesaAPI->SwapBuffers = resolveSymbol(handle, "XMesaSwapBuffers");
XMesaAPI->MakeCurrent = resolveSymbol(handle, "XMesaMakeCurrent");
#else
XMesaAPI->InitDriver = XMesaInitDriver;
XMesaAPI->ResetDriver = XMesaResetDriver;
XMesaAPI->CreateVisual = XMesaCreateVisual;
XMesaAPI->DestroyVisual = XMesaDestroyVisual;
XMesaAPI->CreateContext = XMesaCreateContext;
XMesaAPI->DestroyContext = XMesaDestroyContext;
XMesaAPI->CreateWindowBuffer = XMesaCreateWindowBuffer;
XMesaAPI->CreatePixmapBuffer = XMesaCreatePixmapBuffer;
XMesaAPI->DestroyBuffer = XMesaDestroyBuffer;
XMesaAPI->SwapBuffers = XMesaSwapBuffers;
XMesaAPI->MakeCurrent = XMesaMakeCurrent;
handle = (void *)1;
#endif
if (dlopen_error) {
return NULL;
}
return handle;
}
void driMesaDestroyAPI(void *handle)
{
#ifdef GLX_USE_DLOPEN
if (handle) dlclose(handle);
#endif
}
#endif
/* $XFree86: xc/lib/GL/dri/dri_mesa_init.h,v 1.1 1999/06/14 07:23:32 dawes Exp $ */
/**************************************************************************
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 PRECISION INSIGHT AND/OR ITS 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>
*
* $PI: xc/lib/GL/dri/dri_mesa_init.h,v 1.2 1999/04/05 05:24:31 martin Exp $
*/
#ifndef _DRI_MESA_INIT_H_
#define _DRI_MESA_INIT_H_
#ifdef GLX_DIRECT_RENDERING
#include "dri_xmesaapi.h"
extern void *driMesaInitAPI(char *name, __XMESAapi *xmesa);
extern void driMesaDestroyAPI(void *handle);
#endif
#endif /* _DRI_MESA_INIT_H_ */
/* $XFree86: xc/lib/GL/dri/dri_mesaint.h,v 1.2 1999/06/27 14:07:23 dawes Exp $ */
/**************************************************************************
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 PRECISION INSIGHT AND/OR ITS 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>
*
* $PI: xc/lib/GL/dri/dri_mesaint.h,v 1.8 1999/06/14 21:10:35 faith Exp $
*/
#ifndef _DRI_MESAINT_H_
#define _DRI_MESAINT_H_
#ifdef GLX_DIRECT_RENDERING
#include <GL/glx.h>
#include "xf86dri.h"
#include "sarea.h"
#include "GL/xmesa.h"
#include "dri_mesa.h"
#include "dri_xmesaapi.h"
#define DRI_MESA_VALIDATE_DRAWABLE_INFO(dpy,scrn,pDrawPriv) \
do { \
if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \
driMesaUpdateDrawableInfo(dpy,scrn,pDrawPriv); \
} \
} while (0)
struct __DRIdrawablePrivateRec {
/*
** Kernel drawable handle (not currently used).
*/
drmDrawable hHWDrawable;
/*
** Mesa's private context information. This structure is opaque.
*/
XMesaBuffer xm_buf;
/*
** X's drawable ID associated with this private drawable.
*/
GLXDrawable draw;
/*
** Reference count for number of context's currently bound to this
** drawable. Once the refcount reaches 0, the drawable can be
** destroyed. This behavior will change with GLX 1.3.
*/
int refcount;
/*
** Index of this drawable's information in the SAREA.
*/
unsigned int index;
/*
** Pointer to the "drawable has changed ID" stamp in the SAREA.
*/
unsigned int *pStamp;
/*
** Last value of the stamp. If this differs from the value stored
** at *pStamp, then the drawable information has been modified by
** the X server, and the drawable information (below) should be
** retrieved from the X server.
*/
unsigned int lastStamp;
/*
** Drawable information used in software fallbacks.
*/
int x;
int y;
int w;
int h;
int numClipRects;
XF86DRIClipRectPtr pClipRects;
/*
** Pointer to context to which this drawable is currently bound.
*/
__DRIcontextPrivate *driContextPriv;
/*
** Pointer to screen on which this drawable was created.
*/
__DRIscreenPrivate *driScreenPriv;
};
struct __DRIcontextPrivateRec {
/*
** Kernel context handle used to access the device lock.
*/
XID contextID;
/*
** Kernel context handle used to access the device lock.
*/
drmContext hHWContext;
/*
** Mesa's private context information. This structure is opaque.
*/
XMesaContext xm_ctx;
/*
** Pointer to drawable currently bound to this context.
*/
__DRIdrawablePrivate *driDrawablePriv;
/*
** Pointer to screen on which this context was created.
*/
__DRIscreenPrivate *driScreenPriv;
};
struct __DRIvisualPrivateRec {
/*
** Mesa's private visual information. This structure is opaque.
*/
XMesaVisual xm_vis;
/*
** X's visual ID associated with this private visual.
*/
VisualID vid;
};
struct __DRIscreenPrivateRec {
/*
** Current screen's number
*/
int myNum;
/*
** Core rendering library's visuals associated with the current
** screen.
*/
__DRIvisualPrivate *visuals;
int numVisuals;
/*
** Function pointers associated with the core rendering library's GL
** and GLX functions. The handle to the library is saved so that it
** can be closed when it is no longer needed.
*/
void *hLibrary;
__XMESAapi XMesaAPI;
/*
** Core rendering library's driver version information.
*/
int major;
int minor;
int patch;
/*
** ID used when the client sets the drawable lock. The X server
** uses this value to detect if the client has died while holding
** the drawable lock.
*/
int drawLockID;
/*
** File descriptor returned when the kernel device driver is opened.
** It is used to:
** - authenticate client to kernel
** - map the frame buffer, SAREA, etc.
** - close the kernel device driver
*/
int fd;
/*
** SAREA pointer used to access:
** - the device lock
** - the device-independent per-drawable and per-context(?) information
*/
XF86DRISAREAPtr pSAREA;
/*
** Direct frame buffer access information used for software
** fallbacks.
*/
unsigned char *pFB;
int fbSize;
int fbOrigin;
int fbStride;
int fbWidth;
int fbHeight;
int fbBPP;
/*
** Device-dependent private information (stored in the SAREA). This
** data is accessed by the client driver only.
*/
void *pDevPriv;
int devPrivSize;
/*
** Dummy context to which drawables are bound when not bound to any
** other context. A dummy hHWContext is created for this context,
** and is used by the GL core when a HW lock is required but the
** drawable is not currently bound (e.g., potentially during a
** SwapBuffers request). The dummy context is created when the
** first "real" context is created on this screen.
*/
__DRIcontextPrivate dummyContextPriv;
/*
** Device-dependent private information (not stored in the SAREA).
** This pointer is never touched by the DRI layer.
*/
void *private;
};
struct __DRIdisplayPrivateRec {
/*
** XFree86-DRI version information
*/
int major;
int minor;
int patch;
};
extern void driMesaUpdateDrawableInfo(Display *dpy, int scrn,
__DRIdrawablePrivate *pdp);
#endif
#endif /* _DRI_MESAINT_H_ */
/* $XFree86: xc/lib/GL/dri/dri_xmesaapi.h,v 1.1 1999/06/14 07:23:33 dawes Exp $ */
/**************************************************************************
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 PRECISION INSIGHT AND/OR ITS 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>
*
* $PI: xc/lib/GL/dri/dri_xmesaapi.h,v 1.4 1999/04/05 05:24:31 martin Exp $
*/
#ifndef _DRI_XMESAAPI_H_
#define _DRI_XMESAAPI_H_
#ifdef GLX_DIRECT_RENDERING
#include "GL/xmesa.h"
#include "dri_mesa.h"
typedef struct __XMESAapiRec __XMESAapi;
struct __XMESAapiRec {
/* XMESA Functions */
GLboolean (*InitDriver)(__DRIscreenPrivate *driScrnPriv);
void (*ResetDriver)(__DRIscreenPrivate *driScrnPriv);
XMesaVisual (*CreateVisual)(XMesaDisplay *display,
XMesaVisualInfo visinfo,
GLboolean rgb_flag,
GLboolean alpha_flag,
GLboolean db_flag,
GLboolean stereo_flag,
GLboolean ximage_flag,
GLint depth_size,
GLint stencil_size,
GLint accum_size,
GLint level);
void (*DestroyVisual)(XMesaVisual v);
XMesaContext (*CreateContext)(XMesaVisual v, XMesaContext share_list,
__DRIcontextPrivate *driContextPriv);
void (*DestroyContext)(XMesaContext c);
XMesaBuffer (*CreateWindowBuffer)(XMesaVisual v, XMesaWindow w,
__DRIdrawablePrivate *driDrawPriv);
XMesaBuffer (*CreatePixmapBuffer)(XMesaVisual v, XMesaPixmap p,
XMesaColormap c,
__DRIdrawablePrivate *driDrawPriv);
void (*DestroyBuffer)(XMesaBuffer b);
void (*SwapBuffers)(XMesaBuffer b);
GLboolean (*MakeCurrent)(XMesaContext c, XMesaBuffer b);
};
#endif
#endif /* _DRI_XMESAAPI_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment