From e5b3b2601c67408a093c8ba14d5258c465caf2eb Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 26 Apr 2011 09:21:13 +0200 Subject: [PATCH] Cast fd's to intptr_t before casting to EGLNativeDisplay Fixes warnings on 64bit. Also use wlsc_compositor::destroy_image in compositor-openwfd. --- compositor/compositor-drm.c | 2 +- compositor/compositor-openwfd.c | 4 ++-- compositor/compositor.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compositor/compositor-drm.c b/compositor/compositor-drm.c index 145a451d..c7c01809 100644 --- a/compositor/compositor-drm.c +++ b/compositor/compositor-drm.c @@ -264,7 +264,7 @@ init_egl(struct drm_compositor *ec, struct udev_device *device) } ec->drm.fd = fd; - ec->base.display = eglGetDisplay((EGLNativeDisplayType) ec->drm.fd); + ec->base.display = eglGetDisplay(FD_TO_EGL_NATIVE_DPY(ec->drm.fd)); if (ec->base.display == NULL) { fprintf(stderr, "failed to create display\n"); return -1; diff --git a/compositor/compositor-openwfd.c b/compositor/compositor-openwfd.c index 3cce582f..e8862a0d 100644 --- a/compositor/compositor-openwfd.c +++ b/compositor/compositor-openwfd.c @@ -116,7 +116,7 @@ init_egl(struct wfd_compositor *ec) return -1; ec->wfd_fd = fd; - ec->base.display = eglGetDRMDisplayMESA(ec->wfd_fd); + ec->base.display = eglGetDisplay(FD_TO_EGL_NATIVE_DPY(ec->wfd_fd)); if (ec->base.display == NULL) { fprintf(stderr, "failed to create display\n"); return -1; @@ -374,7 +374,7 @@ destroy_output(struct wfd_output *output) glDeleteRenderbuffers(2, output->rbo); for (i = 0; i < 2; i++) { - eglDestroyImageKHR(ec->base.display, output->image[i]); + ec->base.destroy_image(ec->base.display, output->image[i]); wfdDestroySource(ec->dev, output->source[i]); } diff --git a/compositor/compositor.h b/compositor/compositor.h index 6bb47b9d..bbbae988 100644 --- a/compositor/compositor.h +++ b/compositor/compositor.h @@ -31,6 +31,8 @@ #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) +#define FD_TO_EGL_NATIVE_DPY(fd) ((EGLNativeDisplayType)(intptr_t)(fd)) + struct wlsc_matrix { GLfloat d[16]; };