include $(TOP)/configs/current
EGL_DRIVER = egl_dri2
-EGL_SOURCES = egl_dri2.c platform_x11.c platform_drm.c
+EGL_SOURCES = egl_dri2.c platform_drm.c
EGL_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/egl/main \
-I$(TOP)/src/mapi \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
- $(XCB_DRI2_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS)
-EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
+EGL_LIBS = $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2
EGL_BUILTIN = true
EGL_CFLAGS += -DHAVE_SHARED_GLAPI
endif
+ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
+EGL_SOURCES += platform_x11.c
+EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
+EGL_LIBS += $(XCB_DRI2_LIBS)
+endif
+
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_wayland.c
EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \
return EGL_FALSE;
switch (disp->Platform) {
+#ifdef HAVE_X11_PLATFORM
case _EGL_PLATFORM_X11:
if (disp->Options.TestOnly)
return EGL_TRUE;
return dri2_initialize_x11(drv, disp);
+#endif
#ifdef HAVE_LIBUDEV
case _EGL_PLATFORM_DRM:
if (dri2_dpy->fd)
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
+#ifdef HAVE_X11_PLATFORM
if (disp->PlatformDisplay == NULL)
xcb_disconnect(dri2_dpy->conn);
+#endif
free(dri2_dpy);
disp->DriverData = NULL;
#ifndef EGL_DRI2_INCLUDED
#define EGL_DRI2_INCLUDED
+#ifdef HAVE_X11_PLATFORM
#include <xcb/xcb.h>
#include <xcb/dri2.h>
#include <xcb/xfixes.h>
#include <X11/Xlib-xcb.h>
+#endif
#ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h>
struct dri2_egl_display
{
- xcb_connection_t *conn;
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[3];
+
+#ifdef HAVE_X11_PLATFORM
+ xcb_connection_t *conn;
+#endif
+
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_display *wl_dpy;
struct wl_drm *wl_server_drm;
{
_EGLSurface base;
__DRIdrawable *dri_drawable;
- xcb_drawable_t drawable;
__DRIbuffer buffers[5];
int buffer_count;
- xcb_xfixes_region_t region;
int have_fake_front;
int swap_interval;
+#ifdef HAVE_X11_PLATFORM
+ xcb_drawable_t drawable;
+ xcb_xfixes_region_t region;
int depth;
int bytes_per_pixel;
xcb_gcontext_t gc;
xcb_gcontext_t swapgc;
+#endif
enum dri2_surface_type type;
#ifdef HAVE_WAYLAND_PLATFORM
ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
+ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
+EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
+endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
-EGL_LIB_DEPS += $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
+EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
+
ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a