From 5dd83e3e1af568d75318af4ae11783a8e9f2ccea Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji Date: Fri, 25 Sep 2015 14:20:29 +0300 Subject: QtCompositor: Work around driver issue on iMX6 devices Change-Id: I75eda7e766182025b54f8df851ff1d5a72eefb17 Reviewed-by: Laszlo Agocs --- .../wayland-egl/waylandeglclientbufferintegration.cpp | 17 +++++++++++------ 1 file 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(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(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); -- cgit v1.2.3