dri/nouveau: Kill a bunch of ternary operators.
[mesa.git] / src / mesa / drivers / dri / sis / sis_context.c
index 6c40f6db1864cdeb3f213afe09a2c0e07cbca62f..c5a9fdfb2a039b701a0cdb66d9673fe43028d15e 100644 (file)
@@ -43,8 +43,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "sis_alloc.h"
 
 #include "main/imports.h"
-#include "main/matrix.h"
-#include "main/extensions.h"
 #include "utils.h"
 #include "main/framebuffer.h"
 
@@ -55,12 +53,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "vbo/vbo.h"
 
 #include "tnl/tnl.h"
-#include "tnl/t_pipeline.h"
 
-#define need_GL_ARB_vertex_buffer_object
 #define need_GL_EXT_fog_coord
 #define need_GL_EXT_secondary_color
-#include "extension_helper.h"
+#include "main/remap_helper.h"
 
 #ifndef SIS_DEBUG
 int SIS_DEBUG = 0;
@@ -70,12 +66,11 @@ int GlobalCurrentHwcx = -1;
 int GlobalHwcxCountBase = 1;
 int GlobalCmdQueueLen = 0;
 
-struct dri_extension card_extensions[] =
+static struct dri_extension card_extensions[] =
 {
     { "GL_ARB_multitexture",               NULL },
     { "GL_ARB_texture_border_clamp",       NULL },
     { "GL_ARB_texture_mirrored_repeat",    NULL },
-    { "GL_ARB_vertex_buffer_object",       GL_ARB_vertex_buffer_object_functions },
     /*{ "GL_EXT_fog_coord",                  GL_EXT_fog_coord_functions },*/
     { "GL_EXT_texture_lod_bias",           NULL },
     { "GL_EXT_secondary_color",            GL_EXT_secondary_color_functions },
@@ -85,13 +80,15 @@ struct dri_extension card_extensions[] =
     { NULL,                                NULL }
 };
 
-struct dri_extension card_extensions_6326[] =
+#if 0
+static struct dri_extension card_extensions_6326[] =
 {
     /*{ "GL_ARB_texture_border_clamp",       NULL },*/
     /*{ "GL_ARB_texture_mirrored_repeat",    NULL },*/
     /*{ "GL_MESA_ycbcr_texture",             NULL },*/
     { NULL,                                NULL }
 };
+#endif
 
 static const struct dri_debug_control debug_control[] =
 {
@@ -150,7 +147,7 @@ WaitingFor3dIdle(sisContextPtr smesa, int wLen)
    }
 }
 
-void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
+void sisReAllocateBuffers(struct gl_context *ctx, struct gl_framebuffer *drawbuffer,
                           GLuint width, GLuint height)
 {
    sisContextPtr smesa = SIS_CONTEXT(ctx);
@@ -161,12 +158,13 @@ void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
 }
 
 GLboolean
-sisCreateContext( const __GLcontextModes *glVisual,
-                 __DRIcontextPrivate *driContextPriv,
+sisCreateContext( gl_api api,
+                 const struct gl_config *glVisual,
+                 __DRIcontext *driContextPriv,
                   void *sharedContextPrivate )
 {
-   GLcontext *ctx, *shareCtx;
-   __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+   struct gl_context *ctx, *shareCtx;
+   __DRIscreen *sPriv = driContextPriv->driScreenPriv;
    sisContextPtr smesa;
    sisScreenPtr sisScreen;
    int i;
@@ -339,7 +337,7 @@ sisCreateContext( const __GLcontextModes *glVisual,
 }
 
 void
-sisDestroyContext ( __DRIcontextPrivate *driContextPriv )
+sisDestroyContext ( __DRIcontext *driContextPriv )
 {
    sisContextPtr smesa = (sisContextPtr)driContextPriv->driverPrivate;
 
@@ -367,9 +365,9 @@ sisDestroyContext ( __DRIcontextPrivate *driContextPriv )
 }
 
 GLboolean
-sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
-                __DRIdrawablePrivate *driDrawPriv,
-                __DRIdrawablePrivate *driReadPriv )
+sisMakeCurrent( __DRIcontext *driContextPriv,
+                __DRIdrawable *driDrawPriv,
+                __DRIdrawable *driReadPriv )
 {
    if ( driContextPriv ) {
       GET_CURRENT_CONTEXT(ctx);
@@ -383,8 +381,8 @@ sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
 
       newSisCtx->driDrawable = driDrawPriv;
 
-      drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
-      readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
+      drawBuffer = (struct gl_framebuffer *)driDrawPriv->driverPrivate;
+      readBuffer = (struct gl_framebuffer *)driReadPriv->driverPrivate;
 
       _mesa_make_current( newSisCtx->glCtx, drawBuffer, readBuffer );
 
@@ -398,7 +396,7 @@ sisMakeCurrent( __DRIcontextPrivate *driContextPriv,
 }
 
 GLboolean
-sisUnbindContext( __DRIcontextPrivate *driContextPriv )
+sisUnbindContext( __DRIcontext *driContextPriv )
 {
    return GL_TRUE;
 }