mesa: Enable remap table in core.
[mesa.git] / src / mesa / drivers / dri / unichrome / via_screen.c
index 3648710533b85ccabdc6e4e99eaa5e2d15b82297..7cfc60a015d6ad1770bec12ef704630bd610b765 100644 (file)
 
 #include "dri_util.h"
 #include "utils.h"
-#include "glheader.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "matrix.h"
-#include "simple_list.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/matrix.h"
+#include "main/simple_list.h"
 #include "vblank.h"
 
 #include "via_state.h"
@@ -62,8 +62,6 @@ DRI_CONF_BEGIN
 DRI_CONF_END;
 static const GLuint __driNConfigOptions = 3;
 
-extern const struct dri_extension card_extensions[];
-
 static drmBufMapPtr via_create_empty_buffers(void)
 {
     drmBufMapPtr retval;
@@ -316,7 +314,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
 static void
 viaDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
 {
-   _mesa_unreference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)));
+   _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
 }
 
 static const __DRIconfig **
@@ -340,8 +338,9 @@ viaFillInModes( __DRIscreenPrivate *psp,
     /* The 32-bit depth-buffer mode isn't supported yet, so don't actually
      * enable it.
      */
-    static const u_int8_t depth_bits_array[4]   = { 0, 16, 24, 32 };
-    static const u_int8_t stencil_bits_array[4] = { 0,  0,  8,  0 };
+    static const uint8_t depth_bits_array[4]   = { 0, 16, 24, 32 };
+    static const uint8_t stencil_bits_array[4] = { 0,  0,  8,  0 };
+    uint8_t msaa_samples_array[1] = { 0 };
     const unsigned depth_buffer_factor = 3;
 
     if ( pixel_bits == 16 ) {
@@ -356,7 +355,8 @@ viaFillInModes( __DRIscreenPrivate *psp,
     configs = driCreateConfigs(fb_format, fb_type,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
-                              back_buffer_factor);
+                              back_buffer_factor,
+                               msaa_samples_array, 1);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                __LINE__);
@@ -391,18 +391,6 @@ viaInitScreen(__DRIscreenPrivate *psp)
                                      &psp->drm_version, & drm_expected) )
       return NULL;
 
-   /* Calling driInitExtensions here, with a NULL context pointer,
-    * does not actually enable the extensions.  It just makes sure
-    * that all the dispatch offsets for all the extensions that
-    * *might* be enables are known.  This is needed because the
-    * dispatch offsets need to be known when _mesa_context_create is
-    * called, but we can't enable the extensions until we have a
-    * context pointer.
-    *
-    * Hello chicken.  Hello egg.  How are you two today?
-    */
-   driInitExtensions( NULL, card_extensions, GL_FALSE );
-
    if (!viaInitDriver(psp))
        return NULL;