st/mesa: fix glCopyPixels bugs/crashes when src region need clipping
[mesa.git] / src / mesa / drivers / dri / tdfx / server / tdfx_dri.c
index e0f7609be76a70d3a8cb0f7cfa83c2b95b4517f3..63fe875f59eca70baac18f8a65aa71e5f08a2b76 100644 (file)
@@ -259,7 +259,7 @@ static int createScreen (DRIDriverContext *ctx, TDFXDRIPtr pTDFX)
    /* Need to AddMap the framebuffer and mmio regions here:
     */
    if (drmAddMap( ctx->drmFD,
-                 (drmHandle)ctx->FBStart,
+                 (drm_handle_t)ctx->FBStart,
                  ctx->FBSize,
                  DRM_FRAME_BUFFER,
 #ifndef _EMBEDDED
@@ -326,59 +326,6 @@ static int createScreen (DRIDriverContext *ctx, TDFXDRIPtr pTDFX)
 }
 
 
-/**
- * \brief Establish the set of modes available for the display.
- *
- * \param ctx display handle.
- * \param numModes will receive the number of supported modes.
- * \param modes will point to the list of supported modes.
- *
- * \return one on success, or zero on failure.
- * 
- * Allocates a single visual and fills it with information according to the
- * display bit depth. Supports only 16 and 32 bpp bit depths, aborting
- * otherwise.
- */
-const __GLcontextModes __glModes[] = {
-
-    /* 32 bit, RGBA Depth=24 Stencil=8 */
-    {.rgbMode = GL_TRUE, .colorIndexMode = GL_FALSE, .doubleBufferMode = GL_TRUE, .stereoMode = GL_FALSE,
-     .haveAccumBuffer = GL_FALSE, .haveDepthBuffer = GL_TRUE, .haveStencilBuffer = GL_TRUE,
-     .redBits = 8, .greenBits = 8, .blueBits = 8, .alphaBits = 8,
-     .redMask = 0xff0000, .greenMask = 0xff00, .blueMask = 0xff, .alphaMask = 0xff000000,
-     .rgbBits = 32, .indexBits = 0,
-     .accumRedBits = 0, .accumGreenBits = 0, .accumBlueBits = 0, .accumAlphaBits = 0,
-     .depthBits = 24, .stencilBits = 8,
-     .numAuxBuffers= 0, .level = 0, .pixmapMode = GL_FALSE, },
-
-    /* 16 bit, RGB Depth=16 */
-    {.rgbMode = GL_TRUE, .colorIndexMode = GL_FALSE, .doubleBufferMode = GL_TRUE, .stereoMode = GL_FALSE,
-     .haveAccumBuffer = GL_FALSE, .haveDepthBuffer = GL_TRUE, .haveStencilBuffer = GL_FALSE,
-     .redBits = 5, .greenBits = 6, .blueBits = 5, .alphaBits = 0,
-     .redMask = 0xf800, .greenMask = 0x07e0, .blueMask = 0x001f, .alphaMask = 0x0,
-     .rgbBits = 16, .indexBits = 0,
-     .accumRedBits = 0, .accumGreenBits = 0, .accumBlueBits = 0, .accumAlphaBits = 0,
-     .depthBits = 16, .stencilBits = 0,
-     .numAuxBuffers= 0, .level = 0, .pixmapMode = GL_FALSE, },
-};
-static int tdfxInitContextModes( const DRIDriverContext *ctx,
-                                  int *numModes, const __GLcontextModes **modes)
-{
-   int n = sizeof(__glModes)/sizeof(__glModes[0]);
-   const __GLcontextModes *m = &__glModes[0];
-
-   if (ctx->chipset < PCI_CHIP_VOODOO4) {
-      n /= 2;
-      m += n;
-   }
-
-   *numModes = n;
-   *modes = m;
-
-   return 1;
-}
-
-
 /**
  * \brief Validate the fbdev mode.
  * 
@@ -514,7 +461,6 @@ static int tdfxEngineRestore( const DRIDriverContext *ctx )
  * \sa DRIDriverRec.
  */
 struct DRIDriverRec __driDriver = {
-   tdfxInitContextModes,
    tdfxValidateMode,
    tdfxPostValidateMode,
    tdfxInitFBDev,