+ * Function utilizes swrastGetDrawableInfo to get surface
+ * geometry from x server and calls default query surface
+ * implementation that returns the updated values.
+ *
+ * In case of errors we still return values that we currently
+ * have.
+ */
+static EGLBoolean
+dri2_query_surface(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLSurface *surf, EGLint attribute,
+ EGLint *value)
+{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
+ int x, y, w = -1, h = -1;
+
+ __DRIdrawable *drawable = dri2_dpy->vtbl->get_dri_drawable(surf);
+
+ switch (attribute) {
+ case EGL_WIDTH:
+ case EGL_HEIGHT:
+ swrastGetDrawableInfo(drawable, &x, &y, &w, &h, dri2_surf);
+ if (w != -1 && h != -1) {
+ surf->Width = w;
+ surf->Height = h;
+ }
+ break;
+ default:
+ break;
+ }
+ return _eglQuerySurface(drv, dpy, surf, attribute, value);
+}
+
+/**