Merge branch 'mesa_7_7_branch'
[mesa.git] / src / mesa / drivers / dri / sis / sis_screen.c
index b1a5d15236fd2a3582eb5d6e5ab3e4ffe07bf686..cb7ed8a08bbcff2e041e2d2697868566c0bf496f 100644 (file)
@@ -39,7 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "sis_context.h"
 #include "sis_dri.h"
 #include "sis_lock.h"
-#include "sis_span.h"
 
 #include "xmlpool.h"
 
@@ -65,7 +64,7 @@ static const GLuint __driNConfigOptions = 3;
 extern const struct dri_extension card_extensions[];
 
 static const __DRIconfig **
-sisFillInModes(__DRIscreenPrivate *psp, int bpp)
+sisFillInModes(__DRIscreen *psp, int bpp)
 {
    __DRIconfig **configs;
    unsigned depth_buffer_factor;
@@ -77,6 +76,7 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
    };
    uint8_t depth_bits_array[4];
    uint8_t stencil_bits_array[4];
+   uint8_t msaa_samples_array[1];
 
    depth_bits_array[0] = 0;
    stencil_bits_array[0] = 0;
@@ -87,6 +87,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
    depth_bits_array[3] = 32;
    stencil_bits_array[3] = 0;
 
+   msaa_samples_array[0] = 0;
+
    depth_buffer_factor = 4;
    back_buffer_factor = 2;
 
@@ -100,7 +102,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
 
    configs = driCreateConfigs(fb_format, fb_type, depth_bits_array,
                              stencil_bits_array, depth_buffer_factor,
-                             back_buffer_modes, back_buffer_factor);
+                             back_buffer_modes, back_buffer_factor,
+                              msaa_samples_array, 1);
    if (configs == NULL) {
       fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
       return NULL;
@@ -113,7 +116,7 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
 /* Create the device specific screen private data struct.
  */
 static sisScreenPtr
-sisCreateScreen( __DRIscreenPrivate *sPriv )
+sisCreateScreen( __DRIscreen *sPriv )
 {
    sisScreenPtr sisScreen;
    SISDRIPtr sisDRIPriv = (SISDRIPtr)sPriv->pDevPriv;
@@ -168,7 +171,7 @@ sisCreateScreen( __DRIscreenPrivate *sPriv )
 /* Destroy the device specific screen private data struct.
  */
 static void
-sisDestroyScreen( __DRIscreenPrivate *sPriv )
+sisDestroyScreen( __DRIscreen *sPriv )
 {
    sisScreenPtr sisScreen = (sisScreenPtr)sPriv->private;
 
@@ -188,8 +191,8 @@ sisDestroyScreen( __DRIscreenPrivate *sPriv )
  * data.
  */
 static GLboolean
-sisCreateBuffer( __DRIscreenPrivate *driScrnPriv,
-                 __DRIdrawablePrivate *driDrawPriv,
+sisCreateBuffer( __DRIscreen *driScrnPriv,
+                 __DRIdrawable *driDrawPriv,
                  const __GLcontextModes *mesaVis,
                  GLboolean isPixmap )
 {
@@ -215,12 +218,12 @@ sisCreateBuffer( __DRIscreenPrivate *driScrnPriv,
 
 
 static void
-sisDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
+sisDestroyBuffer(__DRIdrawable *driDrawPriv)
 {
-   _mesa_unreference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)));
+   _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
 }
 
-static void sisCopyBuffer( __DRIdrawablePrivate *dPriv )
+static void sisCopyBuffer( __DRIdrawable *dPriv )
 {
    sisContextPtr smesa = (sisContextPtr)dPriv->driContextPriv->driverPrivate;
    int i;
@@ -255,7 +258,7 @@ static void sisCopyBuffer( __DRIdrawablePrivate *dPriv )
 
 /* Copy the back color buffer to the front color buffer */
 static void
-sisSwapBuffers(__DRIdrawablePrivate *dPriv)
+sisSwapBuffers(__DRIdrawable *dPriv)
 {
    if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
          sisContextPtr smesa = (sisContextPtr) dPriv->driContextPriv->driverPrivate;
@@ -280,7 +283,7 @@ sisSwapBuffers(__DRIdrawablePrivate *dPriv)
  * \return the __GLcontextModes supported by this driver
  */
 static const __DRIconfig **
-sisInitScreen(__DRIscreenPrivate *psp)
+sisInitScreen(__DRIscreen *psp)
 {
    static const __DRIversion ddx_expected = {0, 8, 0};
    static const __DRIversion dri_expected = {4, 0, 0};
@@ -294,18 +297,6 @@ sisInitScreen(__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 );
-
    psp->private = sisCreateScreen(psp);
 
    if (!psp->private) {
@@ -333,3 +324,10 @@ const struct __DriverAPIRec driDriverAPI = {
    .SwapBuffersMSC  = NULL
 
 };
+
+/* This is the table of extensions that the loader will dlsym() for. */
+PUBLIC const __DRIextension *__driDriverExtensions[] = {
+    &driCoreExtension.base,
+    &driLegacyExtension.base,
+    NULL
+};