From dabec11d277e68b6940e741651e61102767240b9 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Mon, 15 Aug 2005 06:59:24 +0000 Subject: Add Egberts fixes for 64bit architectures Add additional checks for the *DRIRec info structure passed in from the device driver. This ensures that things fallback to indirect rendering if the DDX driver has had modifications (i.e. removal of the drmAddress field). --- src/mesa/drivers/dri/r128/r128_screen.c | 4 ++++ src/mesa/drivers/dri/r128/server/r128_dri.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/r128') diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index 52b9b7bcbcc..c6c598cc3b8 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -102,6 +102,10 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) (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) ); diff --git a/src/mesa/drivers/dri/r128/server/r128_dri.c b/src/mesa/drivers/dri/r128/server/r128_dri.c index 4cc3c23098f..5edf1e10036 100644 --- a/src/mesa/drivers/dri/r128/server/r128_dri.c +++ b/src/mesa/drivers/dri/r128/server/r128_dri.c @@ -164,7 +164,7 @@ static GLboolean R128DRIAgpInit(const DRIDriverContext *ctx) 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) { @@ -182,7 +182,7 @@ static GLboolean R128DRIAgpInit(const DRIDriverContext *ctx) 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, @@ -398,7 +398,7 @@ static GLboolean R128DRIMapInit(const DRIDriverContext *ctx) return GL_FALSE; } fprintf(stderr, - "[drm] register handle = 0x%08lx\n", info->registerHandle); + "[drm] register handle = 0x%08x\n", info->registerHandle); return GL_TRUE; } -- cgit v1.2.3