From f252d6a98e75236a4059fb8ff6579ddad2e0e8aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 8 Jul 2010 20:15:10 -0400 Subject: [PATCH] Update to use eglGetDRMDisplayMESA() --- clients/gears.c | 1 - clients/image.c | 1 - clients/terminal.c | 1 - clients/view.c | 1 - clients/window.c | 11 +---------- compositor-drm.c | 11 +---------- compositor-x11.c | 14 ++------------ 7 files changed, 4 insertions(+), 36 deletions(-) diff --git a/clients/gears.c b/clients/gears.c index 04da3de..eea7233 100644 --- a/clients/gears.c +++ b/clients/gears.c @@ -30,7 +30,6 @@ #include #include #include -#include #define GL_GLEXT_PROTOTYPES #define EGL_EGLEXT_PROTOTYPES diff --git a/clients/image.c b/clients/image.c index 52621e9..c8de5e6 100644 --- a/clients/image.c +++ b/clients/image.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/clients/terminal.c b/clients/terminal.c index e7e054b..5fe0d21 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -32,7 +32,6 @@ #include #include #include -#include #include diff --git a/clients/view.c b/clients/view.c index 4ef6b6c..e0903bf 100644 --- a/clients/view.c +++ b/clients/view.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/clients/window.c b/clients/window.c index 7049112..2a68a28 100644 --- a/clients/window.c +++ b/clients/window.c @@ -820,7 +820,6 @@ init_xkb(struct display *d) struct display * display_create(int *argc, char **argv[], const GOptionEntry *option_entries) { - PFNEGLGETTYPEDDISPLAYMESA get_typed_display_mesa; struct display *d; EGLint major, minor, count; EGLConfig config; @@ -869,15 +868,7 @@ display_create(int *argc, char **argv[], const GOptionEntry *option_entries) return NULL; } - get_typed_display_mesa = - (PFNEGLGETTYPEDDISPLAYMESA) eglGetProcAddress("eglGetTypedDisplayMESA"); - if (get_typed_display_mesa == NULL) { - fprintf(stderr, "eglGetDisplayMESA() not found\n"); - return NULL; - } - - d->dpy = get_typed_display_mesa(EGL_DRM_DISPLAY_TYPE_MESA, - (void *) fd); + d->dpy = eglGetDRMDisplayMESA(fd); if (!eglInitialize(d->dpy, &major, &minor)) { fprintf(stderr, "failed to initialize display\n"); return NULL; diff --git a/compositor-drm.c b/compositor-drm.c index 38d04bf..1fb4c21 100644 --- a/compositor-drm.c +++ b/compositor-drm.c @@ -305,7 +305,6 @@ init_egl(struct drm_compositor *ec, struct udev_device *device) { EGLint major, minor, count; EGLConfig config; - PFNEGLGETTYPEDDISPLAYMESA get_typed_display_mesa; static const EGLint config_attribs[] = { EGL_SURFACE_TYPE, 0, @@ -314,13 +313,6 @@ init_egl(struct drm_compositor *ec, struct udev_device *device) EGL_NONE }; - get_typed_display_mesa = - (PFNEGLGETTYPEDDISPLAYMESA) eglGetProcAddress("eglGetTypedDisplayMESA"); - if (get_typed_display_mesa == NULL) { - fprintf(stderr, "eglGetTypedDisplayMESA() not found\n"); - return -1; - } - ec->base.base.device = strdup(udev_device_get_devnode(device)); ec->drm_fd = open(ec->base.base.device, O_RDWR); if (ec->drm_fd < 0) { @@ -330,8 +322,7 @@ init_egl(struct drm_compositor *ec, struct udev_device *device) return -1; } - ec->base.display = get_typed_display_mesa(EGL_DRM_DISPLAY_TYPE_MESA, - (void *) ec->drm_fd); + ec->base.display = eglGetDRMDisplayMESA(ec->drm_fd); if (ec->base.display == NULL) { fprintf(stderr, "failed to create display\n"); return -1; diff --git a/compositor-x11.c b/compositor-x11.c index 2ecd2a2..46f6a76 100644 --- a/compositor-x11.c +++ b/compositor-x11.c @@ -198,7 +198,6 @@ dri2_authenticate(struct x11_compositor *c) static int x11_compositor_init_egl(struct x11_compositor *c) { - PFNEGLGETTYPEDDISPLAYMESA get_typed_display_mesa; EGLint major, minor, count; EGLConfig config; @@ -211,7 +210,7 @@ x11_compositor_init_egl(struct x11_compositor *c) if (dri2_connect(c) < 0) return -1; - + c->drm_fd = open(c->base.base.device, O_RDWR); if (c->drm_fd == -1) { fprintf(stderr, @@ -223,16 +222,7 @@ x11_compositor_init_egl(struct x11_compositor *c) if (dri2_authenticate(c) < 0) return -1; - get_typed_display_mesa = - (PFNEGLGETTYPEDDISPLAYMESA) - eglGetProcAddress("eglGetTypedDisplayMESA"); - if (get_typed_display_mesa == NULL) { - fprintf(stderr, "eglGetTypedDisplayMESA() not found\n"); - return -1; - } - - c->base.display = get_typed_display_mesa(EGL_DRM_DISPLAY_TYPE_MESA, - (void *) c->drm_fd); + c->base.display = eglGetDRMDisplayMESA(c->drm_fd); if (c->base.display == NULL) { fprintf(stderr, "failed to create display\n"); return -1; -- 2.7.4