From 3e79280ad234ad01c126f84ecfa1596fa12628a0 Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Tue, 3 Mar 2020 15:10:30 +0200 Subject: Add changes file for Qt 5.14.2 + 67d56a5cba4fdac8205a84bc4e3ca74d5efbb64c Avoid conflicting declaration for egl typedefs + e4e03650dbbc1f98ba90d15364d9c951a7e7506b Bump version Change-Id: I89f3c1477b1d2cea950d2e879d6966d7f337f0bb Reviewed-by: Paul Olav Tvete --- dist/changes-5.14.2 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dist/changes-5.14.2 diff --git a/dist/changes-5.14.2 b/dist/changes-5.14.2 new file mode 100644 index 00000000..68a00517 --- /dev/null +++ b/dist/changes-5.14.2 @@ -0,0 +1,20 @@ +Qt 5.14.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.14.0 through 5.14.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.14 series is binary compatible with the 5.13.x series. +Applications compiled for 5.13 will continue to run with 5.14. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. -- cgit v1.2.1 From af3976e5e788392ab2b0299c11036c18493d8d40 Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Tue, 24 Mar 2020 06:17:57 +0000 Subject: Revert "Compositor: Warn and clean up when client hardware buffer integrations fail" This reverts commit 137966a6293b50f6b248d130a2e36e67df49335e. Reason for revert: QTBUG-82948 Conflicts: src/compositor/compositor_api/qwaylandcompositor.cpp src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp Change-Id: I77e3265c336fbcdf47eb1aa5dc07f31ec41006b5 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../compositor_api/qwaylandcompositor.cpp | 29 +++-------- .../qwlclientbufferintegration_p.h | 2 +- .../compositor/brcm-egl/brcmeglintegration.cpp | 56 +++++++++++----------- .../compositor/brcm-egl/brcmeglintegration.h | 2 +- .../linuxdmabufclientbufferintegration.cpp | 17 ++++--- .../linuxdmabufclientbufferintegration.h | 2 +- .../waylandeglclientbufferintegration.cpp | 18 ++++--- .../waylandeglclientbufferintegration.h | 2 +- .../waylandeglstreamintegration.cpp | 20 +++----- .../waylandeglstreamintegration.h | 2 +- .../xcomposite-egl/xcompositeeglintegration.cpp | 18 +++---- .../xcomposite-egl/xcompositeeglintegration.h | 2 +- .../xcomposite-glx/xcompositeglxintegration.cpp | 15 ++---- .../xcomposite-glx/xcompositeglxintegration.h | 2 +- 14 files changed, 74 insertions(+), 113 deletions(-) diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index e021b742..256aa42d 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -368,6 +368,9 @@ void QWaylandCompositorPrivate::initializeHardwareIntegration() loadClientBufferIntegration(); loadServerBufferIntegration(); + + if (client_buffer_integration) + client_buffer_integration->initializeHardware(display); #endif } @@ -397,32 +400,12 @@ void QWaylandCompositorPrivate::loadClientBufferIntegration() if (!targetKey.isEmpty()) { client_buffer_integration.reset(QtWayland::ClientBufferIntegrationFactory::create(targetKey, QStringList())); if (client_buffer_integration) { - qCDebug(qLcWaylandCompositorHardwareIntegration) << "Loaded client buffer integration:" << targetKey; client_buffer_integration->setCompositor(q); - if (!client_buffer_integration->initializeHardware(display)) { - qCWarning(qLcWaylandCompositorHardwareIntegration) - << "Failed to initialize hardware for client buffer integration:" << targetKey; - client_buffer_integration.reset(); - } - } else { - qCWarning(qLcWaylandCompositorHardwareIntegration) - << "Failed to load client buffer integration:" << targetKey; + if (hw_integration) + hw_integration->setClientBufferIntegration(targetKey); } } - - if (!client_buffer_integration) { - qCWarning(qLcWaylandCompositorHardwareIntegration) - << "No client buffer integration was loaded, this means that clients will fall back" - << "to use CPU buffers (wl_shm) for transmitting buffers instead of using zero-copy" - << "GPU buffer handles. Expect serious performance impact with OpenGL clients due" - << "to potentially multiple copies between CPU and GPU memory per buffer.\n" - << "See the QtWayland readme for more info about how to build and configure Qt for" - << "your device."; - return; - } - - if (client_buffer_integration && hw_integration) - hw_integration->setClientBufferIntegration(targetKey); + //BUG: if there is no client buffer integration, bad things will happen when opengl is used #endif } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h index 2e962273..0195f3d4 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h @@ -64,7 +64,7 @@ public: void setCompositor(QWaylandCompositor *compositor) { m_compositor = compositor; } QWaylandCompositor *compositor() const { return m_compositor; } - virtual bool initializeHardware(struct ::wl_display *display) = 0; + virtual void initializeHardware(struct ::wl_display *display) = 0; virtual ClientBuffer *createBufferFor(struct ::wl_resource *buffer) = 0; diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp index 8ddb4f95..de39ff1d 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp +++ b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp @@ -67,48 +67,46 @@ BrcmEglIntegration::BrcmEglIntegration() { } -bool BrcmEglIntegration::initializeHardware(struct ::wl_display *display) +void BrcmEglIntegration::initializeHardware(struct ::wl_display *display) { Q_D(BrcmEglIntegration); QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); - if (!nativeInterface) - return false; + if (nativeInterface) { + d->egl_display = nativeInterface->nativeResourceForIntegration("EglDisplay"); + if (!d->egl_display) + qWarning("Failed to acquire EGL display from platform integration"); - d->egl_display = nativeInterface->nativeResourceForIntegration("EglDisplay"); - if (!d->egl_display) - qWarning("Failed to acquire EGL display from platform integration"); + d->eglQueryGlobalImageBRCM = (PFNEGLQUERYGLOBALIMAGEBRCMPROC) eglGetProcAddress("eglQueryGlobalImageBRCM"); - d->eglQueryGlobalImageBRCM = (PFNEGLQUERYGLOBALIMAGEBRCMPROC) eglGetProcAddress("eglQueryGlobalImageBRCM"); + if (!d->eglQueryGlobalImageBRCM) { + qWarning("Failed to resolve eglQueryGlobalImageBRCM"); + return; + } - if (!d->eglQueryGlobalImageBRCM) { - qWarning("Failed to resolve eglQueryGlobalImageBRCM"); - return false; - } - - d->glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress("glEGLImageTargetTexture2DOES"); + d->glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress("glEGLImageTargetTexture2DOES"); - if (!d->glEGLImageTargetTexture2DOES) { - qWarning("Failed to resolve glEGLImageTargetTexture2DOES"); - return false; - } + if (!d->glEGLImageTargetTexture2DOES) { + qWarning("Failed to resolve glEGLImageTargetTexture2DOES"); + return; + } - d->eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR"); + d->eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR"); - if (!d->eglCreateImageKHR) { - qWarning("Failed to resolve eglCreateImageKHR"); - return false; - } + if (!d->eglCreateImageKHR) { + qWarning("Failed to resolve eglCreateImageKHR"); + return; + } - d->eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR"); + d->eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR"); - if (!d->eglDestroyImageKHR) { - qWarning("Failed to resolve eglDestroyImageKHR"); - return false; + if (!d->eglDestroyImageKHR) { + qWarning("Failed to resolve eglDestroyImageKHR"); + return; + } + d->valid = true; + init(display, 1); } - d->valid = true; - init(display, 1); - return true; } QtWayland::ClientBuffer *BrcmEglIntegration::createBufferFor(wl_resource *buffer) diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h index 4bc98e8c..3728da7b 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h +++ b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h @@ -47,7 +47,7 @@ class BrcmEglIntegration : public QtWayland::ClientBufferIntegration, public QtW public: BrcmEglIntegration(); - bool initializeHardware(struct ::wl_display *display) override; + void initializeHardware(struct ::wl_display *display) override; QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override; protected: diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp index 4f01f855..101e2989 100644 --- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp @@ -275,7 +275,7 @@ LinuxDmabufClientBufferIntegration::~LinuxDmabufClientBufferIntegration() m_importedBuffers.clear(); } -bool LinuxDmabufClientBufferIntegration::initializeHardware(struct ::wl_display *display) +void LinuxDmabufClientBufferIntegration::initializeHardware(struct ::wl_display *display) { m_linuxDmabuf.reset(new LinuxDmabuf(display, this)); @@ -286,40 +286,40 @@ bool LinuxDmabufClientBufferIntegration::initializeHardware(struct ::wl_display egl_query_dmabuf_formats_ext = reinterpret_cast(eglGetProcAddress("eglQueryDmaBufFormatsEXT")); if (!egl_query_dmabuf_modifiers_ext || !egl_query_dmabuf_formats_ext) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not find eglQueryDmaBufModifiersEXT and eglQueryDmaBufFormatsEXT."; - return false; + return; } egl_bind_wayland_display = reinterpret_cast(eglGetProcAddress("eglBindWaylandDisplayWL")); egl_unbind_wayland_display = reinterpret_cast(eglGetProcAddress("eglUnbindWaylandDisplayWL")); if ((!egl_bind_wayland_display || !egl_unbind_wayland_display) && !ignoreBindDisplay) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL."; - return false; + return; } egl_create_image = reinterpret_cast(eglGetProcAddress("eglCreateImageKHR")); egl_destroy_image = reinterpret_cast(eglGetProcAddress("eglDestroyImageKHR")); if (!egl_create_image || !egl_destroy_image) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not find eglCreateImageKHR and eglDestroyImageKHR."; - return false; + return; } // initialize EGL display QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); if (!nativeInterface) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. No native platform interface available."; - return false; + return; } m_eglDisplay = nativeInterface->nativeResourceForIntegration("EglDisplay"); if (!m_eglDisplay) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not get EglDisplay for window."; - return false; + return; } const char *extensionString = eglQueryString(m_eglDisplay, EGL_EXTENSIONS); if (!extensionString || !strstr(extensionString, "EGL_EXT_image_dma_buf_import")) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. There is no EGL_EXT_image_dma_buf_import extension."; - return false; + return; } if (strstr(extensionString, "EGL_EXT_image_dma_buf_import_modifiers")) m_supportsDmabufModifiers = true; @@ -331,7 +331,7 @@ bool LinuxDmabufClientBufferIntegration::initializeHardware(struct ::wl_display qCWarning(qLcWaylandCompositorHardwareIntegration) << "Could not bind Wayland display. Ignoring."; } else { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not bind Wayland display."; - return false; + return; } } } @@ -342,7 +342,6 @@ bool LinuxDmabufClientBufferIntegration::initializeHardware(struct ::wl_display modifiers[format] = supportedDrmModifiers(format); } m_linuxDmabuf->setSupportedModifiers(modifiers); - return true; } QVector LinuxDmabufClientBufferIntegration::supportedDrmFormats() diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h index 8909fa89..cbbd4d9b 100644 --- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h +++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.h @@ -67,7 +67,7 @@ public: LinuxDmabufClientBufferIntegration(); ~LinuxDmabufClientBufferIntegration() override; - bool initializeHardware(struct ::wl_display *display) override; + void initializeHardware(struct ::wl_display *display) override; QtWayland::ClientBuffer *createBufferFor(wl_resource *resource) override; bool importBuffer(wl_resource *resource, LinuxDmabufWlBuffer *linuxDmabufBuffer); void removeBuffer(wl_resource *resource); diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index dd23f6f9..a5ca4755 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -398,7 +398,7 @@ WaylandEglClientBufferIntegration::~WaylandEglClientBufferIntegration() } } -bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *display) +void WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *display) { Q_D(WaylandEglClientBufferIntegration); @@ -408,21 +408,21 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di if (!nativeInterface) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. No native platform interface available."; - return false; + return; } d->egl_display = nativeInterface->nativeResourceForIntegration("EglDisplay"); if (!d->egl_display) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not get EglDisplay for window."; - return false; + return; } const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS); if ((!extensionString || !strstr(extensionString, "EGL_WL_bind_wayland_display")) && !ignoreBindDisplay) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. There is no EGL_WL_bind_wayland_display extension."; - return false; + return; } d->egl_bind_wayland_display = reinterpret_cast(eglGetProcAddress("eglBindWaylandDisplayWL")); @@ -430,14 +430,14 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di if ((!d->egl_bind_wayland_display || !d->egl_unbind_wayland_display) && !ignoreBindDisplay) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL."; - return false; + return; } d->egl_query_wayland_buffer = reinterpret_cast(eglGetProcAddress("eglQueryWaylandBufferWL")); if (!d->egl_query_wayland_buffer) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not find eglQueryWaylandBufferWL."; - return false; + return; } d->egl_create_image = reinterpret_cast(eglGetProcAddress("eglCreateImageKHR")); @@ -445,7 +445,7 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di if (!d->egl_create_image || !d->egl_destroy_image) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not find eglCreateImageKHR and eglDestroyImageKHR."; - return false; + return; } if (d->egl_bind_wayland_display && d->egl_unbind_wayland_display) { @@ -454,7 +454,7 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di if (!ignoreBindDisplay) { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize EGL display. Could not bind Wayland display."; - return false; + return; } else { qCWarning(qLcWaylandCompositorHardwareIntegration) << "Could not bind Wayland display. Ignoring."; } @@ -464,8 +464,6 @@ bool WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *di d->funcs = new QEGLStreamConvenience; d->funcs->initialize(d->egl_display); - - return true; } QtWayland::ClientBuffer *WaylandEglClientBufferIntegration::createBufferFor(wl_resource *buffer) diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h index 3b9959e2..bbc0eafe 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h @@ -45,7 +45,7 @@ public: WaylandEglClientBufferIntegration(); ~WaylandEglClientBufferIntegration() override; - bool initializeHardware(struct ::wl_display *display) override; + void initializeHardware(struct ::wl_display *display) override; QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override; diff --git a/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp b/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp index 6c031aa8..8285e18d 100644 --- a/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp @@ -298,7 +298,7 @@ void WaylandEglStreamClientBufferIntegration::attachEglStreamConsumer(struct ::w d->initEglStream(clientBuffer, wl_buffer); } -bool WaylandEglStreamClientBufferIntegration::initializeHardware(struct wl_display *display) +void WaylandEglStreamClientBufferIntegration::initializeHardware(struct wl_display *display) { Q_D(WaylandEglStreamClientBufferIntegration); @@ -307,32 +307,32 @@ bool WaylandEglStreamClientBufferIntegration::initializeHardware(struct wl_displ QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); if (!nativeInterface) { qWarning("QtCompositor: Failed to initialize EGL display. No native platform interface available."); - return false; + return; } d->egl_display = nativeInterface->nativeResourceForIntegration("EglDisplay"); if (!d->egl_display) { qWarning("QtCompositor: Failed to initialize EGL display. Could not get EglDisplay for window."); - return false; + return; } const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS); if ((!extensionString || !strstr(extensionString, "EGL_WL_bind_wayland_display")) && !ignoreBindDisplay) { qWarning("QtCompositor: Failed to initialize EGL display. There is no EGL_WL_bind_wayland_display extension."); - return false; + return; } d->egl_bind_wayland_display = reinterpret_cast(eglGetProcAddress("eglBindWaylandDisplayWL")); d->egl_unbind_wayland_display = reinterpret_cast(eglGetProcAddress("eglUnbindWaylandDisplayWL")); if ((!d->egl_bind_wayland_display || !d->egl_unbind_wayland_display) && !ignoreBindDisplay) { qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL."); - return false; + return; } d->egl_query_wayland_buffer = reinterpret_cast(eglGetProcAddress("eglQueryWaylandBufferWL")); if (!d->egl_query_wayland_buffer) { qWarning("QtCompositor: Failed to initialize EGL display. Could not find eglQueryWaylandBufferWL."); - return false; + return; } if (d->egl_bind_wayland_display && d->egl_unbind_wayland_display) { @@ -340,7 +340,7 @@ bool WaylandEglStreamClientBufferIntegration::initializeHardware(struct wl_displ if (!d->display_bound) { if (!ignoreBindDisplay) { qWarning("QtCompositor: Failed to initialize EGL display. Could not bind Wayland display."); - return false; + return; } else { qWarning("QtCompositor: Could not bind Wayland display. Ignoring."); } @@ -351,12 +351,6 @@ bool WaylandEglStreamClientBufferIntegration::initializeHardware(struct wl_displ d->funcs = new QEGLStreamConvenience; d->funcs->initialize(d->egl_display); - if (!d->funcs->initialized) { - qWarning(qLcWaylandCompositorHardwareIntegration) << "Failed to initialize eglstreams API"; - return false; - } - - return true; } QtWayland::ClientBuffer *WaylandEglStreamClientBufferIntegration::createBufferFor(wl_resource *buffer) diff --git a/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.h b/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.h index 35d2c80d..4c4cce25 100644 --- a/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.h +++ b/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.h @@ -44,7 +44,7 @@ public: WaylandEglStreamClientBufferIntegration(); ~WaylandEglStreamClientBufferIntegration() override; - bool initializeHardware(struct ::wl_display *display) override; + void initializeHardware(struct ::wl_display *display) override; QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override; diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp index 3c302c7f..3cf51a8d 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp @@ -62,26 +62,20 @@ XCompositeEglClientBufferIntegration::XCompositeEglClientBufferIntegration() } -bool XCompositeEglClientBufferIntegration::initializeHardware(struct ::wl_display *) +void XCompositeEglClientBufferIntegration::initializeHardware(struct ::wl_display *) { QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); if (nativeInterface) { mDisplay = static_cast(nativeInterface->nativeResourceForIntegration("Display")); - if (!mDisplay) { - qCWarning(qLcWaylandCompositorHardwareIntegration) << "could not retrieve Display from platform integration"; - return false; - } + if (!mDisplay) + qFatal("could not retrieve Display from platform integration"); mEglDisplay = static_cast(nativeInterface->nativeResourceForIntegration("EGLDisplay")); - if (!mEglDisplay) { - qCWarning(qLcWaylandCompositorHardwareIntegration) << "could not retrieve EGLDisplay from platform integration"; - return false; - } + if (!mEglDisplay) + qFatal("could not retrieve EGLDisplay from platform integration"); } else { - qCWarning(qLcWaylandCompositorHardwareIntegration) << "Platform integration doesn't have native interface"; - return false; + qFatal("Platform integration doesn't have native interface"); } new XCompositeHandler(m_compositor, mDisplay); - return true; } QtWayland::ClientBuffer *XCompositeEglClientBufferIntegration::createBufferFor(wl_resource *buffer) diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h index 2c3116df..80ce88b5 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h @@ -45,7 +45,7 @@ class XCompositeEglClientBufferIntegration : public QtWayland::ClientBufferInteg public: XCompositeEglClientBufferIntegration(); - bool initializeHardware(struct ::wl_display *display) override; + void initializeHardware(struct ::wl_display *display) override; QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override; inline Display *xDisplay() const { return mDisplay; } inline EGLDisplay eglDisplay() const { return mEglDisplay; } diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp index db439025..3c8fc9d0 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp @@ -70,19 +70,16 @@ XCompositeGLXClientBufferIntegration::~XCompositeGLXClientBufferIntegration() delete mHandler; } -bool XCompositeGLXClientBufferIntegration::initializeHardware(struct ::wl_display *) +void XCompositeGLXClientBufferIntegration::initializeHardware(struct ::wl_display *) { qDebug() << "Initializing GLX integration"; QPlatformNativeInterface *nativeInterface = QGuiApplicationPrivate::platformIntegration()->nativeInterface(); if (nativeInterface) { mDisplay = static_cast(nativeInterface->nativeResourceForIntegration("Display")); - if (!mDisplay) { - qCWarning(qLcWaylandCompositorHardwareIntegration) << "could not retrieve Display from platform integration"; - return false; - } + if (!mDisplay) + qFatal("could not retrieve Display from platform integration"); } else { - qCWarning(qLcWaylandCompositorHardwareIntegration) << "Platform integration doesn't have native interface"; - return false; + qFatal("Platform integration doesn't have native interface"); } mScreen = XDefaultScreen(mDisplay); @@ -93,8 +90,7 @@ bool XCompositeGLXClientBufferIntegration::initializeHardware(struct ::wl_displa m_glxBindTexImageEXT = reinterpret_cast(glContext->getProcAddress("glXBindTexImageEXT")); if (!m_glxBindTexImageEXT) { - qCWarning(qLcWaylandCompositorHardwareIntegration) << "Did not find glxBindTexImageExt, everything will FAIL!"; - return false; + qDebug() << "Did not find glxBindTexImageExt, everything will FAIL!"; } m_glxReleaseTexImageEXT = reinterpret_cast(glContext->getProcAddress("glXReleaseTexImageEXT")); if (!m_glxReleaseTexImageEXT) { @@ -102,7 +98,6 @@ bool XCompositeGLXClientBufferIntegration::initializeHardware(struct ::wl_displa } delete glContext; - return true; } QtWayland::ClientBuffer *XCompositeGLXClientBufferIntegration::createBufferFor(wl_resource *buffer) diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h index 6763d591..e783d41b 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h @@ -48,7 +48,7 @@ public: XCompositeGLXClientBufferIntegration(); ~XCompositeGLXClientBufferIntegration() override; - bool initializeHardware(struct ::wl_display *display) override; + void initializeHardware(struct ::wl_display *display) override; QtWayland::ClientBuffer *createBufferFor(wl_resource *buffer) override; inline Display *xDisplay() const { return mDisplay; } -- cgit v1.2.1 From ee5d89d5589dd1ace6e9f60d4ef611e23e2dec2d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 23 Jul 2019 08:44:46 +0200 Subject: Client: Remove recursion in data offer retrieval A loop functions just as well is more readable and uses less stack memory. Change-Id: I6f6c6b7b8047c42080fb8b9e0bc3eae96f8872ab Reviewed-by: David Faure Reviewed-by: Johan Helsing (cherry picked from commit 80bf946e78b5b5b4276668249eb1fab769259426) Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/client/qwaylanddataoffer.cpp | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index 4c06277f..2297e8a1 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -170,24 +170,27 @@ int QWaylandMimeData::readData(int fd, QByteArray &data) const timeout.tv_sec = 1; timeout.tv_usec = 0; - int ready = select(FD_SETSIZE, &readset, nullptr, nullptr, &timeout); - if (ready < 0) { - qWarning() << "QWaylandDataOffer: select() failed"; - return -1; - } else if (ready == 0) { - qWarning("QWaylandDataOffer: timeout reading from pipe"); - return -1; - } else { - char buf[4096]; - int n = QT_READ(fd, buf, sizeof buf); - - if (n > 0) { - data.append(buf, n); - n = readData(fd, data); - } else if (n < 0) { - qWarning("QWaylandDataOffer: read() failed"); + Q_FOREVER { + int ready = select(FD_SETSIZE, &readset, nullptr, nullptr, &timeout); + if (ready < 0) { + qWarning() << "QWaylandDataOffer: select() failed"; + return -1; + } else if (ready == 0) { + qWarning("QWaylandDataOffer: timeout reading from pipe"); + return -1; + } else { + char buf[4096]; + int n = QT_READ(fd, buf, sizeof buf); + + if (n < 0) { + qWarning("QWaylandDataOffer: read() failed"); + return -1; + } else if (n == 0) { + return 0; + } else if (n > 0) { + data.append(buf, n); + } } - return n; } } -- cgit v1.2.1 From 00b6314f79cf4d8b1ea2ba81dbafe7088c52ae84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 24 Mar 2020 10:02:13 +0100 Subject: Update connects to QSocketNotifier::activated The int-overload will in some cases truncate the descriptor. So it's being replaced. On Linux it won't truncate, so the slot can stay as int, but we still update which signal to connect to. Task-number: QTBUG-70441 Change-Id: I516a453c381e8d29464febabfd69c788e58db5fe Reviewed-by: Timur Pocheptsov --- src/client/qwaylandintegration.cpp | 2 +- src/compositor/compositor_api/qwaylandcompositor.cpp | 2 +- src/compositor/wayland_wrapper/qwldatadevicemanager.cpp | 2 +- tests/auto/client/client/tst_client.cpp | 2 +- tests/auto/compositor/compositor/mockclient.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 85c1990b..e3b86ee9 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -198,7 +198,7 @@ void QWaylandIntegration::initialize() int fd = wl_display_get_fd(mDisplay->wl_display()); QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data()); - QObject::connect(sn, SIGNAL(activated(int)), mDisplay.data(), SLOT(flushRequests())); + QObject::connect(sn, SIGNAL(activated(QSocketDescriptor)), mDisplay.data(), SLOT(flushRequests())); // Qt does not support running with no screens mDisplay->ensureScreen(); diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 83833991..ccc87a47 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -223,7 +223,7 @@ void QWaylandCompositorPrivate::init() int fd = wl_event_loop_get_fd(loop); QSocketNotifier *sockNot = new QSocketNotifier(fd, QSocketNotifier::Read, q); - QObject::connect(sockNot, SIGNAL(activated(int)), q, SLOT(processWaylandEvents())); + QObject::connect(sockNot, SIGNAL(activated(QSocketDescriptor)), q, SLOT(processWaylandEvents())); QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; QObject::connect(dispatcher, SIGNAL(aboutToBlock()), q, SLOT(processWaylandEvents())); diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 46df5210..d72bdf36 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -107,7 +107,7 @@ void DataDeviceManager::retain() fcntl(fd[0], F_SETFL, fcntl(fd[0], F_GETFL, 0) | O_NONBLOCK); m_current_selection_source->send(mimeType, fd[1]); m_retainedReadNotifier = new QSocketNotifier(fd[0], QSocketNotifier::Read, this); - connect(m_retainedReadNotifier, SIGNAL(activated(int)), SLOT(readFromClient(int))); + connect(m_retainedReadNotifier, &QSocketNotifier::activated, this, &DataDeviceManager::readFromClient); } void DataDeviceManager::finishReadFromClient(bool exhausted) diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp index 499a93a1..42e23b54 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -149,7 +149,7 @@ public: : compositor(c) { QSocketNotifier *notifier = new QSocketNotifier(compositor->waylandFileDescriptor(), QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)), this, SLOT(processWaylandEvents())); + connect(notifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(processWaylandEvents())); // connect to the event dispatcher to make sure to flush out the outgoing message queue connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::awake, this, &tst_WaylandClient::processWaylandEvents); connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, this, &tst_WaylandClient::processWaylandEvents); diff --git a/tests/auto/compositor/compositor/mockclient.cpp b/tests/auto/compositor/compositor/mockclient.cpp index 27d1eed8..76ccd0c5 100644 --- a/tests/auto/compositor/compositor/mockclient.cpp +++ b/tests/auto/compositor/compositor/mockclient.cpp @@ -57,7 +57,7 @@ MockClient::MockClient() fd = wl_display_get_fd(display); QSocketNotifier *readNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, this); - connect(readNotifier, SIGNAL(activated(int)), this, SLOT(readEvents())); + connect(readNotifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(readEvents())); QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; connect(dispatcher, SIGNAL(awake()), this, SLOT(flushDisplay())); -- cgit v1.2.1 From 056a6b764600ce5762d0823fed74eda3ece6de47 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 21 Apr 2020 09:12:16 -0700 Subject: Fix GCC 9 warning about redundant std::move use qwaylandcursor.cpp:254:21: warning: redundant move in return statement [-Wredundant-move] Change-Id: I9709abb1c3734e10a7defffd1607e1b3ed279d32 Reviewed-by: David Edmundson --- src/client/qwaylandcursor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp index 1d3d88be..3263b17f 100644 --- a/src/client/qwaylandcursor.cpp +++ b/src/client/qwaylandcursor.cpp @@ -251,7 +251,7 @@ QSharedPointer QWaylandCursor::cursorBitmapBuffer(QWaylandDispla const QImage &img = cursor->pixmap().toImage(); QSharedPointer buffer(new QWaylandShmBuffer(display, img.size(), img.format())); memcpy(buffer->image()->bits(), img.bits(), size_t(img.sizeInBytes())); - return std::move(buffer); + return buffer; } void QWaylandCursor::changeCursor(QCursor *cursor, QWindow *window) -- cgit v1.2.1 From 28e7d940c42c47cf039522709883ae3de9f4fb88 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Mon, 20 Apr 2020 12:46:56 +0200 Subject: Fix build error for -no-opengl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-83653 Change-Id: I604562fdc96c250eabba08d7fa8a9ec8f21cbbd1 Reviewed-by: Tony Sarajärvi --- src/compositor/configure.json | 2 +- src/compositor/extensions/extensions.pri | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compositor/configure.json b/src/compositor/configure.json index 42df2ddf..c5b0f03e 100644 --- a/src/compositor/configure.json +++ b/src/compositor/configure.json @@ -265,7 +265,7 @@ "wayland-compositor-quick": { "label": "QtQuick integration for wayland compositor", "purpose": "Allows QtWayland compositor types to be used with QtQuick", - "condition": "features.wayland-server && module.quick && features.opengl", + "condition": "features.wayland-server && module.quick", "output": [ "publicFeature" ] } }, diff --git a/src/compositor/extensions/extensions.pri b/src/compositor/extensions/extensions.pri index 06e3ef9e..64b1439b 100644 --- a/src/compositor/extensions/extensions.pri +++ b/src/compositor/extensions/extensions.pri @@ -8,7 +8,6 @@ WAYLANDSERVERSOURCES += \ ../extensions/touch-extension.xml \ ../extensions/qt-key-unstable-v1.xml \ ../extensions/qt-windowmanager.xml \ - ../extensions/qt-texture-sharing-unstable-v1.xml \ ../3rdparty/protocol/text-input-unstable-v2.xml \ ../3rdparty/protocol/viewporter.xml \ ../3rdparty/protocol/scaler.xml \ @@ -75,6 +74,8 @@ SOURCES += \ extensions/qwaylandivisurface.cpp \ qtHaveModule(quick) { + QT += quick quick-private + HEADERS += \ extensions/qwaylandquickshellintegration.h \ extensions/qwaylandquickshellsurfaceitem.h \ @@ -97,6 +98,9 @@ qtHaveModule(quick) { extensions/qwaylandxdgshellintegration.cpp \ qtConfig(opengl) { + WAYLANDSERVERSOURCES += \ + ../extensions/qt-texture-sharing-unstable-v1.xml + HEADERS += \ extensions/qwltexturesharingextension_p.h -- cgit v1.2.1