egl: Add funtions to link contexts and surfaces to displays.
[mesa.git] / src / egl / main / eglconfigutil.c
index b6585619a53f7933ab0bdbfd19f5a4f51f1e9d11..138dc729e748b27e63806b61b0244df5c977ffb6 100644 (file)
@@ -118,13 +118,12 @@ _eglConfigToContextModesRec(const _EGLConfig *config, __GLcontextModes *mode)
 EGLBoolean
 _eglFillInConfigs(_EGLConfig * configs,
                   GLenum fb_format, GLenum fb_type,
-                  const u_int8_t * depth_bits, const u_int8_t * stencil_bits,
+                  const uint8_t * depth_bits, const uint8_t * stencil_bits,
                   unsigned num_depth_stencil_bits,
                   const GLenum * db_modes, unsigned num_db_modes,
                   int visType)
 {
-#if 0
-   static const u_int8_t bits_table[3][4] = {
+   static const uint8_t bits_table[3][4] = {
             /* R  G  B  A */
             { 5, 6, 5, 0 },  /* Any GL_UNSIGNED_SHORT_5_6_5 */
             { 8, 8, 8, 0 },  /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */
@@ -135,7 +134,7 @@ _eglFillInConfigs(_EGLConfig * configs,
     * Given the four supported fb_type values, this results in valid array
     * indices of 3, 4, 5, and 7.
     */
-   static const u_int32_t masks_table_rgb[8][4] = {
+   static const uint32_t masks_table_rgb[8][4] = {
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
@@ -146,7 +145,7 @@ _eglFillInConfigs(_EGLConfig * configs,
             {0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000}  /* 8_8_8_8_REV */
          };
 
-   static const u_int32_t masks_table_rgba[8][4] = {
+   static const uint32_t masks_table_rgba[8][4] = {
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
@@ -157,7 +156,7 @@ _eglFillInConfigs(_EGLConfig * configs,
             {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000},  /* 8_8_8_8_REV */
          };
 
-   static const u_int32_t masks_table_bgr[8][4] = {
+   static const uint32_t masks_table_bgr[8][4] = {
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
@@ -168,7 +167,7 @@ _eglFillInConfigs(_EGLConfig * configs,
             {0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000},  /* 8_8_8_8_REV */
          };
 
-   static const u_int32_t masks_table_bgra[8][4] = {
+   static const uint32_t masks_table_bgra[8][4] = {
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
             {0x00000000, 0x00000000, 0x00000000, 0x00000000},
@@ -179,12 +178,12 @@ _eglFillInConfigs(_EGLConfig * configs,
             {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000},  /* 8_8_8_8_REV */
          };
 
-   static const u_int8_t bytes_per_pixel[8] = {
+   static const uint8_t bytes_per_pixel[8] = {
             0, 0, 0, 2, 2, 4, 0, 4
          };
 
-   const u_int8_t * bits;
-   const u_int32_t * masks;
+   const uint8_t * bits;
+   const uint32_t * masks;
    const int index = fb_type & 0x07;
    _EGLConfig *config;
    unsigned i;
@@ -193,8 +192,8 @@ _eglFillInConfigs(_EGLConfig * configs,
 
    if ( bytes_per_pixel[index] == 0 ) {
       _eglLog(_EGL_INFO,
-              "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.",
-              __FUNCTION__, __LINE__, fb_type);
+              "[_eglFillInConfigs:%u] Framebuffer type 0x%04x has 0 bytes per pixel.",
+              __LINE__, fb_type);
       return GL_FALSE;
    }
 
@@ -214,6 +213,7 @@ _eglFillInConfigs(_EGLConfig * configs,
       masks = masks_table_rgba[index];
       break;
 
+#if 0
    case GL_BGR:
       bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[1];
       masks = masks_table_bgr[index];
@@ -223,11 +223,12 @@ _eglFillInConfigs(_EGLConfig * configs,
       bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[2];
       masks = masks_table_bgra[index];
       break;
+#endif
 
    default:
       _eglLog(_EGL_WARNING,
-              "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.",
-              __FUNCTION__, __LINE__, fb_format);
+              "[_eglFillInConfigs:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.",
+              __LINE__, fb_format);
       return GL_FALSE;
    }
 
@@ -253,8 +254,5 @@ _eglFillInConfigs(_EGLConfig * configs,
       }
    }
    return GL_TRUE;
-#else
-   return GL_FALSE;
-#endif
 }