#endif
#include <sys/types.h>
#include <sys/stat.h>
+#include "util/debug.h"
#include "util/macros.h"
#include "egl_dri2.h"
xcb_create_gc(dri2_dpy->conn, dri2_surf->swapgc, dri2_surf->drawable, mask, valgc);
switch (dri2_surf->depth) {
case 32:
+ case 30:
case 24:
dri2_surf->bytes_per_pixel = 4;
break;
return NULL;
}
- if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
+ if (!dri2_init_surface(&dri2_surf->base, disp, type, conf, attrib_list, false))
goto cleanup_surf;
dri2_surf->region = XCB_NONE;
if (surf->Type == EGL_PBUFFER_BIT)
xcb_free_pixmap (dri2_dpy->conn, dri2_surf->drawable);
+ dri2_fini_surface(surf);
free(surf);
return EGL_TRUE;
if (dri2_dpy->driver_name == NULL) {
close(dri2_dpy->fd);
- free(dri2_dpy->driver_name);
free(connect);
return EGL_FALSE;
}
config_count++;
/* 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! */
- if (d.data->depth == 24) {
+ if (d.data->depth == 24 || d.data->depth == 30) {
rgba_masks[3] =
~(rgba_masks[0] | rgba_masks[1] | rgba_masks[2]);
dri2_conf = dri2_add_config(disp, config, config_count + 1,
case 24:
format = __DRI_IMAGE_FORMAT_XRGB8888;
break;
+ case 30:
+ format = __DRI_IMAGE_FORMAT_XRGB2101010;
+ break;
case 32:
format = __DRI_IMAGE_FORMAT_ARGB8888;
break;
.create_pbuffer_surface = dri2_x11_create_pbuffer_surface,
.destroy_surface = dri2_x11_destroy_surface,
.create_image = dri2_create_image_khr,
- .swap_interval = dri2_fallback_swap_interval,
.swap_buffers = dri2_x11_swap_buffers,
.set_damage_region = dri2_fallback_set_damage_region,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
*/
dri2_dpy->min_swap_interval = 0;
dri2_dpy->max_swap_interval = 0;
+ dri2_dpy->default_swap_interval = 0;
if (!dri2_dpy->swap_available)
return;
static const __DRIextension *dri2_loader_extensions[] = {
&dri2_loader_extension.base,
&image_lookup_extension.base,
+ &use_invalidate.base,
&background_callable_extension.base,
NULL,
};
{
EGLBoolean initialized = EGL_FALSE;
- if (!getenv("LIBGL_ALWAYS_SOFTWARE")) {
+ if (!disp->Options.ForceSoftware) {
#ifdef HAVE_DRI3
- if (!getenv("LIBGL_DRI3_DISABLE"))
+ if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
initialized = dri2_initialize_x11_dri3(drv, disp);
#endif
return initialized;
}
+void
+dri2_teardown_x11(struct dri2_egl_display *dri2_dpy)
+{
+ if (dri2_dpy->own_device)
+ xcb_disconnect(dri2_dpy->conn);
+}