summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2015-09-25 14:20:29 +0300
committerLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2015-09-25 12:54:23 +0000
commit5dd83e3e1af568d75318af4ae11783a8e9f2ccea (patch)
treed1a5bd483d757cef3ee493529c6a1062179b758c
parent2336c5d726892d38592bc2d0c3f1a3c5a3640a0c (diff)
QtCompositor: Work around driver issue on iMX6 devices
Change-Id: I75eda7e766182025b54f8df851ff1d5a72eefb17 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
index 85215f14b..2d5a182c7 100644
--- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
@@ -151,12 +151,6 @@ void WaylandEglClientBufferIntegration::initializeHardware(QtWayland::Display *w
return;
}
- d->gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
- if (!d->gl_egl_image_target_texture_2d) {
- qWarning("QtCompositor: Failed to initialize EGL display. Could not find glEGLImageTargetTexture2DOES.");
- return;
- }
-
if (d->egl_bind_wayland_display && d->egl_unbind_wayland_display) {
d->display_bound = d->egl_bind_wayland_display(d->egl_display, waylandDisplay->handle());
if (!d->display_bound) {
@@ -175,11 +169,22 @@ void WaylandEglClientBufferIntegration::initializeHardware(QtWayland::Display *w
void WaylandEglClientBufferIntegration::bindTextureToBuffer(struct ::wl_resource *buffer)
{
Q_D(WaylandEglClientBufferIntegration);
+
if (!d->valid) {
qWarning("QtCompositor: bindTextureToBuffer() failed");
return;
}
+ // Vivante drivers on the iMX6 don't resolve this function early enough for us, they seem to require the EGL/GLES setup to be further
+ // along than they are in initializeHardware(), so do the lookup here instead.
+ if (!d->gl_egl_image_target_texture_2d)
+ d->gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
+
+ if (!d->gl_egl_image_target_texture_2d) {
+ qWarning("QtCompositor: bindTextureToBuffer() failed. Could not find glEGLImageTargetTexture2DOES.");
+ return;
+ }
+
EGLImageKHR image = d->egl_create_image(d->egl_display, EGL_NO_CONTEXT,
EGL_WAYLAND_BUFFER_WL,
buffer, NULL);