egl: inline fallback for get_sync_values
[mesa.git] / src / egl / drivers / dri2 / platform_x11.c
index 45c06ae04b3b16a7826e637b980ff058764ddc9b..0ccc2b34bff12bc48809dc1783129290b36cfe76 100644 (file)
@@ -339,7 +339,7 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
       }
    } else {
       if (type == EGL_PBUFFER_BIT) {
-         dri2_surf->depth = _eglGetConfigKey(conf, EGL_BUFFER_SIZE);
+         dri2_surf->depth = conf->BufferSize;
       }
       swrastCreateDrawable(dri2_dpy, dri2_surf);
    }
@@ -816,40 +816,33 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
                if (dri2_conf->base.ConfigID == config_count + 1)
                   config_count++;
 
-            /* Allows RGB visuals to match a 32-bit RGBA EGLConfig.
+            /* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig.
+             * Ditto for 30-bit RGB visuals to match a 32-bit RGBA EGLConfig.
              * Otherwise it will only match a 32-bit RGBA visual.  On a
              * composited window manager on X11, this will make all of the
              * EGLConfigs with destination alpha get blended by the
              * compositor.  This is probably not what the application
              * wants... especially on drivers that only have 32-bit RGBA
              * EGLConfigs! */
-            unsigned int rgba_mask = ~(visuals[i].red_mask |
-                                       visuals[i].green_mask |
-                                       visuals[i].blue_mask);
-            rgba_shifts[3] = ffs(rgba_mask) - 1;
-            rgba_sizes[3] = util_bitcount(rgba_mask);
-            dri2_conf = dri2_add_config(disp, config, config_count + 1,
-                                        surface_type, config_attrs,
-                                        rgba_shifts, rgba_sizes);
-            if (dri2_conf) {
-               if (dri2_conf->base.ConfigID == config_count + 1)
-                  config_count++;
-
-               /* Put RGBA visuals in the second ConfigSelectGroup so that they
-                * have lower priority. Applications probably don't want the
-                * compositor to alpha-blend their windows.
-                */
-               if (d.data->depth != 24 && d.data->depth != 30)
-                  ++dri2_conf->base.ConfigSelectGroup;
+            if (d.data->depth == 24 || d.data->depth == 30) {
+               unsigned int rgba_mask = ~(visuals[i].red_mask |
+                                          visuals[i].green_mask |
+                                          visuals[i].blue_mask);
+               rgba_shifts[3] = ffs(rgba_mask) - 1;
+               rgba_sizes[3] = util_bitcount(rgba_mask);
+               dri2_conf = dri2_add_config(disp, config, config_count + 1,
+                                           surface_type, config_attrs,
+                                           rgba_shifts, rgba_sizes);
+               if (dri2_conf)
+                  if (dri2_conf->base.ConfigID == config_count + 1)
+                     config_count++;
             }
-         }
+        }
       }
 
       xcb_depth_next(&d);
    }
 
-   dri2_finalize_config_surface_types(disp);
-
    if (!config_count) {
       _eglLog(_EGL_WARNING, "DRI2: failed to create any config");
       return EGL_FALSE;
@@ -1188,14 +1181,8 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
    .destroy_surface = dri2_x11_destroy_surface,
    .create_image = dri2_create_image_khr,
    .swap_buffers = dri2_x11_swap_buffers,
-   .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    /* XXX: should really implement this since X11 has pixmaps */
-   .copy_buffers = dri2_fallback_copy_buffers,
-   .query_buffer_age = dri2_fallback_query_buffer_age,
    .query_surface = dri2_query_surface,
-   .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
-   .get_sync_values = dri2_fallback_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };
 
@@ -1208,13 +1195,10 @@ static const struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
    .create_image = dri2_x11_create_image_khr,
    .swap_interval = dri2_x11_swap_interval,
    .swap_buffers = dri2_x11_swap_buffers,
-   .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_x11_swap_buffers_region,
    .post_sub_buffer = dri2_x11_post_sub_buffer,
    .copy_buffers = dri2_x11_copy_buffers,
-   .query_buffer_age = dri2_fallback_query_buffer_age,
    .query_surface = dri2_query_surface,
-   .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
    .get_sync_values = dri2_x11_get_sync_values,
    .get_dri_drawable = dri2_surface_get_dri_drawable,
 };