From: Benjamin Franzke Date: Sun, 20 Feb 2011 18:58:42 +0000 (+0100) Subject: compositor-x11: Use x11 egl platform X-Git-Tag: 0.85.0~579 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b288afd1ac0109a49d1d4fff5c5aaa534caf350;p=platform%2Fupstream%2Fweston.git compositor-x11: Use x11 egl platform --- diff --git a/compositor/compositor-x11.c b/compositor/compositor-x11.c index 4365c0a..ae68a1c 100644 --- a/compositor/compositor-x11.c +++ b/compositor/compositor-x11.c @@ -34,6 +34,9 @@ #include #include +#include +#include + #define GL_GLEXT_PROTOTYPES #define EGL_EGLEXT_PROTOTYPES #include @@ -48,6 +51,7 @@ struct x11_compositor { struct wlsc_compositor base; + Display *dpy; xcb_connection_t *conn; xcb_screen_t *screen; xcb_cursor_t null_cursor; @@ -220,7 +224,6 @@ x11_compositor_init_egl(struct x11_compositor *c) { EGLint major, minor; const char *extensions; - drm_magic_t magic; static const EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE @@ -229,15 +232,7 @@ x11_compositor_init_egl(struct x11_compositor *c) if (dri2_connect(c) < 0) return -1; - if (drmGetMagic(c->base.drm.fd, &magic)) { - fprintf(stderr, "DRI2: failed to get drm magic\n"); - return -1; - } - - if (dri2_authenticate(c, magic) < 0) - return -1; - - c->base.display = eglGetDRMDisplayMESA(c->base.drm.fd); + c->base.display = eglGetDisplay(c->dpy); if (c->base.display == NULL) { fprintf(stderr, "failed to create display\n"); return -1; @@ -754,7 +749,9 @@ x11_compositor_create(struct wl_display *display, int width, int height) return NULL; memset(c, 0, sizeof *c); - c->conn = xcb_connect(0, 0); + + c->dpy = XOpenDisplay(NULL); + c->conn = XGetXCBConnection(c->dpy); if (xcb_connection_has_error(c->conn)) return NULL; diff --git a/configure.ac b/configure.ac index 8b159dc..c833312 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_PROG_RANLIB PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES(COMPOSITOR, - [wayland-server wayland-client egl >= 7.10 glesv2 gdk-pixbuf-2.0 libudev >= 136 libdrm >= 2.4.23] pixman-1 xcb-dri2 xcb-xfixes) + [wayland-server wayland-client egl >= 7.10 glesv2 gdk-pixbuf-2.0 libudev >= 136 libdrm >= 2.4.23] pixman-1 x11 x11-xcb xcb xcb-dri2 xcb-xfixes) PKG_CHECK_MODULES(SIMPLE_CLIENT, [egl >= 7.10 glesv2 wayland-client wayland-egl]) PKG_CHECK_MODULES(CLIENT, [wayland-client wayland-egl egl >= 7.10 gl cairo >= 1.10.0 gdk-pixbuf-2.0 glib-2.0 gobject-2.0 xkbcommon]) PKG_CHECK_MODULES(POPPLER, [poppler-glib gdk-2.0 gio-2.0],