summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordok666 <dok666>2003-05-11 13:35:12 +0000
committerdok666 <dok666>2003-05-11 13:35:12 +0000
commitd1257d67d4a706cdd728031a28f2d47205a132aa (patch)
treedb2f22e316ee34c9a8b37c9632530667f7c1fe1b
parent266cf70fdef11feba1cef86101680e9963ed2526 (diff)
Removed one-time depth buffer allocation from the driver.
Removed depth buffer related values from the global (non context/drawable) structures and added them to the drawable. Initialize all visual configurations (16 and 32 bit). Windowing system (dfb, miniglx) has to allocate the depth, too, now depending on the values from the visual config that is to be used. I'm now able to have two OpenGL windows (in one app for now) rendering concurrently (not multi threaded yet, but easy to do) both using their own depth buffer. I'm sorry, but I had to disable the radeon driver until it's updated to the recent changes. I also doubt that MiniGLX is currently working in this branch.
-rw-r--r--src/kernel/drm/drm_drv.h2
-rw-r--r--src/kernel/drm/mga_dma.c4
-rw-r--r--src/kernel/drm/mga_drm.h9
-rw-r--r--src/kernel/drm/mga_drv.h4
-rw-r--r--src/kernel/drm/mga_state.c8
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c3
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.h4
-rw-r--r--src/mesa/drivers/dri/mga/mgabuffers.c11
-rw-r--r--src/mesa/drivers/dri/mga/mgapixel.c4
-rw-r--r--src/mesa/drivers/dri/mga/mgaspan.c7
-rw-r--r--src/mesa/drivers/dri/mga/server/mga.h2
-rw-r--r--src/mesa/drivers/dri/mga/server/mga_common.h9
-rw-r--r--src/mesa/drivers/dri/mga/server/mga_dri.c802
-rw-r--r--src/mesa/drivers/dri/mga/server/mga_dri.h3
-rw-r--r--src/mesa/drivers/dri/mga/server/mga_sarea.h4
-rw-r--r--src/miniglx/dri_util.c6
-rw-r--r--src/miniglx/dri_util.h77
-rw-r--r--src/miniglx/miniglx.c50
-rw-r--r--src/miniglx/miniglxP.h9
19 files changed, 415 insertions, 603 deletions
diff --git a/src/kernel/drm/drm_drv.h b/src/kernel/drm/drm_drv.h
index 772f03e2198..1a1ba36ff4b 100644
--- a/src/kernel/drm/drm_drv.h
+++ b/src/kernel/drm/drm_drv.h
@@ -991,7 +991,7 @@ int DRM(ioctl)( struct inode *inode, struct file *filp,
if ( !func ) {
DRM_DEBUG( "no function\n" );
retcode = -EINVAL;
- } else if ( ( ioctl->root_only && !capable( CAP_SYS_ADMIN ) )||
+ } else if ( ( 0/*ioctl->root_only*/ && !capable( CAP_SYS_ADMIN ) )||
( ioctl->auth_needed && !priv->authenticated ) ) {
retcode = -EACCES;
} else {
diff --git a/src/kernel/drm/mga_dma.c b/src/kernel/drm/mga_dma.c
index 93fd59c66f1..631c88e30a7 100644
--- a/src/kernel/drm/mga_dma.c
+++ b/src/kernel/drm/mga_dma.c
@@ -474,10 +474,6 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
dev_priv->clear_cmd = MGA_DWGCTL_CLEAR | MGA_ATYPE_RSTR;
}
- dev_priv->depth_cpp = init->depth_cpp;
- dev_priv->depth_offset = init->depth_offset;
- dev_priv->depth_pitch = init->depth_pitch;
-
/* FIXME: Need to support AGP textures...
*/
dev_priv->texture_offset = init->texture_offset[0];
diff --git a/src/kernel/drm/mga_drm.h b/src/kernel/drm/mga_drm.h
index 5adc9930d08..eca3f7a6dd5 100644
--- a/src/kernel/drm/mga_drm.h
+++ b/src/kernel/drm/mga_drm.h
@@ -131,7 +131,11 @@ typedef struct {
unsigned int draw_offset;
unsigned int draw_pitch;
- unsigned int maccess;
+ unsigned int depth_cpp;
+ unsigned int depth_offset;
+ unsigned int depth_pitch;
+
+ unsigned int maccess;
unsigned int plnwt;
unsigned int dwgctl;
unsigned int alphactrl;
@@ -265,9 +269,6 @@ typedef struct drm_mga_init {
int chipset;
int sgram;
- unsigned int depth_cpp;
- unsigned int depth_offset, depth_pitch;
-
unsigned int texture_offset[MGA_NR_TEX_HEAPS];
unsigned int texture_size[MGA_NR_TEX_HEAPS];
diff --git a/src/kernel/drm/mga_drv.h b/src/kernel/drm/mga_drv.h
index a449e6d733a..9e9c44e5b99 100644
--- a/src/kernel/drm/mga_drv.h
+++ b/src/kernel/drm/mga_drv.h
@@ -76,10 +76,6 @@ typedef struct drm_mga_private {
u32 clear_cmd;
- unsigned int depth_cpp;
- unsigned int depth_offset;
- unsigned int depth_pitch;
-
unsigned int texture_offset;
unsigned int texture_size;
diff --git a/src/kernel/drm/mga_state.c b/src/kernel/drm/mga_state.c
index 92877aa4f52..a06f47cb43e 100644
--- a/src/kernel/drm/mga_state.c
+++ b/src/kernel/drm/mga_state.c
@@ -85,7 +85,7 @@ static __inline__ void mga_g200_emit_context( drm_mga_private_t *dev_priv )
DMA_BLOCK( MGA_ALPHACTRL, ctx->alphactrl,
MGA_FOGCOL, ctx->fogcolor,
MGA_WFLAG, ctx->wflag,
- MGA_ZORG, dev_priv->depth_offset );
+ MGA_ZORG, ctx->depth_offset );
DMA_BLOCK( MGA_FCOL, ctx->fcol,
MGA_PITCH, ctx->draw_pitch,
@@ -111,7 +111,7 @@ static __inline__ void mga_g400_emit_context( drm_mga_private_t *dev_priv )
DMA_BLOCK( MGA_ALPHACTRL, ctx->alphactrl,
MGA_FOGCOL, ctx->fogcolor,
MGA_WFLAG, ctx->wflag,
- MGA_ZORG, dev_priv->depth_offset );
+ MGA_ZORG, ctx->depth_offset );
DMA_BLOCK( MGA_WFLAG1, ctx->wflag,
MGA_TDUALSTAGE0, ctx->tdualstage0,
@@ -583,9 +583,9 @@ static void mga_dma_dispatch_clear( drm_device_t *dev,
MGA_YDSTLEN, (box->y1 << 16) | height,
MGA_FXBNDRY, (box->x2 << 16) | box->x1 );
- DMA_BLOCK( MGA_PITCH, dev_priv->depth_pitch,
+ DMA_BLOCK( MGA_PITCH, ctx->depth_pitch,
MGA_FCOL, clear->clear_depth,
- MGA_DSTORG, dev_priv->depth_offset,
+ MGA_DSTORG, ctx->depth_offset,
MGA_DWGCTL + MGA_EXEC,
dev_priv->clear_cmd );
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index 6915d2ba9f9..1a66aa49844 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -131,9 +131,6 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
mgaScreen->agpMode = serverInfo->agpMode;
- mgaScreen->depthOffset = serverInfo->depthOffset;
- mgaScreen->depthPitch = serverInfo->depthPitch;
-
mgaScreen->mmio.handle = serverInfo->registers.handle;
mgaScreen->mmio.size = serverInfo->registers.size;
if ( drmMap( sPriv->fd,
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.h b/src/mesa/drivers/dri/mga/mga_xmesa.h
index f28ba5cbc6d..e6c8ab09733 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.h
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.h
@@ -43,10 +43,6 @@ typedef struct mga_screen_private_s {
GLint agpMode;
unsigned int irq; /* IRQ number (0 means none) */
- unsigned int depthOffset;
- unsigned int depthPitch;
- int depthCpp;
-
unsigned int dmaOffset;
unsigned int textureOffset[DRM_MGA_NR_TEX_HEAPS];
diff --git a/src/mesa/drivers/dri/mga/mgabuffers.c b/src/mesa/drivers/dri/mga/mgabuffers.c
index 585bff5ba79..d6f49eaa6d6 100644
--- a/src/mesa/drivers/dri/mga/mgabuffers.c
+++ b/src/mesa/drivers/dri/mga/mgabuffers.c
@@ -207,7 +207,7 @@ static void printMmesaRects( mgaContextPtr mmesa )
#endif
-static void mgaUpdateDrawBuffer(mgaContextPtr mmesa)
+static void mgaUpdateBuffers(mgaContextPtr mmesa)
{
__DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
@@ -238,6 +238,11 @@ static void mgaUpdateDrawBuffer(mgaContextPtr mmesa)
break;
}
+ mmesa->setup.depth_cpp = driDrawable->depthCpp;
+
+ mmesa->setup.depth_pitch = driDrawable->w;//depthPitch / driDrawable->depthCpp;
+ mmesa->setup.depth_offset = driDrawable->depthOffset;
+
mmesa->setup.maccess = (MA_memreset_disable |
MA_fogen_disable |
MA_tlutload_disable |
@@ -285,7 +290,7 @@ void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers )
DRI_VALIDATE_DRAWABLE_INFO(driScreen, driDrawable);
mmesa->dirty_cliprects = 0;
- mgaUpdateDrawBuffer( mmesa );
+ mgaUpdateBuffers( mmesa );
if (mmesa->draw_buffer == MGA_FRONT)
mgaXMesaSetFrontClipRects( mmesa );
@@ -346,7 +351,7 @@ void mgaDDSetDrawBuffer(GLcontext *ctx, GLenum mode )
break;
}
- mgaUpdateDrawBuffer( mmesa );
+ mgaUpdateBuffers( mmesa );
if (mmesa->draw_buffer == MGA_FRONT)
mgaXMesaSetFrontClipRects( mmesa );
diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c
index f520e936069..d180218d482 100644
--- a/src/mesa/drivers/dri/mga/mgapixel.c
+++ b/src/mesa/drivers/dri/mga/mgapixel.c
@@ -270,7 +270,7 @@ mgaTryReadPixels( GLcontext *ctx,
return GL_FALSE;
planemask = ~0;
- source = mmesa->mgaScreen->depthOffset;
+ source = mmesa->driDrawable->depthOffset;
break;
case GL_RGB:
@@ -502,7 +502,7 @@ mgaTryDrawPixels( GLcontext *ctx,
#endif
case GL_DEPTH_COMPONENT:
- dest = mmesa->mgaScreen->depthOffset;
+ dest = mmesa->driDrawable->depthOffset;
if (ctx->Visual.depthBits == 24)
planemask = ~0xff;
diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c
index 9333e22aff0..514528f686d 100644
--- a/src/mesa/drivers/dri/mga/mgaspan.c
+++ b/src/mesa/drivers/dri/mga/mgaspan.c
@@ -56,13 +56,12 @@
#define LOCAL_DEPTH_VARS \
__DRIdrawablePrivate *dPriv = mmesa->driDrawable; \
- mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \
__DRIscreenPrivate *sPriv = mmesa->driScreen; \
- GLuint pitch = mgaScreen->depthPitch; \
+ GLuint pitch = dPriv->depthPitch; \
GLuint height = dPriv->h; \
char *buf = (char *)(sPriv->pFB + \
- mgaScreen->depthOffset + \
- dPriv->x * mgaScreen->depthCpp + \
+ dPriv->depthOffset + \
+ dPriv->x * dPriv->depthCpp + \
dPriv->y * pitch)
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
diff --git a/src/mesa/drivers/dri/mga/server/mga.h b/src/mesa/drivers/dri/mga/server/mga.h
index bcec03a1eee..1244233c0ee 100644
--- a/src/mesa/drivers/dri/mga/server/mga.h
+++ b/src/mesa/drivers/dri/mga/server/mga.h
@@ -59,8 +59,6 @@ typedef struct {
int irq; /**< \brief IRQ number */
- int depthOffset; /**< \brief Depth buffer offset */
- int depthPitch; /**< \brief Depth buffer pitch */
int textureOffset; /**< \brief Texture area offset */
int textureSize; /**< \brief Texture area size */
int logTextureGranularity;
diff --git a/src/mesa/drivers/dri/mga/server/mga_common.h b/src/mesa/drivers/dri/mga/server/mga_common.h
index 7924434f636..e2fe599355a 100644
--- a/src/mesa/drivers/dri/mga/server/mga_common.h
+++ b/src/mesa/drivers/dri/mga/server/mga_common.h
@@ -71,15 +71,6 @@ typedef struct {
int chipset;
int sgram;
-// unsigned int maccess;
-
-// unsigned int fb_cpp;
-// unsigned int front_offset, front_pitch;
-// unsigned int back_offset, back_pitch;
-
- unsigned int depth_cpp;
- unsigned int depth_offset, depth_pitch;
-
unsigned int texture_offset[DRM_MGA_NR_TEX_HEAPS];
unsigned int texture_size[DRM_MGA_NR_TEX_HEAPS];
diff --git a/src/mesa/drivers/dri/mga/server/mga_dri.c b/src/mesa/drivers/dri/mga/server/mga_dri.c
index c7aee8e56af..ffa8fcb0f16 100644
--- a/src/mesa/drivers/dri/mga/server/mga_dri.c
+++ b/src/mesa/drivers/dri/mga/server/mga_dri.c
@@ -63,22 +63,22 @@ static void MGAWaitForIdleDMA( struct DRIDriverContextRec *ctx, MGAPtr pMga )
/* first ask for quiescent and flush */
lock.flags = DRM_MGA_LOCK_QUIESCENT | DRM_MGA_LOCK_FLUSH;
do {
- ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH,
+ ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH,
&lock, sizeof( drmMGALock ) );
} while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
/* if it's still busy just try quiescent */
- if ( ret == -EBUSY ) {
+ if ( ret == -EBUSY ) {
lock.flags = DRM_MGA_LOCK_QUIESCENT;
do {
- ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH,
+ ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH,
&lock, sizeof( drmMGALock ) );
} while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY );
}
} while ( ( ret == -EBUSY ) && ( i++ < MGA_TIMEOUT ) );
if ( ret == 0 )
- return;
+ return;
fprintf( stderr,
"[dri] Idle timed out, resetting engine...\n" );
@@ -100,8 +100,8 @@ static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
unsigned int vendor, device;
int ret, count, i;
- if(pMga->agpSize < 12)pMga->agpSize = 12;
- if(pMga->agpSize > 64)pMga->agpSize = 64; /* cap */
+ if (pMga->agpSize < 12)pMga->agpSize = 12;
+ if (pMga->agpSize > 64)pMga->agpSize = 64; /* cap */
/* FIXME: Make these configurable...
*/
@@ -111,22 +111,22 @@ static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
pMga->warp.size = MGA_WARP_UCODE_SIZE;
pMga->primary.offset = (pMga->warp.offset +
- pMga->warp.size);
+ pMga->warp.size);
pMga->primary.size = 1024 * 1024;
pMga->buffers.offset = (pMga->primary.offset +
- pMga->primary.size);
+ pMga->primary.size);
pMga->buffers.size = MGA_NUM_BUFFERS * MGA_BUFFER_SIZE;
pMga->agpTextures.offset = (pMga->buffers.offset +
- pMga->buffers.size);
+ pMga->buffers.size);
pMga->agpTextures.size = pMga->agp.size -
- pMga->agpTextures.offset;
+ pMga->agpTextures.offset;
if ( drmAgpAcquire( ctx->drmFD ) < 0 ) {
- fprintf( stderr, "[agp] AGP not available\n" );
+ fprintf( stderr, "[agp] AGP not available\n" );
return 0;
}
@@ -136,27 +136,27 @@ static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
mode &= ~MGA_AGP_MODE_MASK;
switch ( pMga->agpMode ) {
- case 4:
- mode |= MGA_AGP_4X_MODE;
- case 2:
- mode |= MGA_AGP_2X_MODE;
- case 1:
- default:
- mode |= MGA_AGP_1X_MODE;
+ case 4:
+ mode |= MGA_AGP_4X_MODE;
+ case 2:
+ mode |= MGA_AGP_2X_MODE;
+ case 1:
+ default:
+ mode |= MGA_AGP_1X_MODE;
}
fprintf( stderr,
"[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x]\n",
mode, vendor, device );
-
+
if ( drmAgpEnable( ctx->drmFD, mode ) < 0 ) {
- fprintf( stderr, "[agp] AGP not enabled\n" );
+ fprintf( stderr, "[agp] AGP not enabled\n" );
drmAgpRelease( ctx->drmFD );
return 0;
}
mode = drmAgpGetMode( ctx->drmFD );
-
+
fprintf( stderr,
"[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x]\n",
mode, vendor, device );
@@ -169,35 +169,35 @@ static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
pMga->agpMode = 1;
else
pMga->agpMode = 0;
-
+
if ( pMga->Chipset == PCI_CHIP_MGAG200 ) {
switch ( pMga->agpMode ) {
- case 2:
- fprintf( stderr,
- "[drm] Enabling AGP 2x PLL encoding\n" );
- OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_ENABLE );
- break;
-
- case 1:
- default:
- fprintf( stderr,
- "[drm] Disabling AGP 2x PLL encoding\n" );
- OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_DISABLE );
- pMga->agpMode = 1;
- break;
+ case 2:
+ fprintf( stderr,
+ "[drm] Enabling AGP 2x PLL encoding\n" );
+ OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_ENABLE );
+ break;
+
+ case 1:
+ default:
+ fprintf( stderr,
+ "[drm] Disabling AGP 2x PLL encoding\n" );
+ OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_DISABLE );
+ pMga->agpMode = 1;
+ break;
}
}
ret = drmAgpAlloc( ctx->drmFD, pMga->agp.size,
- 0, NULL, &pMga->agp.handle );
+ 0, NULL, &pMga->agp.handle );
if ( ret < 0 ) {
fprintf( stderr, "[agp] Out of memory (%d)\n", ret );
drmAgpRelease( ctx->drmFD );
return 0;
}
fprintf( stderr,
- "[agp] %d kB allocated with handle 0x%08x\n",
- pMga->agp.size/1024, (unsigned int)pMga->agp.handle );
+ "[agp] %d kB allocated with handle 0x%08x\n",
+ pMga->agp.size/1024, (unsigned int)pMga->agp.handle );
if ( drmAgpBind( ctx->drmFD, pMga->agp.handle, 0 ) < 0 ) {
fprintf( stderr, "[agp] Could not bind memory\n" );
@@ -209,99 +209,99 @@ static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
/* WARP microcode space
*/
if ( drmAddMap( ctx->drmFD,
- pMga->warp.offset,
- pMga->warp.size,
- DRM_AGP, DRM_READ_ONLY,
- &pMga->warp.handle ) < 0 ) {
+ pMga->warp.offset,
+ pMga->warp.size,
+ DRM_AGP, DRM_READ_ONLY,
+ &pMga->warp.handle ) < 0 ) {
fprintf( stderr,
- "[agp] Could not add WARP microcode mapping\n" );
+ "[agp] Could not add WARP microcode mapping\n" );
return 0;
}
fprintf( stderr,
- "[agp] WARP microcode handle = 0x%08lx\n",
- pMga->warp.handle );
+ "[agp] WARP microcode handle = 0x%08lx\n",
+ pMga->warp.handle );
if ( drmMap( ctx->drmFD,
- pMga->warp.handle,
- pMga->warp.size,
- &pMga->warp.map ) < 0 ) {
+ pMga->warp.handle,
+ pMga->warp.size,
+ &pMga->warp.map ) < 0 ) {
fprintf( stderr,
- "[agp] Could not map WARP microcode\n" );
+ "[agp] Could not map WARP microcode\n" );
return 0;
}
fprintf( stderr,
- "[agp] WARP microcode mapped at 0x%08lx\n",
- (unsigned long)pMga->warp.map );
+ "[agp] WARP microcode mapped at 0x%08lx\n",
+ (unsigned long)pMga->warp.map );
/* Primary DMA space
*/
if ( drmAddMap( ctx->drmFD,
- pMga->primary.offset,
- pMga->primary.size,
- DRM_AGP, DRM_READ_ONLY,
- &pMga->primary.handle ) < 0 ) {
+ pMga->primary.offset,
+ pMga->primary.size,
+ DRM_AGP, DRM_READ_ONLY,
+ &pMga->primary.handle ) < 0 ) {
fprintf( stderr,
- "[agp] Could not add primary DMA mapping\n" );
+ "[agp] Could not add primary DMA mapping\n" );
return 0;
}
fprintf( stderr,
- "[agp] Primary DMA handle = 0x%08lx\n",
- pMga->primary.handle );
+ "[agp] Primary DMA handle = 0x%08lx\n",
+ pMga->primary.handle );
if ( drmMap( ctx->drmFD,
- pMga->primary.handle,
- pMga->primary.size,
- &pMga->primary.map ) < 0 ) {
+ pMga->primary.handle,
+ pMga->primary.size,
+ &pMga->primary.map ) < 0 ) {
fprintf( stderr,
- "[agp] Could not map primary DMA\n" );
+ "[agp] Could not map primary DMA\n" );
return 0;
}
fprintf( stderr,
- "[agp] Primary DMA mapped at 0x%08lx\n",
- (unsigned long)pMga->primary.map );
+ "[agp] Primary DMA mapped at 0x%08lx\n",
+ (unsigned long)pMga->primary.map );
/* DMA buffers
*/
if ( drmAddMap( ctx->drmFD,
- pMga->buffers.offset,
- pMga->buffers.size,
- DRM_AGP, 0,
- &pMga->buffers.handle ) < 0 ) {
+ pMga->buffers.offset,
+ pMga->buffers.size,
+ DRM_AGP, 0,
+ &pMga->buffers.handle ) < 0 ) {
fprintf( stderr,
- "[agp] Could not add DMA buffers mapping\n" );
+ "[agp] Could not add DMA buffers mapping\n" );
return 0;
}
fprintf( stderr,
- "[agp] DMA buffers handle = 0x%08lx\n",
- pMga->buffers.handle );
+ "[agp] DMA buffers handle = 0x%08lx\n",
+ pMga->buffers.handle );
if ( drmMap( ctx->drmFD,
- pMga->buffers.handle,
- pMga->buffers.size,
- &pMga->buffers.map ) < 0 ) {
+ pMga->buffers.handle,
+ pMga->buffers.size,
+ &pMga->buffers.map ) < 0 ) {
fprintf( stderr,
- "[agp] Could not map DMA buffers\n" );
+ "[agp] Could not map DMA buffers\n" );
return 0;
}
fprintf( stderr,
- "[agp] DMA buffers mapped at 0x%08lx\n",
- (unsigned long)pMga->buffers.map );
+ "[agp] DMA buffers mapped at 0x%08lx\n",
+ (unsigned long)pMga->buffers.map );
count = drmAddBufs( ctx->drmFD,
- MGA_NUM_BUFFERS, MGA_BUFFER_SIZE,
- DRM_AGP_BUFFER, pMga->buffers.offset );
+ MGA_NUM_BUFFERS, MGA_BUFFER_SIZE,
+ DRM_AGP_BUFFER, pMga->buffers.offset );
if ( count <= 0 ) {
fprintf( stderr,
- "[drm] failure adding %d %d byte DMA buffers\n",
- MGA_NUM_BUFFERS, MGA_BUFFER_SIZE );
+ "[drm] failure adding %d %d byte DMA buffers\n",
+ MGA_NUM_BUFFERS, MGA_BUFFER_SIZE );
return 0;
}
fprintf( stderr,
- "[drm] Added %d %d byte DMA buffers\n",
- count, MGA_BUFFER_SIZE );
+ "[drm] Added %d %d byte DMA buffers\n",
+ count, MGA_BUFFER_SIZE );
i = mylog2(pMga->agpTextures.size / MGA_NR_TEX_REGIONS);
- if(i < MGA_LOG_MIN_TEX_REGION_SIZE)
+ if (i < MGA_LOG_MIN_TEX_REGION_SIZE)
i = MGA_LOG_MIN_TEX_REGION_SIZE;
pMga->agpTextures.size = (pMga->agpTextures.size >> i) << i;
@@ -311,15 +311,15 @@ static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
DRM_AGP, 0,
&pMga->agpTextures.handle ) < 0 ) {
fprintf( stderr,
- "[agp] Could not add agpTexture mapping\n" );
+ "[agp] Could not add agpTexture mapping\n" );
return 0;
}
/* should i map it ? */
fprintf( stderr,
- "[agp] agpTexture handle = 0x%08lx\n",
- pMga->agpTextures.handle );
+ "[agp] agpTexture handle = 0x%08lx\n",
+ pMga->agpTextures.handle );
fprintf( stderr,
- "[agp] agpTexture size: %d kb\n", pMga->agpTextures.size/1024 );
+ "[agp] agpTexture size: %d kb\n", pMga->agpTextures.size/1024 );
return 1;
}
@@ -329,42 +329,42 @@ static int MGADRIMapInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
pMga->registers.size = MGAIOMAPSIZE;
if ( drmAddMap( ctx->drmFD,
- (drmHandle)pMga->IOAddress,
- pMga->registers.size,
- DRM_REGISTERS, DRM_READ_ONLY,
- &pMga->registers.handle ) < 0 ) {
+ (drmHandle)pMga->IOAddress,
+ pMga->registers.size,
+ DRM_REGISTERS, DRM_READ_ONLY,
+ &pMga->registers.handle ) < 0 ) {
fprintf( stderr,
- "[drm] Could not add MMIO registers mapping\n" );
+ "[drm] Could not add MMIO registers mapping\n" );
return 0;
}
fprintf( stderr,
- "[drm] Registers handle = 0x%08lx\n",
- pMga->registers.handle );
+ "[drm] Registers handle = 0x%08lx\n",
+ pMga->registers.handle );
pMga->status.size = SAREA_MAX;
if ( drmAddMap( ctx->drmFD, 0, pMga->status.size,
- DRM_SHM, DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL,
- &pMga->status.handle ) < 0 ) {
+ DRM_SHM, DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL,
+ &pMga->status.handle ) < 0 ) {
fprintf( stderr,
- "[drm] Could not add status page mapping\n" );
+ "[drm] Could not add status page mapping\n" );
return 0;
}
fprintf( stderr,
- "[drm] Status handle = 0x%08lx\n",
- pMga->status.handle );
+ "[drm] Status handle = 0x%08lx\n",
+ pMga->status.handle );
if ( drmMap( ctx->drmFD,
- pMga->status.handle,
- pMga->status.size,
- &pMga->status.map ) < 0 ) {
+ pMga->status.handle,
+ pMga->status.size,
+ &pMga->status.map ) < 0 ) {
fprintf( stderr,
- "[agp] Could not map status page\n" );
+ "[agp] Could not map status page\n" );
return 0;
}
fprintf( stderr,
- "[agp] Status page mapped at 0x%08lx\n",
- (unsigned long)pMga->status.map );
+ "[agp] Status page mapped at 0x%08lx\n",
+ (unsigned long)pMga->status.map );
return 1;
}
@@ -380,24 +380,20 @@ static int MGADRIKernelInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
init.sarea_priv_offset = sizeof(XF86DRISAREARec);
switch ( pMga->Chipset ) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- init.chipset = MGA_CARD_TYPE_G400;
- break;
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- init.chipset = MGA_CARD_TYPE_G200;
- break;
- default:
- return 0;
+ case PCI_CHIP_MGAG550:
+ case PCI_CHIP_MGAG400:
+ init.chipset = MGA_CARD_TYPE_G400;
+ break;
+ case PCI_CHIP_MGAG200:
+ case PCI_CHIP_MGAG200_PCI:
+ init.chipset = MGA_CARD_TYPE_G200;
+ break;
+ default:
+ return 0;
}
init.sgram = 0; /* FIXME !pMga->HasSDRAM; */
- init.depth_cpp = ctx->bpp / 8;
- init.depth_offset = pMga->depthOffset;
- init.depth_pitch = pMga->depthPitch / init.depth_cpp;
-
init.texture_offset[0] = pMga->textureOffset;
init.texture_size[0] = pMga->textureSize;
@@ -415,7 +411,7 @@ static int MGADRIKernelInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
ret = drmCommandWrite( ctx->drmFD, DRM_MGA_INIT, &init, sizeof(drmMGAInit));
if ( ret < 0 ) {
fprintf( stderr,
- "[drm] Failed to initialize DMA! (%d)\n", ret );
+ "[drm] Failed to initialize DMA! (%d)\n", ret );
return 0;
}
@@ -424,8 +420,7 @@ static int MGADRIKernelInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
static void MGADRIIrqInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
{
- if (!pMga->irq)
- {
+ if (!pMga->irq) {
pMga->irq = drmGetInterruptFromBusID(ctx->drmFD,
ctx->pciBus,
ctx->pciDevice,
@@ -433,36 +428,33 @@ static void MGADRIIrqInit(struct DRIDriverContextRec *ctx, MGAPtr pMga)
fprintf(stderr, "[drm] got IRQ %d\n", pMga->irq);
- if((drmCtlInstHandler(ctx->drmFD, pMga->irq)) != 0)
- {
- fprintf(stderr,
- "[drm] failure adding irq handler, "
- "there is a device already using that irq\n"
- "[drm] falling back to irq-free operation\n");
- pMga->irq = 0;
+ if ((drmCtlInstHandler(ctx->drmFD, pMga->irq)) != 0) {
+ fprintf(stderr,
+ "[drm] failure adding irq handler, "
+ "there is a device already using that irq\n"
+ "[drm] falling back to irq-free operation\n");
+ pMga->irq = 0;
}
- else
- {
- pMga->reg_ien = INREG( MGAREG_IEN );
+ else {
+ pMga->reg_ien = INREG( MGAREG_IEN );
}
- }
+ }
- if (pMga->irq)
- fprintf(stderr,
- "[drm] dma control initialized, using IRQ %d\n",
- pMga->irq);
+ if (pMga->irq)
+ fprintf(stderr,
+ "[drm] dma control initialized, using IRQ %d\n",
+ pMga->irq);
}
static int MGADRIBuffersInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
{
pMga->drmBuffers = drmMapBufs( ctx->drmFD );
- if ( !pMga->drmBuffers )
- {
- fprintf( stderr,
- "[drm] Failed to map DMA buffers list\n" );
- return 0;
- }
-
+ if ( !pMga->drmBuffers ) {
+ fprintf( stderr,
+ "[drm] Failed to map DMA buffers list\n" );
+ return 0;
+ }
+
fprintf( stderr,
"[drm] Mapped %d DMA buffers\n",
pMga->drmBuffers->count );
@@ -472,24 +464,20 @@ static int MGADRIBuffersInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
static int MGAMemoryInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
{
- int width_bytes = ctx->shared.virtualWidth * ctx->cpp;
- int depthSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes
- + MGA_BUFFER_ALIGN)
- & ~MGA_BUFFER_ALIGN);
- int l;
+ int l;
fprintf(stderr,
- "Using %d MB AGP aperture\n", pMga->agpSize);
+ "Using %d MB AGP aperture\n", pMga->agpSize);
fprintf(stderr,
- "Using %d MB for vertex/indirect buffers\n", pMga->buffers.size>>20);
+ "Using %d MB for vertex/indirect buffers\n", pMga->buffers.size>>20);
fprintf(stderr,
- "Using %d MB for AGP textures\n", pMga->agpTextures.size>>20);
+ "Using %d MB for AGP textures\n", pMga->agpTextures.size>>20);
/* Front, back and depth buffers - everything else texture??
*/
- pMga->textureSize = ctx->shared.fbSize - depthSize;
+ pMga->textureSize = ctx->shared.fbSize;
- if (pMga->textureSize < 0)
+ if (pMga->textureSize <= 0)
return 0;
l = mylog2( pMga->textureSize / MGA_NR_TEX_REGIONS );
@@ -513,25 +501,12 @@ static int MGAMemoryInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
/* Reserve space for textures */
pMga->textureOffset = ((ctx->FBSize - pMga->textureSize +
- MGA_BUFFER_ALIGN) &
- ~MGA_BUFFER_ALIGN);
-
- /* Reserve space for the shared depth
- * buffer.
- */
- pMga->depthOffset = ((ctx->shared.fbOrigin +
- MGA_BUFFER_ALIGN) &
- ~MGA_BUFFER_ALIGN);
- pMga->depthPitch = ctx->shared.virtualWidth * ctx->cpp;
+ MGA_BUFFER_ALIGN) &
+ ~MGA_BUFFER_ALIGN);
-
-
- fprintf(stderr,
- "Will use depth buffer at offset %d.%d MB\n",
- pMga->depthOffset>>20, (pMga->depthOffset&0xfffff) * 1000 / 0x100000);
fprintf(stderr,
- "Will use %d kb for textures at offset %d.%d MB\n",
- pMga->textureSize/1024, pMga->textureOffset>>20,
+ "Will use %d kb for textures at offset %d.%d MB\n",
+ pMga->textureSize/1024, pMga->textureOffset>>20,
(pMga->textureOffset&0xfffff) * 1000 / 0x100000);
return 1;
@@ -539,120 +514,79 @@ static int MGAMemoryInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
static int MGACheckDRMVersion( struct DRIDriverContextRec *ctx, MGAPtr pMga )
{
- drmVersionPtr version;
-
- /* Check the MGA DRM version */
- version = drmGetVersion(ctx->drmFD);
- if ( version ) {
- if ( version->version_major != 3 ||
- version->version_minor < 0 ) {
- /* incompatible drm version */
- fprintf( stderr,
- "[dri] MGADRIScreenInit failed because of a version mismatch.\n"
- "[dri] mga.o kernel module version is %d.%d.%d but version 3.0.x is needed.\n"
- "[dri] Disabling DRI.\n",
- version->version_major,
- version->version_minor,
- version->version_patchlevel );
+ drmVersionPtr version;
+
+ /* Check the MGA DRM version */
+ version = drmGetVersion(ctx->drmFD);
+ if ( version ) {
+ if ( version->version_major != 3 ||
+ version->version_minor < 0 ) {
+ /* incompatible drm version */
+ fprintf( stderr,
+ "[dri] MGADRIScreenInit failed because of a version mismatch.\n"
+ "[dri] mga.o kernel module version is %d.%d.%d but version 3.0.x is needed.\n"
+ "[dri] Disabling DRI.\n",
+ version->version_major,
+ version->version_minor,
+ version->version_patchlevel );
+ drmFreeVersion( version );
+ return 0;
+ }
drmFreeVersion( version );
- return 0;
- }
- drmFreeVersion( version );
- }
+ }
- return 1;
+ return 1;
}
static void print_client_msg( MGADRIPtr pMGADRI )
{
- fprintf( stderr, "chipset: %d\n", pMGADRI->chipset );
-
- fprintf( stderr, "mem: %d\n", pMGADRI->mem );
+ fprintf( stderr, "chipset: %d\n", pMGADRI->chipset );
- fprintf( stderr, "agpMode: %d\n", pMGADRI->agpMode );
+ fprintf( stderr, "mem: %d\n", pMGADRI->mem );
- fprintf( stderr, "depthOffset: %d\n", pMGADRI->depthOffset );
- fprintf( stderr, "depthPitch: %d\n", pMGADRI->depthPitch );
+ fprintf( stderr, "agpMode: %d\n", pMGADRI->agpMode );
- fprintf( stderr, "textureOffset: %d\n", pMGADRI->textureOffset );
- fprintf( stderr, "textureSize: %d\n", pMGADRI->textureSize );
+ fprintf( stderr, "textureOffset: %d\n", pMGADRI->textureOffset );
+ fprintf( stderr, "textureSize: %d\n", pMGADRI->textureSize );
- fprintf( stderr, "logTextureGranularity: %d\n", pMGADRI->logTextureGranularity );
- fprintf( stderr, "logAgpTextureGranularity: %d\n", pMGADRI->logAgpTextureGranularity );
+ fprintf( stderr, "logTextureGranularity: %d\n", pMGADRI->logTextureGranularity );
+ fprintf( stderr, "logAgpTextureGranularity: %d\n", pMGADRI->logAgpTextureGranularity );
- fprintf( stderr, "agpTextureHandle: %u\n", (unsigned int)pMGADRI->agpTextureOffset );
- fprintf( stderr, "agpTextureSize: %u\n", (unsigned int)pMGADRI->agpTextureSize );
+ fprintf( stderr, "agpTextureHandle: %u\n", (unsigned int)pMGADRI->agpTextureOffset );
+ fprintf( stderr, "agpTextureSize: %u\n", (unsigned int)pMGADRI->agpTextureSize );
#if 0
- pMGADRI->registers.handle = pMga->registers.handle;
- pMGADRI->registers.size = pMga->registers.size;
- pMGADRI->status.handle = pMga->status.handle;
- pMGADRI->status.size = pMga->status.size;
- pMGADRI->primary.handle = pMga->primary.handle;
- pMGADRI->primary.size = pMga->primary.size;
- pMGADRI->buffers.handle = pMga->buffers.handle;
- pMGADRI->buffers.size = pMga->buffers.size;
+ pMGADRI->registers.handle = pMga->registers.handle;
+ pMGADRI->registers.size = pMga->registers.size;
+ pMGADRI->status.handle = pMga->status.handle;
+ pMGADRI->status.size = pMga->status.size;
+ pMGADRI->primary.handle = pMga->primary.handle;
+ pMGADRI->primary.size = pMga->primary.size;
+ pMGADRI->buffers.handle = pMga->buffers.handle;
+ pMGADRI->buffers.size = pMga->buffers.size;
pMGADRI->sarea_priv_offset = sizeof(XF86DRISAREARec);
#endif
}
static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
{
- int i;
- int err;
- MGADRIPtr pMGADRI;
+ int i;
+ int err;
+ MGADRIPtr pMGADRI;
- //assert(!ctx->IsClient);
+ //assert(!ctx->IsClient);
- switch (ctx->bpp)
- {
- case 16:
- case 32:
- break;
- default:
- fprintf(stderr, "[drm] Direct rendering only supported for RGB16 and RGB32 yet\n");
- return 0;
- }
-
-
- {
- int width_bytes = (ctx->shared.virtualWidth * ctx->cpp);
- int maxy = ctx->shared.fbSize / width_bytes;
-
-
- if (maxy <= ctx->shared.virtualHeight * 3) {
- fprintf(stderr,
- "Static buffer allocation failed -- "
- "need at least %d kB video memory (have %d kB)\n",
- (ctx->shared.virtualWidth * ctx->shared.virtualHeight *
- ctx->cpp * 3 + 1023) / 1024,
- ctx->shared.fbSize / 1024);
- return 0;
- }
- }
-
- switch(pMga->Chipset) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- case PCI_CHIP_MGAG200:
+ switch (pMga->Chipset) {
+ case PCI_CHIP_MGAG550:
+ case PCI_CHIP_MGAG400:
+ case PCI_CHIP_MGAG200:
#if 0
- case PCI_CHIP_MGAG200_PCI:
+ case PCI_CHIP_MGAG200_PCI:
#endif
- break;
- default:
- fprintf(stderr, "[drm] Direct rendering only supported with G200/G400/G550 AGP\n");
- return 0;
- }
-
- fprintf( stderr,
- "[drm] bpp: %d depth: %d\n",
- ctx->bpp, ctx->bpp /* FIXME: depth */ );
-
- if ( (ctx->bpp / 8) != 2 &&
- (ctx->bpp / 8) != 4 ) {
- fprintf( stderr,
- "[dri] Direct rendering only supported in 16 and 32 bpp modes\n" );
- return 0;
+ break;
+ default:
+ fprintf(stderr, "[drm] Direct rendering only supported with G200/G400/G550 AGP\n");
+ return 0;
}
ctx->shared.SAREASize = SAREA_MAX;
@@ -667,64 +601,61 @@ static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) {
fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n",
- ctx->drmFD, ctx->pciBusID, strerror(-err));
+ ctx->drmFD, ctx->pciBusID, strerror(-err));
return 0;
}
-
+
if (drmAddMap( ctx->drmFD,
- 0,
- ctx->shared.SAREASize,
- DRM_SHM,
- DRM_CONTAINS_LOCK,
- &ctx->shared.hSAREA) < 0)
- {
+ 0,
+ ctx->shared.SAREASize,
+ DRM_SHM,
+ DRM_CONTAINS_LOCK,
+ &ctx->shared.hSAREA) < 0) {
fprintf(stderr, "[drm] drmAddMap failed\n");
return 0;
}
fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n",
- ctx->shared.SAREASize, ctx->shared.hSAREA);
+ ctx->shared.SAREASize, ctx->shared.hSAREA);
if (drmMap( ctx->drmFD,
- ctx->shared.hSAREA,
- ctx->shared.SAREASize,
- (drmAddressPtr)(&ctx->pSAREA)) < 0)
- {
+ ctx->shared.hSAREA,
+ ctx->shared.SAREASize,
+ (drmAddressPtr)(&ctx->pSAREA)) < 0) {
fprintf(stderr, "[drm] drmMap failed\n");
return 0;
}
memset(ctx->pSAREA, 0, ctx->shared.SAREASize);
fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n",
- ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
-
+ ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize);
+
/* Need to AddMap the framebuffer and mmio regions here:
*/
if (drmAddMap( ctx->drmFD,
- (drmHandle)ctx->FBStart,
- ctx->FBSize,
- DRM_FRAME_BUFFER,
- 0,
- &ctx->shared.hFrameBuffer) < 0)
- {
+ (drmHandle)ctx->FBStart,
+ ctx->FBSize,
+ DRM_FRAME_BUFFER,
+ 0,
+ &ctx->shared.hFrameBuffer) < 0) {
fprintf(stderr, "[drm] drmAddMap framebuffer failed\n");
return 0;
}
fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
- ctx->shared.hFrameBuffer);
+ ctx->shared.hFrameBuffer);
#if 0 /* will be done in MGADRIMapInit */
if (drmAddMap(ctx->drmFD,
- ctx->FixedInfo.mmio_start,
- ctx->FixedInfo.mmio_len,
- DRM_REGISTERS,
- DRM_READ_ONLY,
- &pMga->registers.handle) < 0) {
- fprintf(stderr, "[drm] drmAddMap mmio failed\n");
+ ctx->FixedInfo.mmio_start,
+ ctx->FixedInfo.mmio_len,
+ DRM_REGISTERS,
+ DRM_READ_ONLY,
+ &pMga->registers.handle) < 0) {
+ fprintf(stderr, "[drm] drmAddMap mmio failed\n");
return 0;
}
fprintf(stderr,
- "[drm] register handle = 0x%08lx\n", pMga->registers.handle);
+ "[drm] register handle = 0x%08lx\n", pMga->registers.handle);
#endif
@@ -779,7 +710,7 @@ static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
{
MGASAREAPrivPtr pSAREAPriv;
pSAREAPriv = (MGASAREAPrivPtr)(((char*)ctx->pSAREA) +
- sizeof(XF86DRISAREARec));
+ sizeof(XF86DRISAREARec));
memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
}
@@ -789,12 +720,12 @@ static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
* first.
*/
memset(ctx->FBAddress + pMga->frontOffset,
- 0,
- pMga->frontPitch * ctx->shared.virtualHeight );
+ 0,
+ pMga->frontPitch * ctx->shared.virtualHeight );
memset(ctx->FBAddress + pMga->backOffset,
- 0,
- pMga->backPitch * ctx->shared.virtualHeight );
+ 0,
+ pMga->backPitch * ctx->shared.virtualHeight );
#endif
/* Can release the lock now */
@@ -807,26 +738,24 @@ static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
pMGADRI = (MGADRIPtr)ctx->driverClientMsg;
- switch(pMga->Chipset) {
- case PCI_CHIP_MGAG550:
- case PCI_CHIP_MGAG400:
- pMGADRI->chipset = MGA_CARD_TYPE_G400;
- break;
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- pMGADRI->chipset = MGA_CARD_TYPE_G200;
- break;
- default:
- return 0;
+ switch (pMga->Chipset) {
+ case PCI_CHIP_MGAG550:
+ case PCI_CHIP_MGAG400:
+ pMGADRI->chipset = MGA_CARD_TYPE_G400;
+ break;
+ case PCI_CHIP_MGAG200:
+ case PCI_CHIP_MGAG200_PCI:
+ pMGADRI->chipset = MGA_CARD_TYPE_G200;
+ break;
+ default:
+ return 0;
}
- pMGADRI->mem = ctx->shared.fbSize;
+ pMGADRI->mem = ctx->shared.fbSize;
- pMGADRI->agpMode = pMga->agpMode;
+ pMGADRI->agpMode = pMga->agpMode;
- pMGADRI->depthOffset = pMga->depthOffset;
- pMGADRI->depthPitch = pMga->depthPitch;
- pMGADRI->textureOffset = pMga->textureOffset;
- pMGADRI->textureSize = pMga->textureSize;
+ pMGADRI->textureOffset = pMga->textureOffset;
+ pMGADRI->textureSize = pMga->textureSize;
pMGADRI->logTextureGranularity = pMga->logTextureGranularity;
i = mylog2( pMga->agpTextures.size / MGA_NR_TEX_REGIONS );
@@ -837,14 +766,14 @@ static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga )
pMGADRI->agpTextureOffset = (unsigned int)pMga->agpTextures.handle;
pMGADRI->agpTextureSize = (unsigned int)pMga->agpTextures.size;
- pMGADRI->registers.handle = pMga->registers.handle;
- pMGADRI->registers.size = pMga->registers.size;
- pMGADRI->status.handle = pMga->status.handle;
- pMGADRI->status.size = pMga->status.size;
- pMGADRI->primary.handle = pMga->primary.handle;
- pMGADRI->primary.size = pMga->primary.size;
- pMGADRI->buffers.handle = pMga->buffers.handle;
- pMGADRI->buffers.size = pMga->buffers.size;
+ pMGADRI->registers.handle = pMga->registers.handle;
+ pMGADRI->registers.size = pMga->registers.size;
+ pMGADRI->status.handle = pMga->status.handle;
+ pMGADRI->status.size = pMga->status.size;
+ pMGADRI->primary.handle = pMga->primary.handle;
+ pMGADRI->primary.size = pMga->primary.size;
+ pMGADRI->buffers.handle = pMga->buffers.handle;
+ pMGADRI->buffers.size = pMga->buffers.size;
pMGADRI->sarea_priv_offset = sizeof(XF86DRISAREARec);
print_client_msg( pMGADRI );
@@ -875,64 +804,54 @@ static int mgaInitScreenConfigs( struct DRIDriverContextRec *ctx,
*numConfigs = 1;
*configs = (__GLXvisualConfig *) calloc(*numConfigs,
- sizeof(__GLXvisualConfig));
-
- switch (ctx->bpp) {
- case 32:
- for (i = 0; i < *numConfigs; i++) {
- (*configs)[i].vid = 100 + i;
- (*configs)[i].class = TrueColor;
- (*configs)[i].rgba = True;
- (*configs)[i].redSize = 8;
- (*configs)[i].greenSize = 8;
- (*configs)[i].blueSize = 8;
- (*configs)[i].alphaSize = 8;
- (*configs)[i].redMask = 0xff0000;
- (*configs)[i].greenMask = 0xff00;
- (*configs)[i].blueMask = 0xff;
- (*configs)[i].alphaMask = 0xff000000;
- (*configs)[i].doubleBuffer = True;
- (*configs)[i].stereo = False;
- (*configs)[i].bufferSize = 32;
- (*configs)[i].depthSize = 24;
- (*configs)[i].stencilSize = 8;
- (*configs)[i].auxBuffers = 0;
- (*configs)[i].level = 0;
- /* leave remaining fields zero */
- }
- break;
-
- case 16:
- for (i = 0; i < *numConfigs; i++) {
- (*configs)[i].vid = 100 + i;
- (*configs)[i].class = TrueColor;
- (*configs)[i].rgba = True;
- (*configs)[i].redSize = 5;
- (*configs)[i].greenSize = 6;
- (*configs)[i].blueSize = 5;
- (*configs)[i].alphaSize = 0;
- (*configs)[i].redMask = 0xf800;
- (*configs)[i].greenMask = 0x07e0;
- (*configs)[i].blueMask = 0x001f;
- (*configs)[i].alphaMask = 0x0000;
- (*configs)[i].doubleBuffer = True;
- (*configs)[i].stereo = False;
- (*configs)[i].bufferSize = 16;
- (*configs)[i].depthSize = 16;
- (*configs)[i].stencilSize = 0;
- (*configs)[i].auxBuffers = 0;
- (*configs)[i].level = 0;
- /* leave remaining fields zero */
- }
- break;
+ sizeof(__GLXvisualConfig));
+
+ /* ARGB */
+ for (i = 0; i < *numConfigs; i++) {
+ (*configs)[i].vid = 100 + i;
+ (*configs)[i].class = TrueColor;
+ (*configs)[i].rgba = True;
+ (*configs)[i].redSize = 8;
+ (*configs)[i].greenSize = 8;
+ (*configs)[i].blueSize = 8;
+ (*configs)[i].alphaSize = 8;
+ (*configs)[i].redMask = 0xff0000;
+ (*configs)[i].greenMask = 0xff00;
+ (*configs)[i].blueMask = 0xff;
+ (*configs)[i].alphaMask = 0xff000000;
+ (*configs)[i].doubleBuffer = True;
+ (*configs)[i].stereo = False;
+ (*configs)[i].bufferSize = 32;
+ (*configs)[i].depthSize = 24;
+ (*configs)[i].stencilSize = 8;
+ (*configs)[i].auxBuffers = 0;
+ (*configs)[i].level = 0;
+ /* leave remaining fields zero */
+ }
- default:
- fprintf(stderr, "Unknown bpp in %s: %d\n", __FUNCTION__,
- ctx->bpp);
- exit(1);
- break;
+ /* RGB565 */
+ for (i = 0; i < *numConfigs; i++) {
+ (*configs)[i].vid = 100 + i;
+ (*configs)[i].class = TrueColor;
+ (*configs)[i].rgba = True;
+ (*configs)[i].redSize = 5;
+ (*configs)[i].greenSize = 6;
+ (*configs)[i].blueSize = 5;
+ (*configs)[i].alphaSize = 0;
+ (*configs)[i].redMask = 0xf800;
+ (*configs)[i].greenMask = 0x07e0;
+ (*configs)[i].blueMask = 0x001f;
+ (*configs)[i].alphaMask = 0x0000;
+ (*configs)[i].doubleBuffer = True;
+ (*configs)[i].stereo = False;
+ (*configs)[i].bufferSize = 16;
+ (*configs)[i].depthSize = 16;
+ (*configs)[i].stencilSize = 0;
+ (*configs)[i].auxBuffers = 0;
+ (*configs)[i].level = 0;
+ /* leave remaining fields zero */
+ }
- }
return 1;
}
@@ -987,24 +906,11 @@ static int mgaInitFBDev( struct DRIDriverContextRec *ctx )
{
MGAPtr pMga = calloc(1, sizeof(*pMga));
- {
- int dummy = ctx->shared.virtualWidth;
-
- switch (ctx->bpp / 8) {
- case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break;
- case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break;
- case 3:
- case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break;
- }
-
- ctx->shared.virtualWidth = dummy;
- }
-
ctx->driverPrivate = (void *)pMga;
-
+
pMga->agpMode = MGA_DEFAULT_AGP_MODE;
pMga->agpSize = MGA_DEFAULT_AGP_SIZE;
-
+
pMga->Chipset = ctx->chipset;
pMga->IOAddress = ctx->MMIOStart;
@@ -1028,61 +934,61 @@ static int mgaInitFBDev( struct DRIDriverContextRec *ctx )
*/
static void mgaHaltFBDev( struct DRIDriverContextRec *ctx )
{
- MGAPtr pMga = ctx->driverPrivate;
- drmMGAInit init;
-
- if ( pMga->drmBuffers ) {
- drmUnmapBufs( pMga->drmBuffers );
- pMga->drmBuffers = NULL;
- }
-
- if (pMga->irq) {
- drmCtlUninstHandler(ctx->drmFD);
- pMga->irq = 0;
- }
-
- /* Cleanup DMA */
- memset( &init, 0, sizeof(drmMGAInit) );
- init.func = MGA_CLEANUP_DMA;
- drmCommandWrite( ctx->drmFD, DRM_MGA_INIT, &init, sizeof(drmMGAInit) );
-
- if ( pMga->status.map ) {
- drmUnmap( pMga->status.map, pMga->status.size );
- pMga->status.map = NULL;
- }
- if ( pMga->buffers.map ) {
- drmUnmap( pMga->buffers.map, pMga->buffers.size );
- pMga->buffers.map = NULL;
- }
- if ( pMga->primary.map ) {
- drmUnmap( pMga->primary.map, pMga->primary.size );
- pMga->primary.map = NULL;
- }
- if ( pMga->warp.map ) {
- drmUnmap( pMga->warp.map, pMga->warp.size );
- pMga->warp.map = NULL;
- }
-
- if ( pMga->agpTextures.map ) {
- drmUnmap( pMga->agpTextures.map, pMga->agpTextures.size );
- pMga->agpTextures.map = NULL;
- }
-
- if ( pMga->agp.handle ) {
- drmAgpUnbind( ctx->drmFD, pMga->agp.handle );
- drmAgpFree( ctx->drmFD, pMga->agp.handle );
- pMga->agp.handle = 0;
- drmAgpRelease( ctx->drmFD );
- }
-
- drmUnlock( ctx->drmFD, ctx->serverContext );
- drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
- drmClose(ctx->drmFD);
-
- if (ctx->driverPrivate) {
- free(ctx->driverPrivate);
- ctx->driverPrivate = NULL;
- }
+ MGAPtr pMga = ctx->driverPrivate;
+ drmMGAInit init;
+
+ if ( pMga->drmBuffers ) {
+ drmUnmapBufs( pMga->drmBuffers );
+ pMga->drmBuffers = NULL;
+ }
+
+ if (pMga->irq) {
+ drmCtlUninstHandler(ctx->drmFD);
+ pMga->irq = 0;
+ }
+
+ /* Cleanup DMA */
+ memset( &init, 0, sizeof(drmMGAInit) );
+ init.func = MGA_CLEANUP_DMA;
+ drmCommandWrite( ctx->drmFD, DRM_MGA_INIT, &init, sizeof(drmMGAInit) );
+
+ if ( pMga->status.map ) {
+ drmUnmap( pMga->status.map, pMga->status.size );
+ pMga->status.map = NULL;
+ }
+ if ( pMga->buffers.map ) {
+ drmUnmap( pMga->buffers.map, pMga->buffers.size );
+ pMga->buffers.map = NULL;
+ }
+ if ( pMga->primary.map ) {
+ drmUnmap( pMga->primary.map, pMga->primary.size );
+ pMga->primary.map = NULL;
+ }
+ if ( pMga->warp.map ) {
+ drmUnmap( pMga->warp.map, pMga->warp.size );
+ pMga->warp.map = NULL;
+ }
+
+ if ( pMga->agpTextures.map ) {
+ drmUnmap( pMga->agpTextures.map, pMga->agpTextures.size );
+ pMga->agpTextures.map = NULL;
+ }
+
+ if ( pMga->agp.handle ) {
+ drmAgpUnbind( ctx->drmFD, pMga->agp.handle );
+ drmAgpFree( ctx->drmFD, pMga->agp.handle );
+ pMga->agp.handle = 0;
+ drmAgpRelease( ctx->drmFD );
+ }
+
+ drmUnlock( ctx->drmFD, ctx->serverContext );
+ drmUnmap( ctx->pSAREA, ctx->shared.SAREASize );
+ drmClose(ctx->drmFD);
+
+ if (ctx->driverPrivate) {
+ free(ctx->driverPrivate);
+ ctx->driverPrivate = NULL;
+ }
}
diff --git a/src/mesa/drivers/dri/mga/server/mga_dri.h b/src/mesa/drivers/dri/mga/server/mga_dri.h
index d124747d681..87b775feb20 100644
--- a/src/mesa/drivers/dri/mga/server/mga_dri.h
+++ b/src/mesa/drivers/dri/mga/server/mga_dri.h
@@ -48,9 +48,6 @@ typedef struct {
int agpMode;
- int depthOffset;
- int depthPitch;
-
int textureOffset;
int textureSize;
int logTextureGranularity;
diff --git a/src/mesa/drivers/dri/mga/server/mga_sarea.h b/src/mesa/drivers/dri/mga/server/mga_sarea.h
index 3d37cf4f73a..52d5b0219ca 100644
--- a/src/mesa/drivers/dri/mga/server/mga_sarea.h
+++ b/src/mesa/drivers/dri/mga/server/mga_sarea.h
@@ -124,6 +124,10 @@ typedef struct {
unsigned int draw_offset;
unsigned int draw_pitch;
+ unsigned int depth_cpp;
+ unsigned int depth_offset;
+ unsigned int depth_pitch;
+
unsigned int maccess;
unsigned int plnwt;
unsigned int dwgctl;
diff --git a/src/miniglx/dri_util.c b/src/miniglx/dri_util.c
index af48d0086c8..eace892cba5 100644
--- a/src/miniglx/dri_util.c
+++ b/src/miniglx/dri_util.c
@@ -644,9 +644,6 @@ __driUtilCreateScreen(struct DRIDriverRec *driver,
//psp->fbStride = driverContext->shared.fbStride;
psp->devPrivSize = driverContext->driverClientMsgSize;
psp->pDevPriv = driverContext->driverClientMsg;
- psp->fbWidth = driverContext->shared.virtualWidth;
- psp->fbHeight = driverContext->shared.virtualHeight;
- psp->fbBPP = driverContext->bpp;
if (driverContext->IsClient) {
/*
@@ -742,9 +739,6 @@ __driUtilCreateScreenNoDRM(struct DRIDriverRec *driver,
//psp->fbStride = driverContext->shared.fbStride;
psp->devPrivSize = driverContext->driverClientMsgSize;
psp->pDevPriv = driverContext->driverClientMsg;
- psp->fbWidth = driverContext->shared.virtualWidth;
- psp->fbHeight = driverContext->shared.virtualHeight;
- psp->fbBPP = driverContext->bpp;
psp->pFB = driverContext->FBAddress;
diff --git a/src/miniglx/dri_util.h b/src/miniglx/dri_util.h
index cb59634644a..2ca30b96350 100644
--- a/src/miniglx/dri_util.h
+++ b/src/miniglx/dri_util.h
@@ -164,13 +164,6 @@ struct __DriverAPIRec {
*/
struct __DRIdrawablePrivateRec {
/**
- * \brief Kernel drawable handle
- *
- * \note Not currently used.
- */
- drmDrawable hHWDrawable;
-
- /**
* \brief Driver's private drawable information.
*
* This structure is opaque.
@@ -178,11 +171,6 @@ struct __DRIdrawablePrivateRec {
void *driverPrivate;
/**
- * \brief X's drawable ID associated with this private drawable.
- */
- //GLXDrawable draw;
-
- /**
* \brief Reference count for number of context's currently bound to this
* drawable.
*
@@ -247,22 +235,16 @@ struct __DRIdrawablePrivateRec {
*/
__DRIscreenPrivate *driScreenPriv;
- /**
- * \name
- * Basically just need these for when the locking code needs to call
- * __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo().
- */
- /*@{*/
- //Display *display;
- //int screen;
- /*@}*/
-
int cpp;
int frontOffset;
int frontPitch;
int backOffset;
int backPitch;
+ int depthCpp;
+ int depthOffset;
+ int depthPitch;
+
/**
* \brief Called via glXSwapBuffers().
*/
@@ -276,11 +258,6 @@ struct __DRIcontextPrivateRec {
/**
* \brief Kernel context handle used to access the device lock.
*/
- XID contextID;
-
- /**
- * \brief Kernel context handle used to access the device lock.
- */
drmContext hHWContext;
/**
@@ -289,11 +266,6 @@ struct __DRIcontextPrivateRec {
void *driverPrivate;
/**
- * \brief This context's display pointer.
- */
- //Display *display;
-
- /**
* \brief Pointer to drawable currently bound to this context.
*/
__DRIdrawablePrivate *driDrawablePriv;
@@ -309,11 +281,6 @@ struct __DRIcontextPrivateRec {
*/
struct __DRIscreenPrivateRec {
/**
- * \brief Display for this screen
- */
- //Display *display;
-
- /**
* \brief Current screen's number
*/
int myNum;
@@ -354,14 +321,6 @@ struct __DRIscreenPrivateRec {
/*@}*/
/**
- * \brief 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;
-
- /**
* \brief File descriptor returned when the kernel device driver is opened.
*
* Used to:
@@ -389,9 +348,6 @@ struct __DRIscreenPrivateRec {
int fbSize;
int fbOrigin;
int fbStride;
- int fbWidth;
- int fbHeight;
- int fbBPP;
/*@}*/
/**
@@ -405,23 +361,6 @@ struct __DRIscreenPrivateRec {
/*@}*/
/**
- * \brief 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 hardware 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;
-
- /**
- * \brief Hash table to hold the drawable information for this screen.
- */
- void *drawHash;
-
- /**
* \brief Device-dependent private information (not stored in the SAREA).
*
* This pointer is never touched by the DRI layer.
@@ -429,14 +368,6 @@ struct __DRIscreenPrivateRec {
void *private;
/**
- * \brief Full screen mode.
- *
- * If we're in full screen mode (via DRIOpenFullScreen()), this points to
- * the drawable that was bound. Otherwise, this is NULL.
- */
- __DRIdrawablePrivate *fullscreen;
-
- /**
* \name Visuals
*
* Visuals (configs) in this screen.
diff --git a/src/miniglx/miniglx.c b/src/miniglx/miniglx.c
index c54c6c45f70..d08f79db565 100644
--- a/src/miniglx/miniglx.c
+++ b/src/miniglx/miniglx.c
@@ -22,7 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $Id: miniglx.c,v 1.1.4.53.4.1 2003/05/06 00:01:40 dok666 Exp $ */
+/* $Id: miniglx.c,v 1.1.4.53.4.2 2003/05/11 13:35:14 dok666 Exp $ */
/**
@@ -379,8 +379,8 @@ SetupFBDev( Display *dpy )
assert(dpy);
- width = dpy->driverContext.shared.virtualWidth;
- height = dpy->driverContext.shared.virtualHeight;
+ width = dpy->width;
+ height = dpy->height;
/* Bump size up to next supported mode.
*/
@@ -398,14 +398,14 @@ SetupFBDev( Display *dpy )
}
- dpy->driverContext.shared.virtualHeight = height;
- dpy->driverContext.shared.virtualWidth = width;
+ dpy->height = height;
+ dpy->width = width;
/* set the depth, resolution, etc */
dpy->VarInfo = dpy->OrigVarInfo;
- dpy->VarInfo.bits_per_pixel = dpy->driverContext.bpp;
- dpy->VarInfo.xres_virtual = dpy->driverContext.shared.virtualWidth;
- dpy->VarInfo.yres_virtual = dpy->driverContext.shared.virtualHeight;
+ dpy->VarInfo.bits_per_pixel = dpy->bpp;
+ dpy->VarInfo.xres_virtual = dpy->width;
+ dpy->VarInfo.yres_virtual = dpy->height;
dpy->VarInfo.xres = width;
dpy->VarInfo.yres = height;
dpy->VarInfo.xoffset = 0;
@@ -766,10 +766,10 @@ static int __read_config_file( Display *dpy )
dpy->driverContext.pciFunc = 0;
dpy->driverContext.chipset = 0;
dpy->driverContext.pciBusID = 0;
- dpy->driverContext.shared.virtualWidth = 1280;
- dpy->driverContext.shared.virtualHeight = 1024;
- dpy->driverContext.bpp = 32;
- dpy->driverContext.cpp = 4;
+ dpy->width = 1280;
+ dpy->height = 1024;
+ dpy->bpp = 32;
+ dpy->cpp = 4;
dpy->rotateMode = 0;
fname = getenv("MINIGLX_CONF");
@@ -824,17 +824,17 @@ static int __read_config_file( Display *dpy )
fprintf(stderr, "malformed chipset: %s\n", opt);
}
else if (strcmp(opt, "virtualWidth") == 0) {
- if (sscanf(val, "%d", &dpy->driverContext.shared.virtualWidth) != 1)
+ if (sscanf(val, "%d", &dpy->width) != 1)
fprintf(stderr, "malformed virtualWidth: %s\n", opt);
}
else if (strcmp(opt, "virtualHeight") == 0) {
- if (sscanf(val, "%d", &dpy->driverContext.shared.virtualHeight) != 1)
+ if (sscanf(val, "%d", &dpy->height) != 1)
fprintf(stderr, "malformed virutalHeight: %s\n", opt);
}
else if (strcmp(opt, "bpp") == 0) {
- if (sscanf(val, "%d", &dpy->driverContext.bpp) != 1)
+ if (sscanf(val, "%d", &dpy->bpp) != 1)
fprintf(stderr, "malformed bpp: %s\n", opt);
- dpy->driverContext.cpp = dpy->driverContext.bpp / 8;
+ dpy->cpp = dpy->bpp / 8;
}
}
@@ -1186,9 +1186,9 @@ XCreateWindow( Display *display, Window parent, int x, int y,
win->h = height;
win->visual = visual; /* ptr assignment */
- win->bytesPerPixel = display->driverContext.cpp;
- win->rowStride = display->driverContext.shared.virtualWidth * win->bytesPerPixel;
- win->size = win->rowStride * height;
+ win->bytesPerPixel = display->cpp;
+ win->rowStride = display->width * win->bytesPerPixel;
+ win->size = win->rowStride * height;
win->frontStart = display->driverContext.FBAddress;
win->frontBottom = (GLubyte *) win->frontStart + (height-1) * win->rowStride;
@@ -1229,7 +1229,7 @@ XCreateWindow( Display *display, Window parent, int x, int y,
dPriv->backPitch = win->rowStride;
if (visual->glxConfig->doubleBuffer)
- dPriv->backOffset += win->rowStride * display->driverContext.shared.virtualHeight;
+ dPriv->backOffset += win->rowStride * display->height;
display->NumWindows++;
display->TheWindow = win;
@@ -1394,7 +1394,7 @@ XGetVisualInfo( Display *dpy, long vinfo_mask, XVisualInfo *vinfo_template, int
visResults[i].visInfo = results + i;
visResults[i].dpy = dpy;
- if (dpy->driverContext.bpp == 32)
+ if (dpy->bpp == 32)
visResults[i].pixelFormat = PF_B8G8R8A8; /* XXX: FIX ME */
else
visResults[i].pixelFormat = PF_B5G6R5; /* XXX: FIX ME */
@@ -1406,7 +1406,7 @@ XGetVisualInfo( Display *dpy, long vinfo_mask, XVisualInfo *vinfo_template, int
dpy->configs[i].greenSize +
dpy->configs[i].blueSize +
dpy->configs[i].alphaSize;
- results[i].bits_per_rgb = dpy->driverContext.bpp;
+ results[i].bits_per_rgb = dpy->bpp;
}
*nitens_return = n;
return results;
@@ -1587,9 +1587,9 @@ glXChooseVisual( Display *dpy, int screen, int *attribList )
if (rgbFlag) {
/* XXX maybe support depth 16 someday */
visInfo->class = TrueColor;
- visInfo->depth = dpy->driverContext.bpp;
- visInfo->bits_per_rgb = dpy->driverContext.bpp;
- if (dpy->driverContext.bpp == 32)
+ visInfo->depth = dpy->bpp;
+ visInfo->bits_per_rgb = dpy->bpp;
+ if (dpy->bpp == 32)
vis->pixelFormat = PF_B8G8R8A8;
else
vis->pixelFormat = PF_B5G6R5;
diff --git a/src/miniglx/miniglxP.h b/src/miniglx/miniglxP.h
index c7b60cd774f..e2f5d19403d 100644
--- a/src/miniglx/miniglxP.h
+++ b/src/miniglx/miniglxP.h
@@ -183,8 +183,6 @@ struct DRIDriverContextRec {
int pciDevice;
int pciFunc;
int chipset;
- int bpp;
- int cpp;
unsigned long FBStart; /**< \brief physical address of the framebuffer */
unsigned long MMIOStart; /**< \brief physical address of the MMIO region */
@@ -208,8 +206,6 @@ struct DRIDriverContextRec {
unsigned long hFrameBuffer;
int fbOrigin;
int fbSize;
- int virtualWidth;
- int virtualHeight;
} shared;
int IsClient;
@@ -402,6 +398,11 @@ struct MiniGLXDisplayRec {
Window TheWindow; /**< \brief open window - only allow one window for now */
int rotateMode;
+ int bpp;
+ int cpp;
+ int width;
+ int height;
+
volatile int vtSignalFlag, haveVT;
int hwActive;