Minor r200 vertex program cleanups. Remove disabled leftovers from r300 vertex progra...
[mesa.git] / src / mesa / drivers / dri / i810 / i810context.c
index aa4eb4be6ed029bf86c4962c2c28af53c473d6a6..23373ef73b1dd8f5ab2488372bc7f593bb3a33db 100644 (file)
@@ -60,7 +60,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i810vb.h"
 #include "i810ioctl.h"
 
+#include "drirenderbuffer.h"
 #include "utils.h"
+
+#define need_GL_ARB_multisample
+#define need_GL_ARB_texture_compression
+#include "extension_helper.h"
+
 #ifndef I810_DEBUG
 int I810_DEBUG = (0);
 #endif
@@ -68,13 +74,30 @@ int I810_DEBUG = (0);
 PUBLIC const char __driConfigOptions[] = { 0 };
 const GLuint __driNConfigOptions = 0;
 
+#define DRIVER_DATE                     "20050821"
+
 static const GLubyte *i810GetString( GLcontext *ctx, GLenum name )
 {
+   static char buffer[128];
+
    switch (name) {
    case GL_VENDOR:
       return (GLubyte *)"Keith Whitwell";
-   case GL_RENDERER:
-      return (GLubyte *)"Mesa DRI I810 20021125";
+   case GL_RENDERER: {
+      i810ContextPtr imesa = I810_CONTEXT(ctx);
+      const char * chipset;
+      
+      switch (imesa->i810Screen->deviceID) {
+      case PCI_CHIP_I810:       chipset = "i810"; break;
+      case PCI_CHIP_I810_DC100: chipset = "i810 DC-100"; break;
+      case PCI_CHIP_I810_E:     chipset = "i810E"; break;
+      case PCI_CHIP_I815:       chipset = "i815"; break;
+      default:                  chipset = "Unknown i810-class Chipset"; break;
+      }
+
+      (void) driGetRendererString( buffer, chipset, DRIVER_DATE, 0 );
+      return (GLubyte *) buffer;
+   }
    default:
       return 0;
    }
@@ -97,17 +120,24 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
 
 /* Extension strings exported by the i810 driver.
  */
-static const char * const card_extensions[] =
+const struct dri_extension card_extensions[] =
 {
-   "GL_ARB_multitexture",
-   "GL_ARB_texture_env_add",
-   "GL_ARB_texture_mirrored_repeat",
-   "GL_EXT_stencil_wrap",
-   "GL_EXT_texture_edge_clamp",
-   "GL_EXT_texture_lod_bias",
-   "GL_MESA_ycbcr_texture",
-   "GL_SGIS_generate_mipmap",
-   NULL
+    { "GL_ARB_multisample",                GL_ARB_multisample_functions },
+    { "GL_ARB_multitexture",               NULL },
+    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
+    { "GL_ARB_texture_env_add",            NULL },
+    { "GL_ARB_texture_env_combine",        NULL },
+    { "GL_ARB_texture_env_crossbar",       NULL },
+    { "GL_ARB_texture_mirrored_repeat",    NULL },
+    { "GL_EXT_stencil_wrap",               NULL },
+    { "GL_EXT_texture_edge_clamp",         NULL },
+    { "GL_EXT_texture_env_combine",        NULL },
+    { "GL_EXT_texture_lod_bias",           NULL },
+    { "GL_EXT_texture_rectangle",          NULL },
+    { "GL_MESA_ycbcr_texture",             NULL },
+    { "GL_NV_blend_square",                NULL },
+    { "GL_SGIS_generate_mipmap",           NULL },
+    { NULL,                                NULL }
 };
 
 extern const struct tnl_pipeline_stage _i810_render_stage;
@@ -231,7 +261,8 @@ i810CreateContext( const __GLcontextModes *mesaVis,
                                 0,  /* cube textures unsupported. */
                                 0,  /* texture rectangles unsupported. */
                                 12,
-                                GL_FALSE );
+                                GL_FALSE,
+                                0 );
 
    ctx->Const.MinLineWidth = 1.0;
    ctx->Const.MinLineWidthAA = 1.0;
@@ -461,15 +492,13 @@ i810UpdatePageFlipping( i810ContextPtr imesa )
 
    if ( imesa->sarea->pf_current_page == 1 ) 
      front ^= 1;
+
+   driFlipRenderbuffers(ctx->WinSysDrawBuffer, front);
    
    if (front) {
       imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->fbOffset | imesa->i810Screen->backPitchBits;
-      imesa->drawMap = (char *)imesa->driScreen->pFB;
-      imesa->readMap = (char *)imesa->driScreen->pFB;
    } else {
       imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->backOffset | imesa->i810Screen->backPitchBits;
-      imesa->drawMap = imesa->i810Screen->back.map;
-      imesa->readMap = imesa->i810Screen->back.map;
    }
 
    imesa->dirty |= I810_UPLOAD_BUFFERS;
@@ -499,6 +528,7 @@ void i810GetLock( i810ContextPtr imesa, GLuint flags )
     * more broken than usual.
     */
    if (sarea->ctxOwner != me) {
+      driUpdateFramebufferSize(imesa->glCtx, dPriv);
       imesa->upload_cliprects = GL_TRUE;
       imesa->dirty = I810_UPLOAD_CTX|I810_UPLOAD_BUFFERS;
       if (imesa->CurrentTexObj[0]) imesa->dirty |= I810_UPLOAD_TEX0;