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:
committed by
Kristian Høgsberg
parent
80492e220a
commit
e5b3b2601c
@@ -264,7 +264,7 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ec->drm.fd = fd;
|
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) {
|
if (ec->base.display == NULL) {
|
||||||
fprintf(stderr, "failed to create display\n");
|
fprintf(stderr, "failed to create display\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ init_egl(struct wfd_compositor *ec)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ec->wfd_fd = fd;
|
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) {
|
if (ec->base.display == NULL) {
|
||||||
fprintf(stderr, "failed to create display\n");
|
fprintf(stderr, "failed to create display\n");
|
||||||
return -1;
|
return -1;
|
||||||
@@ -374,7 +374,7 @@ destroy_output(struct wfd_output *output)
|
|||||||
glDeleteRenderbuffers(2, output->rbo);
|
glDeleteRenderbuffers(2, output->rbo);
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
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]);
|
wfdDestroySource(ec->dev, output->source[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||||
|
|
||||||
|
#define FD_TO_EGL_NATIVE_DPY(fd) ((EGLNativeDisplayType)(intptr_t)(fd))
|
||||||
|
|
||||||
struct wlsc_matrix {
|
struct wlsc_matrix {
|
||||||
GLfloat d[16];
|
GLfloat d[16];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user