diff options
Diffstat (limited to 'xc/lib/GL')
21 files changed, 127 insertions, 75 deletions
diff --git a/xc/lib/GL/dri/xf86dristr.h b/xc/lib/GL/dri/xf86dristr.h index d2e42a3e3..e380de8a9 100644 --- a/xc/lib/GL/dri/xf86dristr.h +++ b/xc/lib/GL/dri/xf86dristr.h @@ -42,7 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define XF86DRINAME "XFree86-DRI" -#define XF86DRI_MAJOR_VERSION 3 /* current version numbers */ +#define XF86DRI_MAJOR_VERSION 4 /* current version numbers */ #define XF86DRI_MINOR_VERSION 0 #define XF86DRI_PATCH_VERSION 0 diff --git a/xc/lib/GL/mesa/dri/dri_mesa.c b/xc/lib/GL/mesa/dri/dri_mesa.c index 57dc6a15f..dd9fdddc8 100644 --- a/xc/lib/GL/mesa/dri/dri_mesa.c +++ b/xc/lib/GL/mesa/dri/dri_mesa.c @@ -663,19 +663,6 @@ static void *driMesaCreateContext(Display *dpy, XVisualInfo *vis, void *shared, return NULL; } - if (!psp->dummyContextPriv.driScreenPriv) { - if (!XF86DRICreateContext(dpy, vis->screen, vis->visual, - &psp->dummyContextPriv.contextID, - &psp->dummyContextPriv.hHWContext)) { - return NULL; - } - psp->dummyContextPriv.driScreenPriv = psp; - psp->dummyContextPriv.mesaContext = NULL; - psp->dummyContextPriv.driDrawablePriv = NULL; - psp->dummyContextPriv.driverPrivate = NULL; - /* No other fields should be used! */ - } - /* Create the hash table */ if (!psp->drawHash) psp->drawHash = drmHashCreate(); @@ -695,6 +682,29 @@ static void *driMesaCreateContext(Display *dpy, XVisualInfo *vis, void *shared, return NULL; } + /* This is moved because the Xserver creates a global dummy context + * the first time XF86DRICreateContext is called. + */ + + if (!psp->dummyContextPriv.driScreenPriv) { +#if 0 + /* We no longer use this cause we have the shared dummyContext + * in the SAREA. + */ + if (!XF86DRICreateContext(dpy, vis->screen, vis->visual, + &psp->dummyContextPriv.contextID, + &psp->dummyContextPriv.hHWContext)) { + return NULL; + } +#endif + psp->dummyContextPriv.hHWContext = psp->pSAREA->dummy_context; + psp->dummyContextPriv.driScreenPriv = psp; + psp->dummyContextPriv.mesaContext = NULL; + psp->dummyContextPriv.driDrawablePriv = NULL; + psp->dummyContextPriv.driverPrivate = NULL; + /* No other fields should be used! */ + } + for (i = 0; i < psp->numVisuals; i++) { if (psp->visuals[i].vid == vis->visualid) { GLvisual *mesaVis = psp->visuals[i].mesaVisual; @@ -748,9 +758,9 @@ static void driMesaDestroyContext(Display *dpy, int scrn, void *contextPrivate) } } __driMesaGarbageCollectDrawables(pcp->driScreenPriv->drawHash); - (void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID); (*pcp->driScreenPriv->MesaAPI.DestroyContext)(pcp); gl_destroy_context(pcp->mesaContext); + (void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID); Xfree(pcp); } } diff --git a/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c b/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c index a442ee913..81fbc4c97 100644 --- a/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/gamma/gamma_xmesa.c @@ -59,9 +59,9 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) { int major, minor, patch; if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != 3 || minor != 0 || patch < 0) { + if (major != 3 || minor < 0) { char msg[1000]; - sprintf(msg, "gamma DRI driver expected DRI version 3.0.x but got version %d.%d.%d", major, minor, patch); + sprintf(msg, "gamma DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); __driMesaMessage(msg); return GL_FALSE; } @@ -70,8 +70,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) /* Check that the DDX driver version is compatible */ if (sPriv->ddxMajor != 1 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0) { + sPriv->ddxMinor < 0) { char msg[1000]; sprintf(msg, "gamma DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); __driMesaMessage(msg); @@ -80,8 +79,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) /* Check that the DRM driver version is compatible */ if (sPriv->drmMajor != 1 || - sPriv->drmMinor != 0 || - sPriv->drmPatch < 0) { + sPriv->drmMinor < 0) { char msg[1000]; sprintf(msg, "gamm DRI driver expected DRM driver version 1.0.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); __driMesaMessage(msg); diff --git a/xc/lib/GL/mesa/src/drv/i810/i810_init.h b/xc/lib/GL/mesa/src/drv/i810/i810_init.h index cdcdfd1b6..21c4f78d5 100644 --- a/xc/lib/GL/mesa/src/drv/i810/i810_init.h +++ b/xc/lib/GL/mesa/src/drv/i810/i810_init.h @@ -79,6 +79,7 @@ typedef struct { __DRIscreenPrivate *driScrnPriv; drmBufMapPtr bufs; int use_copy_buf; + unsigned int sarea_priv_offset; } i810ScreenPrivate; diff --git a/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c b/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c index 43d1d4973..2208de78a 100644 --- a/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/i810/i810_xmesa.c @@ -135,9 +135,9 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) { int major, minor, patch; if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != 3 || minor != 0 || patch < 0) { + if (major != 4 || minor < 0) { char msg[1000]; - sprintf(msg, "i810 DRI driver expected DRI version 3.0.x but got version %d.%d.%d", major, minor, patch); + sprintf(msg, "i810 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); __driMesaMessage(msg); return GL_FALSE; } @@ -146,8 +146,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) /* Check that the DDX driver version is compatible */ if (sPriv->ddxMajor != 1 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0) { + sPriv->ddxMinor < 0) { char msg[1000]; sprintf(msg, "i810 DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); __driMesaMessage(msg); @@ -156,8 +155,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) /* Check that the DRM driver version is compatible */ if (sPriv->drmMajor != 1 || - sPriv->drmMinor != 1 || - sPriv->drmPatch < 0) { + sPriv->drmMinor < 1) { char msg[1000]; sprintf(msg, "i810 DRI driver expected DRM driver version 1.0.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); __driMesaMessage(msg); @@ -244,6 +242,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) i810Screen->tex.handle = gDRIPriv->textures; i810Screen->tex.size = gDRIPriv->textureSize; + i810Screen->sarea_priv_offset = gDRIPriv->sarea_priv_offset; if (drmMap(sPriv->fd, i810Screen->tex.handle, @@ -316,7 +315,7 @@ GLboolean XMesaCreateContext( Display *dpy, GLvisual *mesaVis, __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; i810ScreenPrivate *i810Screen = (i810ScreenPrivate *)sPriv->private; drm_i810_sarea_t *saPriv=(drm_i810_sarea_t *)(((char*)sPriv->pSAREA)+ - sizeof(XF86DRISAREARec)); + i810Screen->sarea_priv_offset); imesa = (i810ContextPtr)Xcalloc(sizeof(i810Context), 1); if (!imesa) { diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c index 092cff055..d10969df4 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c @@ -107,9 +107,9 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) { int major, minor, patch; if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != 3 || minor != 0 || patch < 0) { + if (major != 4 || minor < 0) { char msg[1000]; - sprintf(msg, "MGA DRI driver expected DRI version 3.0.x but got version %d.%d.%d", major, minor, patch); + sprintf(msg, "MGA DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); __driMesaMessage(msg); return GL_FALSE; } @@ -118,8 +118,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) /* Check that the DDX driver version is compatible */ if (sPriv->ddxMajor != 1 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0) { + sPriv->ddxMinor < 0) { char msg[1000]; sprintf(msg, "MGA DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); __driMesaMessage(msg); @@ -128,8 +127,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) /* Check that the DRM driver version is compatible */ if (sPriv->drmMajor != 3 || - sPriv->drmMinor != 0 || - sPriv->drmPatch < 0) { + sPriv->drmMinor < 0) { char msg[1000]; sprintf(msg, "MGA DRI driver expected DRM driver version 3.0.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); __driMesaMessage(msg); @@ -250,6 +248,7 @@ GLboolean XMesaInitDriver(__DRIscreenPrivate *sPriv) __driMesaMessage("Couldn't map dma buffers"); return GL_FALSE; } + mgaScreen->sarea_priv_offset = serverInfo->sarea_priv_offset; mgaDDFastPathInit(); mgaDDEltPathInit(); @@ -313,7 +312,7 @@ GLboolean XMesaCreateContext( Display *dpy, GLvisual *mesaVis, __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *)sPriv->private; MGASAREAPrivPtr saPriv = (MGASAREAPrivPtr)(((char*)sPriv->pSAREA)+ - sizeof(XF86DRISAREARec)); + mgaScreen->sarea_priv_offset); if (MGA_DEBUG&DEBUG_VERBOSE_DRI) fprintf(stderr, "XMesaCreateContext\n"); diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h index d04b27dbf..5dcede8ec 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h +++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.h @@ -80,6 +80,7 @@ typedef struct mga_screen_private_s { drmRegion status; drmRegion primary; drmRegion buffers; + unsigned int sarea_priv_offset; } mgaScreenPrivate; diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_context.c b/xc/lib/GL/mesa/src/drv/r128/r128_context.c index 03b871538..7c6afa8c0 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_context.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_context.c @@ -88,7 +88,7 @@ GLboolean r128CreateContext( Display *dpy, GLvisual *glVisual, r128scrn = rmesa->r128Screen = (r128ScreenPtr)(sPriv->private); rmesa->sarea = (R128SAREAPrivPtr)((char *)sPriv->pSAREA + - sizeof(XF86DRISAREARec)); + r128scrn->sarea_priv_offset); rmesa->tmp_matrix = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if ( !rmesa->tmp_matrix ) { diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_screen.c b/xc/lib/GL/mesa/src/drv/r128/r128_screen.c index 029ccd4ca..d634ec0d8 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_screen.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_screen.c @@ -68,9 +68,9 @@ r128ScreenPtr r128CreateScreen( __DRIscreenPrivate *sPriv ) { int major, minor, patch; if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 3 || minor != 0 || patch < 0 ) { + if ( major != 4 || minor < 0 ) { char msg[128]; - sprintf( msg, "r128 DRI driver expected DRI version 3.0.x but got version %d.%d.%d", major, minor, patch ); + sprintf( msg, "r128 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch ); __driMesaMessage( msg ); return GL_FALSE; } @@ -79,8 +79,7 @@ r128ScreenPtr r128CreateScreen( __DRIscreenPrivate *sPriv ) /* Check that the DDX driver version is compatible */ if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0 ) { + sPriv->ddxMinor < 0 ) { char msg[128]; sprintf( msg, "r128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); __driMesaMessage( msg ); @@ -89,8 +88,7 @@ r128ScreenPtr r128CreateScreen( __DRIscreenPrivate *sPriv ) /* Check that the DRM driver version is compatible */ if ( sPriv->drmMajor != 2 || - sPriv->drmMinor != 1 || - sPriv->drmPatch < 0 ) { + sPriv->drmMinor < 1 ) { char msg[128]; sprintf( msg, "r128 DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); __driMesaMessage( msg ); @@ -105,6 +103,7 @@ r128ScreenPtr r128CreateScreen( __DRIscreenPrivate *sPriv ) * not we are using a PCI card. */ r128Screen->IsPCI = r128DRIPriv->IsPCI; + r128Screen->sarea_priv_offset = r128DRIPriv->sarea_priv_offset; r128Screen->mmio.handle = r128DRIPriv->registerHandle; r128Screen->mmio.size = r128DRIPriv->registerSize; diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_screen.h b/xc/lib/GL/mesa/src/drv/r128/r128_screen.h index b3e6259e8..8f88e5cb8 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_screen.h +++ b/xc/lib/GL/mesa/src/drv/r128/r128_screen.h @@ -74,6 +74,7 @@ typedef struct { drmBufMapPtr buffers; __DRIscreenPrivate *driScreen; + unsigned int sarea_priv_offset; } r128ScreenRec, *r128ScreenPtr; diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c b/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c index 41991d0bf..535337cb3 100644 --- a/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c @@ -61,9 +61,9 @@ GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv ) { int major, minor, patch; if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != 3 || minor != 0 || patch < 0) { + if (major != 4 || minor < 0) { char msg[1000]; - sprintf(msg, "R128 DRI driver expected DRI version 3.0.x but got version %d.%d.%d", major, minor, patch); + sprintf(msg, "R128 DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); __driMesaMessage(msg); return GL_FALSE; } @@ -72,8 +72,7 @@ GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check that the DDX driver version is compatible */ if (sPriv->ddxMajor != 4 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0) { + sPriv->ddxMinor < 0) { char msg[1000]; sprintf(msg, "R128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); __driMesaMessage(msg); @@ -82,10 +81,9 @@ GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check that the DRM driver version is compatible */ if (sPriv->drmMajor != 2 || - sPriv->drmMinor != 1 || - sPriv->drmPatch < 4) { + sPriv->drmMinor < 1) { char msg[1000]; - sprintf(msg, "R128 DRI driver expected DRM driver version 2.1.x (x>=4) but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); + sprintf(msg, "R128 DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); __driMesaMessage(msg); return GL_FALSE; } diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c index 366f094ca..172e0f62a 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c @@ -61,6 +61,25 @@ int RADEON_DEBUG = (0 ); #endif +#ifdef PER_CONTEXT_SAREA +char *radeonGetPerContextSAREA(int fd, + drmContext hHWContext, + drmSize size) +{ + drmHandle handle; + drmAddress address; + + if(drmGetContextPrivateMapping(fd, hHWContext, &handle) < 0) { + return NULL; + } + if(drmMap(fd, handle, size, &address) < 0) { + return NULL; + } + + return address; +} +#endif + /* Create the device specific context. */ GLboolean radeonCreateContext( Display *dpy, GLvisual *glVisual, @@ -89,7 +108,18 @@ GLboolean radeonCreateContext( Display *dpy, GLvisual *glVisual, radeonScreen = rmesa->radeonScreen = (radeonScreenPtr)(sPriv->private); rmesa->sarea = (RADEONSAREAPrivPtr)((char *)sPriv->pSAREA + - sizeof(XF86DRISAREARec)); + radeonScreen->sarea_priv_offset); + +#ifdef PER_CONTEXT_SAREA + rmesa->private_sarea = radeonGetPerContextSAREA(rmesa->driFd, + rmesa->hHWContext, + radeonScreen->private_sarea_size); + if(!rmesa->private_sarea) { + fprintf(stderr, "Can't map private SAREA\n"); + FREE( rmesa ); + return GL_FALSE; + } +#endif rmesa->tmp_matrix = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if ( !rmesa->tmp_matrix ) { @@ -176,10 +206,19 @@ GLboolean radeonCreateContext( Display *dpy, GLvisual *glVisual, void radeonDestroyContext( radeonContextPtr rmesa ) { if ( rmesa ) { + radeonScreenPtr radeonScreen = rmesa->radeonScreen; radeonTexObjPtr t, next_t; int i; - for ( i = 0 ; i < rmesa->radeonScreen->numTexHeaps ; i++ ) { +#ifdef PER_CONTEXT_SAREA + if ( rmesa->private_sarea ) { + drmUnmap( (drmAddress)rmesa->private_sarea, + radeonScreen->private_sarea_size ); + rmesa->private_sarea = NULL; + } +#endif + + for ( i = 0 ; i < radeonScreen->numTexHeaps ; i++ ) { foreach_s ( t, next_t, &rmesa->TexObjList[i] ) { radeonDestroyTexObj( rmesa, t ); } diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h index 1b9c0ce9c..668b451a9 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h @@ -221,6 +221,10 @@ struct radeon_context { radeonScreenPtr radeonScreen; /* Screen private DRI data */ RADEONSAREAPrivPtr sarea; /* Private SAREA data */ +#ifdef PER_CONTEXT_SAREA + char *private_sarea; /* Per-context private SAREA */ +#endif + /* Performance counters */ GLuint boxes; /* Draw performance boxes */ diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c index dea4bb1ef..b3da87bd3 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c @@ -65,9 +65,9 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) { int major, minor, patch; if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 3 || minor != 0 || patch < 0 ) { + if ( major != 4 || minor < 0 ) { char msg[128]; - sprintf( msg, "Radeon DRI driver expected DRI version 3.0.x but got version %d.%d.%d", major, minor, patch ); + sprintf( msg, "Radeon DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch ); __driMesaMessage( msg ); return GL_FALSE; } @@ -76,8 +76,7 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) /* Check that the DDX driver version is compatible */ if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0 ) { + sPriv->ddxMinor < 0 ) { char msg[128]; sprintf( msg, "Radeon DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); __driMesaMessage( msg ); @@ -86,8 +85,7 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) /* Check that the DRM driver version is compatible */ if ( sPriv->drmMajor != 1 || - sPriv->drmMinor != 0 || - sPriv->drmPatch < 0 ) { + sPriv->drmMinor < 0 ) { char msg[128]; sprintf( msg, "Radeon DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); __driMesaMessage( msg ); @@ -192,6 +190,11 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) } radeonScreen->driScreen = sPriv; + radeonScreen->sarea_priv_offset = radeonDRIPriv->sarea_priv_offset; + +#ifdef PER_CONTEXT_SAREA + radeonScreen->perctx_sarea_size = radeonDRIPriv->perctx_sarea_size; +#endif radeonDDSetupInit(); radeonDDTriangleFuncsInit(); diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h index 4aeb5d73f..81265eaaf 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.h @@ -68,6 +68,10 @@ typedef struct { int texSize[RADEON_NR_TEX_HEAPS]; int logTexGranularity[RADEON_NR_TEX_HEAPS]; +#ifdef PER_CONTEXT_SAREA + drmSize private_sarea_size; +#endif + radeonRegionRec mmio; radeonRegionRec status; radeonRegionRec agpTextures; @@ -77,7 +81,7 @@ typedef struct { __volatile__ CARD32 *scratch; __DRIscreenPrivate *driScreen; - + unsigned int sarea_priv_offset; } radeonScreenRec, *radeonScreenPtr; extern radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ); diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c index db6d1595e..45bb64fd5 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c @@ -62,9 +62,9 @@ GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv ) { int major, minor, patch; if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 3 || minor != 0 || patch < 0 ) { + if ( major != 4 || minor < 0 ) { char msg[128]; - sprintf( msg, "RADEON DRI driver expected DRI version 3.0.x but got version %d.%d.%d", major, minor, patch ); + sprintf( msg, "RADEON DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch ); __driMesaMessage( msg ); return GL_FALSE; } @@ -73,8 +73,7 @@ GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check that the DDX driver version is compatible */ if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0 ) { + sPriv->ddxMinor < 0 ) { char msg[128]; sprintf( msg, "RADEON DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); __driMesaMessage( msg ); @@ -83,8 +82,7 @@ GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check that the DRM driver version is compatible */ if ( sPriv->drmMajor != 1 || - sPriv->drmMinor != 0 || - sPriv->drmPatch < 0 ) { + sPriv->drmMinor < 0 ) { char msg[128]; sprintf( msg, "RADEON DRI driver expected DRM driver version 1.0.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); __driMesaMessage( msg ); diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c index 0c6e399c1..293c42fd7 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c @@ -131,7 +131,7 @@ GLboolean tdfxCreateContext( Display *dpy, GLvisual *mesaVis, __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; tdfxScreenPrivate *fxScreen = (tdfxScreenPrivate *) sPriv->private; TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) ((char *) sPriv->pSAREA + - sizeof(XF86DRISAREARec)); + fxScreen->sarea_priv_offset); fxMesa = (tdfxContextPtr) Xmalloc( sizeof(tdfxContextRec) ); diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c index f63541be9..e7877d7d0 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_lock.c @@ -49,7 +49,7 @@ void tdfxGetLock( tdfxContextPtr fxMesa ) __DRIdrawablePrivate *dPriv = cPriv->driDrawablePriv; __DRIscreenPrivate *sPriv = dPriv->driScreenPriv; TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) (((char *) sPriv->pSAREA) + - sizeof(XF86DRISAREARec)); + fxMesa->fxScreen->sarea_priv_offset); int stamp = dPriv->lastStamp; int one_rect = (fxMesa->numClipRects <= 1); diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c index 801cf42e0..ce3907604 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.c @@ -77,7 +77,7 @@ GLboolean tdfxCreateScreen( __DRIscreenPrivate *sPriv ) fxScreen->depthOffset = fxDRIPriv->depthOffset; fxScreen->textureOffset = fxDRIPriv->textureOffset; fxScreen->textureSize = fxDRIPriv->textureSize; - + fxScreen->sarea_priv_offset = fxDRIPriv->sarea_priv_offset; if ( drmMap( sPriv->fd, fxScreen->regs.handle, fxScreen->regs.size, &fxScreen->regs.map ) ) { diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.h b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.h index 330c394a6..ca654eda3 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.h +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_screen.h @@ -67,6 +67,7 @@ typedef struct { int textureSize; __DRIscreenPrivate *driScrnPriv; + unsigned int sarea_priv_offset; } tdfxScreenPrivate; diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c index bf44acda6..00935e2de 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_xmesa.c @@ -64,11 +64,10 @@ XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check the DRI version */ if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 3 || - minor != 0 || - patch < 0 ) { + if ( major != 4 || + minor < 0 ) { sprintf( msg, - "3dfx DRI driver expected DRI version 3.0.x " + "3dfx DRI driver expected DRI version 4.0.x " "but got version %d.%d.%d", major, minor, patch ); __driMesaMessage( msg ); @@ -78,8 +77,7 @@ XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check that the DDX driver version is compatible */ if ( sPriv->ddxMajor != 1 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0 ) { + sPriv->ddxMinor < 0 ) { sprintf( msg, "3dfx DRI driver expected DDX driver version 1.0.x " "but got version %d.%d.%d", @@ -90,8 +88,7 @@ XMesaInitDriver( __DRIscreenPrivate *sPriv ) /* Check that the DRM driver version is compatible */ if ( sPriv->drmMajor != 1 || - sPriv->drmMinor != 0 || - sPriv->drmPatch < 0 ) { + sPriv->drmMinor < 0 ) { sprintf( msg, "3dfx DRI driver expected DRM driver version 1.0.x " "but got version %d.%d.%d", |