Cast fd's to intptr_t before casting to EGLNativeDisplay

Fixes warnings on 64bit.

Also use wlsc_compositor::destroy_image in compositor-openwfd.
This commit is contained in:
Benjamin Franzke
2011-04-26 09:21:13 +02:00
committed by Kristian Høgsberg
parent 80492e220a
commit e5b3b2601c
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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]);
}
+2
View File
@@ -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];
};