From: Jon S. <jon...@ya...> - 2004-05-11 16:14:43
|
KeithW, what's your opinion on this? I've been paying too much attention to the flame war about merging FB and DRM. The goal I'm trying to work towards is for OpenGL/mesa to be the primary API for implementing xserver on top. This plan also needs a helper lib for mode setting/cursor and other things not covered in OpenGL. Do this implies that mesa-solo needs build without any X dependencies. All of xserver will be implemented in the layers above. KeithP is on board with this plan. He just needs a function mesa-solo from us. Meanwhile he is working by using ATI's GLX driver and runnning his server inside of X. His goal is to demo an OpenGL based X server by OLS. Hopefully we can be part of the demo too. We still have to support the existing X server with the current sources and xserver will need to support GLX too. So given this plan, what's the best way to design these interfaces? --- Ian Romanick <id...@us...> wrote: > Ian Romanick wrote: > > Jon Smirl wrote: > > > >> Log message: > >> Fix solo build, add missing #ifdef NEW_INTERFACE > >> > >> Modified files: > >> Mesa/src/mesa/drivers/dri/i830/: > >> i830_screen.c > > > > There is no longer any need for NEW_INTERFACE. That was only needed > > when the libGL parts were on a branch of DRI CVS. They're on the trunk > > now. > > > > I had also thought that the "solo" libGL was going to be modified to use > > the new interface. The _SOLO define would essentially be replaced with > > DRI_NEW_INTERFACE_ONLY. That way the same driver binary could be used > > for both. The _SOLO stuff is an albatross I'd like to drop. > > Okay. Here is a *MAJOR* hack of a patch. This gets the i830 and r200 > drivers building most almost all of the X11-specific stuff gone. In > addition to this patch file, you will need to copy > xc/include/GL/glxtokens.h from DRI CVS to include/GL in Mesa CVS. This > is pretty close to the way I think it should go. > > - Replaced all occurances of XID, Drawable, and GLXDrawable with __DRIid. > > - Replaced all occurances of "Display *" with "__DRI_WS_Display *". > > - dri_interface.h include glxtokens.h and glcore.h includes gl.h. This > replaces several X11 / GLX include files in dri_interface.h. > > There are still some things that need to be fixed. _XF86DRIClipRect in > dri_interface.h needs to be replaced. Something needs to be done about > a prototype for glXGetProcAddress. > > The SOLO libGL will need to provide some of the other entry-points that > the XFree86 libGL provides. glXGetProcAddress is at the top of the > list, but there are a few others. Most of them are obtained by calling > glXGetProcAddress, so they are easy to identify. I *believe* they are > all isolated to dri_util.c and the *_screen.c files. It may be possible > to make some adjustments, but I have already tried to pull as much out > as I could. The stuff that is left remains only because I couldn't find > a way to remove it without really breaking things. > > We can discuss this more at the #dri-devel meeting tomorrow. I won't > commit anything before then. > > > Index: configs/linux-dri-x86 > =================================================================== > RCS file: /cvs/mesa/Mesa/configs/linux-dri-x86,v > retrieving revision 1.2 > diff -u -d -r1.2 linux-dri-x86 > --- a/configs/linux-dri-x86 4 May 2004 00:10:24 -0000 1.2 > +++ b/configs/linux-dri-x86 10 May 2004 05:34:51 -0000 > @@ -6,10 +6,10 @@ > CONFIG_NAME = linux-dri-x86 > > # Compiler and flags > -CC = gcc > -CXX = g++ > +CC = gcc3 > +CXX = g++3 > > -CFLAGS = -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math > -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE > -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS > -D_GNU_SOURCE -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions > +CFLAGS = -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math > -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L > -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM > -DUSE_SSE_ASM -DPTHREADS -D_GNU_SOURCE -I/usr/X11R6/include > -I/usr/X11R6/include/X11/extensions > > CXXFLAGS = -Wall -g -ansi -pedantic -fPIC -D_POSIX_SOURCE > -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE > > @@ -30,5 +30,6 @@ > > # Only savage missing: > # > -DRI_DIRS = dri_client ffb gamma i810 i830 mach64 mga r128 r200 radeon sis > tdfx unichrome > +#DRI_DIRS = dri_client ffb gamma i810 i830 mach64 mga r128 r200 radeon sis > tdfx unichrome > +DRI_DIRS = dri_client i830 r200 > > Index: src/mesa/drivers/dri/i830/i830_screen.c > =================================================================== > RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/i830/i830_screen.c,v > retrieving revision 1.7 > diff -u -d -r1.7 i830_screen.c > --- a/src/mesa/drivers/dri/i830/i830_screen.c 9 May 2004 04:38:42 -0000 1.7 > +++ b/src/mesa/drivers/dri/i830/i830_screen.c 10 May 2004 05:34:51 -0000 > @@ -384,7 +384,7 @@ > * The __driCreateScreen name is the symbol that libGL.so fetches. > * Return: pointer to a __DRIscreenPrivate. > */ > -#ifndef _SOLO > +#if !defined( _SOLO ) && !defined( DRI_NEW_INTERFACE_ONLY ) > void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, > int numConfigs, __GLXvisualConfig *config) > { > @@ -392,7 +392,7 @@ > psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i830API); > return (void *) psp; > } > -#else > +#elif defined( _SOLO ) > void *__driCreateScreen(struct DRIDriverRec *driver, > struct DRIDriverContextRec *driverContext) > { > @@ -551,7 +551,7 @@ > * failure. > */ > #ifdef USE_NEW_INTERFACE > -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, > +void * __driCreateNewScreen( __DRI_WS_Display *dpy, int scrn, __DRIscreen > *psc, > const __GLcontextModes * modes, > const __DRIversion * ddx_version, > const __DRIversion * dri_version, > Index: src/mesa/drivers/dri/r200/r200_screen.c > =================================================================== > RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_screen.c,v > retrieving revision 1.18 > diff -u -d -r1.18 r200_screen.c > --- a/src/mesa/drivers/dri/r200/r200_screen.c 29 Apr 2004 12:23:41 -0000 1.18 > +++ b/src/mesa/drivers/dri/r200/r200_screen.c 10 May 2004 05:34:51 -0000 > @@ -596,7 +596,7 @@ > * Return: pointer to a __DRIscreenPrivate. > * > */ > -#ifndef _SOLO > +#if !defined( _SOLO ) && !defined( DRI_NEW_INTERFACE_ONLY ) > void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, > int numConfigs, __GLXvisualConfig *config) > { > @@ -604,7 +604,7 @@ > psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r200API); > return (void *) psp; > } > -#else > +#elif defined( _SOLO ) > void *__driCreateScreen(struct DRIDriverRec *driver, > struct DRIDriverContextRec *driverContext) > { > @@ -626,7 +626,7 @@ > * failure. > */ > #ifdef USE_NEW_INTERFACE > -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, > +void * __driCreateNewScreen( __DRI_WS_Display *dpy, int scrn, __DRIscreen > *psc, > const __GLcontextModes * modes, > const __DRIversion * ddx_version, > const __DRIversion * dri_version, > Index: src/mesa/drivers/dri/r200/r200_ioctl.c > =================================================================== > RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.c,v > retrieving revision 1.13 > diff -u -d -r1.13 r200_ioctl.c > --- a/src/mesa/drivers/dri/r200/r200_ioctl.c 14 Apr 2004 08:25:57 -0000 1.13 > +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c 10 May 2004 05:34:52 -0000 > @@ -783,7 +783,7 @@ > * device fd. > */ > #ifndef _SOLO > -void *r200AllocateMemoryMESA(Display *dpy, int scrn, GLsizei size, > +void *r200AllocateMemoryMESA(__DRI_WS_Display *dpy, int scrn, GLsizei size, > GLfloat readfreq, GLfloat writefreq, > GLfloat priority) > { > @@ -828,7 +828,7 @@ > > > /* Called via glXFreeMemoryMESA() */ > -void r200FreeMemoryMESA(Display *dpy, int scrn, GLvoid *pointer) > +void r200FreeMemoryMESA(__DRI_WS_Display *dpy, int scrn, GLvoid *pointer) > { > GET_CURRENT_CONTEXT(ctx); > r200ContextPtr rmesa; > @@ -868,7 +868,7 @@ > } > > /* Called via glXGetMemoryOffsetMESA() */ > -GLuint r200GetMemoryOffsetMESA(Display *dpy, int scrn, const GLvoid *pointer) > +GLuint r200GetMemoryOffsetMESA(__DRI_WS_Display *dpy, int scrn, const GLvoid > *pointer) > { > GET_CURRENT_CONTEXT(ctx); > r200ContextPtr rmesa; > Index: src/mesa/drivers/dri/r200/r200_ioctl.h > =================================================================== > RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r200/r200_ioctl.h,v > retrieving revision 1.7 > diff -u -d -r1.7 r200_ioctl.h > --- a/src/mesa/drivers/dri/r200/r200_ioctl.h 14 Apr 2004 08:25:57 -0000 1.7 > +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h 10 May 2004 05:34:52 -0000 > @@ -107,10 +107,10 @@ > extern void r200InitIoctlFuncs( struct dd_function_table *functions ); > > #ifndef _SOLO > -extern void *r200AllocateMemoryMESA( Display *dpy, int scrn, GLsizei size, > GLfloat readfreq, > +extern void *r200AllocateMemoryMESA( __DRI_WS_Display *dpy, int scrn, GLsizei > size, GLfloat readfreq, > GLfloat writefreq, GLfloat priority ); > -extern void r200FreeMemoryMESA( Display *dpy, int scrn, GLvoid *pointer ); > -extern GLuint r200GetMemoryOffsetMESA( Display *dpy, int scrn, const GLvoid > *pointer ); > +extern void r200FreeMemoryMESA( __DRI_WS_Display *dpy, int scrn, GLvoid > *pointer ); > +extern GLuint r200GetMemoryOffsetMESA( __DRI_WS_Display *dpy, int scrn, const > GLvoid *pointer ); > #endif > extern GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid > *pointer, > GLint size ); > Index: include/GL/internal/dri_interface.h > =================================================================== > RCS file: /cvs/mesa/Mesa/include/GL/internal/dri_interface.h,v > retrieving revision 1.3 > diff -u -d -r1.3 dri_interface.h > --- a/include/GL/internal/dri_interface.h 29 Apr 2004 12:23:39 -0000 1.3 > +++ b/include/GL/internal/dri_interface.h 10 May 2004 05:34:52 -0000 > @@ -38,12 +38,16 @@ > #ifndef DRI_INTERFACE_H > #define DRI_INTERFACE_H > > -/* FIXME: With a small amount of work, these two includes can be removed. */ > -#include <X11/Xlib.h> > -#include <GL/glx.h> > +#ifdef DRI_NEW_INTERFACE_ONLY > +#define USE_NEW_INTERFACE > +#endif > > #ifndef DRI_NEW_INTERFACE_ONLY > +#include <X11/Xlib.h> > +#include <GL/glx.h> > #include <GL/glxint.h> > +#else > +#include <GL/glxtokens.h> > #endif > > #include <GL/internal/glcore.h> > @@ -56,6 +60,7 @@ > * side library and the DRI (direct rendering infrastructure). > */ > === message truncated === ===== Jon Smirl jon...@ya... __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover |