if (getenv("LIBGL_FORCE_XSERVER"))
return GL_FALSE;
+
+ if (sPriv->devPrivSize != sizeof(FFBDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(FFBDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
+
/* Allocate the private area. */
ffbScreen = (ffbScreenPrivate *) MALLOC(sizeof(ffbScreenPrivate));
if (!ffbScreen)
{
__DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 0, 0, 1 };
+ static const __DRIversion ddx_expected = { 0, 1, 1 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 0, 0, 1 };
typedef struct {
drm_handle_t hFbcRegs;
drmSize sFbcRegs;
- drmAddress mFbcRegs;
drm_handle_t hDacRegs;
drmSize sDacRegs;
- drmAddress mDacRegs;
drm_handle_t hSfb8r;
drmSize sSfb8r;
- drmAddress mSfb8r;
drm_handle_t hSfb32;
drmSize sSfb32;
- drmAddress mSfb32;
drm_handle_t hSfb64;
drmSize sSfb64;
- drmAddress mSfb64;
/* Fastfill/Pagefill parameters. */
unsigned char disable_pagefill;
GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)sPriv->pDevPriv;
int i;
+ if (sPriv->devPrivSize != sizeof(GLINTDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(GLINTDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
+
#if 0
/* Check the DRI externsion version */
if ( sPriv->driMajor != 3 || sPriv->driMinor != 1 ) {
i810ScreenPrivate *i810Screen;
I810DRIPtr gDRIPriv = (I810DRIPtr)sPriv->pDevPriv;
+ if (sPriv->devPrivSize != sizeof(I810DRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(I810DRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
i810Screen = (i810ScreenPrivate *)CALLOC(sizeof(i810ScreenPrivate));
drmAgpAlloc(ctx->drmFD, 4096 * 1024, 1, NULL, &dcacheHandle);
info->dcacheHandle = dcacheHandle;
- fprintf(stderr, "[agp] dcacheHandle : %p\n", dcacheHandle);
+ fprintf(stderr, "[agp] dcacheHandle : 0x%x\n", dcacheHandle);
#define Elements(x) sizeof(x)/sizeof(*x)
for (pitch_idx = 0; pitch_idx < Elements(i810_pitches); pitch_idx++)
return 0;
}
fprintf(stderr,
- "[drm] register handle = 0x%08lx\n", info->regs);
+ "[drm] register handle = 0x%08x\n", info->regs);
I810DRIAgpPreInit(ctx, info);
/* Need to AddMap the framebuffer and mmio regions here:
typedef struct {
drm_handle_t regs;
drmSize regsSize;
- drmAddress regsMap;
drmSize backbufferSize;
drm_handle_t backbuffer;
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
i830Screen = (i830ScreenPrivate *)CALLOC(sizeof(i830ScreenPrivate));
typedef struct _I830DRIRec {
drm_handle_t regs;
drmSize regsSize;
- drmAddress regsMap;
drmSize backbufferSize;
drm_handle_t backbuffer;
void * const psc = sPriv->psc->screenConfigs;
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
- fprintf(stderr,"\nERROR! sizeof(I830DRIRec) does not match passed size from 2D driver\n");
+ fprintf(stderr,"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
return GL_FALSE;
}
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(ATIDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(ATIDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI )
fprintf( stderr, "%s\n", __FUNCTION__ );
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(MGADRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(MGADRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
mgaScreen = (mgaScreenPrivate *)MALLOC(sizeof(mgaScreenPrivate));
{
__DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 1, 1 };
+ static const __DRIversion ddx_expected = { 1, 2, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 3, 0, 0 };
return 0;
}
fprintf( stderr,
- "[agp] WARP microcode handle = 0x%08lx\n",
+ "[agp] WARP microcode handle = 0x%08x\n",
pMga->warp.handle );
if ( drmMap( ctx->drmFD,
return 0;
}
fprintf( stderr,
- "[agp] Primary DMA handle = 0x%08lx\n",
+ "[agp] Primary DMA handle = 0x%08x\n",
pMga->primary.handle );
if ( drmMap( ctx->drmFD,
return 0;
}
fprintf( stderr,
- "[agp] DMA buffers handle = 0x%08lx\n",
+ "[agp] DMA buffers handle = 0x%08x\n",
pMga->buffers.handle );
if ( drmMap( ctx->drmFD,
}
/* should i map it ? */
fprintf( stderr,
- "[agp] agpTexture handle = 0x%08lx\n",
+ "[agp] agpTexture handle = 0x%08x\n",
pMga->agpTextures.handle );
fprintf( stderr,
"[agp] agpTexture size: %d kb\n", pMga->agpTextures.size/1024 );
return 0;
}
fprintf( stderr,
- "[drm] Status handle = 0x%08lx\n",
+ "[drm] Status handle = 0x%08x\n",
pMga->status.handle );
if ( drmMap( ctx->drmFD,
# define DEPRECATED
#endif
+#if 1
+typedef struct _mgaDrmRegion {
+ drm_handle_t handle;
+ unsigned int offset;
+ drmSize size;
+} mgaDrmRegion, *mgaDrmRegionPtr;
+#else
+#define mgaDrmRegion drmRegion
+#endif
+
typedef struct {
int chipset;
int width DEPRECATED;
* for the X.org 6.9 / 7.0 release), these fields should be removed.
*/
/*@{*/
- drmRegion registers; /**< MMIO registers. */
- drmRegion status DEPRECATED; /**< No longer used on the client-side. */
- drmRegion primary; /**< Primary DMA region. */
- drmRegion buffers DEPRECATED; /**< No longer used on the client-side. */
+ mgaDrmRegion registers; /**< MMIO registers. */
+ mgaDrmRegion status DEPRECATED; /**< No longer used on the client-side. */
+ mgaDrmRegion primary; /**< Primary DMA region. */
+ mgaDrmRegion buffers DEPRECATED; /**< No longer used on the client-side. */
/*@}*/
unsigned int sarea_priv_offset;
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(R128DRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(R128DRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
r128Screen = (r128ScreenPtr) CALLOC( sizeof(*r128Screen) );
return GL_FALSE;
}
fprintf(stderr,
- "[agp] ring handle = 0x%08lx\n", info->ringHandle);
+ "[agp] ring handle = 0x%08x\n", info->ringHandle);
if (drmMap(ctx->drmFD, info->ringHandle, info->ringMapSize,
(drmAddressPtr)&info->ring) < 0) {
return GL_FALSE;
}
fprintf(stderr,
- "[agp] ring read ptr handle = 0x%08lx\n",
+ "[agp] ring read ptr handle = 0x%08x\n",
info->ringReadPtrHandle);
if (drmMap(ctx->drmFD, info->ringReadPtrHandle, info->ringReadMapSize,
return GL_FALSE;
}
fprintf(stderr,
- "[drm] register handle = 0x%08lx\n", info->registerHandle);
+ "[drm] register handle = 0x%08x\n", info->registerHandle);
return GL_TRUE;
}
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(RADEONDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
screen = (r200ScreenPtr) CALLOC( sizeof(*screen) );
(*dri_interface->getProcAddress("glxEnableExtension"));
void *const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(RADEONDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
screen = (radeonScreenPtr) CALLOC(sizeof(*screen));
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(RADEONDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
screen = (radeonScreenPtr) CALLOC( sizeof(*screen) );
fprintf(stderr, "[gart] Could not add ring mapping\n");
return 0;
}
- fprintf(stderr, "[gart] ring handle = 0x%08lx\n", info->ringHandle);
+ fprintf(stderr, "[gart] ring handle = 0x%08x\n", info->ringHandle);
if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize,
}
fprintf(stderr,
- "[gart] ring read ptr handle = 0x%08lx\n",
+ "[gart] ring read ptr handle = 0x%08lx\n",
info->ringReadPtrHandle);
if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize,
return 0;
}
fprintf(stderr,
- "[gart] vertex/indirect buffers handle = 0x%08lx\n",
+ "[gart] vertex/indirect buffers handle = 0x%08x\n",
info->bufHandle);
if (drmAddMap(ctx->drmFD, info->gartTexStart, info->gartTexMapSize,
return 0;
}
fprintf(stderr,
- "[gart] AGP texture map handle = 0x%08lx\n",
+ "[gart] AGP texture map handle = 0x%08lx\n",
info->gartTexHandle);
/* Initialize Radeon's AGP registers */
return 0;
}
fprintf(stderr,
- "[pci] ring handle = 0x%08lx\n", info->ringHandle);
+ "[pci] ring handle = 0x%08x\n", info->ringHandle);
if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize,
DRM_SCATTER_GATHER, flags, &info->ringReadPtrHandle) < 0) {
return 0;
}
fprintf(stderr,
- "[pci] ring read ptr handle = 0x%08lx\n",
+ "[pci] ring read ptr handle = 0x%08lx\n",
info->ringReadPtrHandle);
if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize,
return 0;
}
fprintf(stderr,
- "[pci] vertex/indirect buffers handle = 0x%08lx\n",
+ "[pci] vertex/indirect buffers handle = 0x%08lx\n",
info->bufHandle);
if (drmAddMap(ctx->drmFD, info->gartTexStart, info->gartTexMapSize,
return 0;
}
fprintf(stderr,
- "[pci] GART texture map handle = 0x%08lx\n",
+ "[pci] GART texture map handle = 0x%08x\n",
info->gartTexHandle);
return 1;
DEBUG(("sPriv->pDevPriv at %p\n", sPriv->pDevPriv));
DEBUG(("size = %i\n", sizeof(*vDRIPriv)));
+ if (sPriv->devPrivSize != sizeof(S3VDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(S3VDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
+
/* Allocate the private area */
s3vScreen = (s3vScreenPtr) CALLOC( sizeof(*s3vScreen) );
if ( !s3vScreen ) return NULL;
savageScreenPrivate *savageScreen;
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
+ if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
+
/* Allocate the private area */
savageScreen = (savageScreenPrivate *)Xmalloc(sizeof(savageScreenPrivate));
if (!savageScreen)
typedef struct {
drm_handle_t handle;
drmSize size;
- drmAddress map;
} sisRegion, *sisRegionPtr;
typedef struct {
sisScreenPtr sisScreen;
SISDRIPtr sisDRIPriv = (SISDRIPtr)sPriv->pDevPriv;
+ if (sPriv->devPrivSize != sizeof(SISDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(SISDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
sisScreen = (sisScreenPtr)CALLOC( sizeof(*sisScreen) );
{
__DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = {0, 1, 0};
+ static const __DRIversion ddx_expected = {0, 8, 0};
static const __DRIversion dri_expected = {4, 0, 0};
static const __DRIversion drm_expected = {1, 0, 0};
typedef struct {
drm_handle_t regs;
drmSize regsSize;
- drmAddress regsMap;
int deviceID;
int width;
int height;
tdfxScreenPrivate *fxScreen;
TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
+ if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
+
/* Allocate the private area */
fxScreen = (tdfxScreenPrivate *) CALLOC( sizeof(tdfxScreenPrivate) );
if ( !fxScreen )
__GLcontextModes ** driver_modes )
{
__DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 0, 0 };
+ static const __DRIversion ddx_expected = { 1, 1, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 0, 0 };
TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv;
tridentScreenPtr tridentScreen;
+ if (sPriv->devPrivSize != sizeof(TRIDENTDRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(TRIDENTDRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) );
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
+ if (sPriv->devPrivSize != sizeof(VIADRIRec)) {
+ fprintf(stderr,"\nERROR! sizeof(VIADRIRec) does not match passed size from device driver\n");
+ return GL_FALSE;
+ }
/* Allocate the private area */
viaScreen = (viaScreenPrivate *) CALLOC(sizeof(viaScreenPrivate));