diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-10-22 13:41:49 +0200 |
---|---|---|
committer | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-10-25 14:45:15 +0200 |
commit | 137966a6293b50f6b248d130a2e36e67df49335e (patch) | |
tree | ba1b77a36dce68cb0748b855a2c94e685f8a7243 /src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp | |
parent | a3ab80f3463ce4f2e8c973e3f1048cc133fdba35 (diff) |
Compositor: Warn and clean up when client hardware buffer integrations fail
We've recently seen a number of performance issues on bugreports and on the
mailing list. The problem in many of these cases, is that no client hardware
buffer plugin is used. I.e. it's just due to our fallback to CPU buffers when
the compositor is configured incorrectly or run in a setup where hardware
buffers are not available.
This patch detects when client hardware buffer plugins fail and prints a
warning explaining the issue to the console.
This will make it easier to differentiate between expected and unexpected drops
in performance and will hopefully also guide users in the right direction
to fix their setup (set the right environment variables and perhaps recompile
Qt with a supported OpenGL version).
QtWayland::ClientBufferIntegration now returns a bool indicating success or
failure. The integration is now destroyed immediately if it failed, instead of
leaving it lying around until the compositor shuts down.
There has been some slight changes in the xcomposite plugins as well, turning
some qFatals into qCWarnings and failing more softly (with the warning
mentioned above).
Task-number: QTBUG-78483
Change-Id: I55293dbb3cf72768f3982c075fcf63e79329ada1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp')
-rw-r--r-- | src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp index 3cf51a8de..3c302c7f6 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp @@ -62,20 +62,26 @@ XCompositeEglClientBufferIntegration::XCompositeEglClientBufferIntegration() } -void XCompositeEglClientBufferIntegration::initializeHardware(struct ::wl_display *) +bool XCompositeEglClientBufferIntegration::initializeHardware(struct ::wl_display *) { QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); if (nativeInterface) { mDisplay = static_cast<Display *>(nativeInterface->nativeResourceForIntegration("Display")); - if (!mDisplay) - qFatal("could not retrieve Display from platform integration"); + if (!mDisplay) { + qCWarning(qLcWaylandCompositorHardwareIntegration) << "could not retrieve Display from platform integration"; + return false; + } mEglDisplay = static_cast<EGLDisplay>(nativeInterface->nativeResourceForIntegration("EGLDisplay")); - if (!mEglDisplay) - qFatal("could not retrieve EGLDisplay from platform integration"); + if (!mEglDisplay) { + qCWarning(qLcWaylandCompositorHardwareIntegration) << "could not retrieve EGLDisplay from platform integration"; + return false; + } } else { - qFatal("Platform integration doesn't have native interface"); + qCWarning(qLcWaylandCompositorHardwareIntegration) << "Platform integration doesn't have native interface"; + return false; } new XCompositeHandler(m_compositor, mDisplay); + return true; } QtWayland::ClientBuffer *XCompositeEglClientBufferIntegration::createBufferFor(wl_resource *buffer) |