summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-02-05 18:22:51 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-09 12:12:29 +0000
commit9fc6a9099e2fe97d3e7490418823bc4527250ac7 (patch)
treee6e60817e922f50c1872555367e5aa6ba2436258
parent27337fe242d9afe88efff371800ce83f3db9f875 (diff)
egl: Add debug option to print all EGLConfigs
QT_QPA_EGLFS_DEBUG=1 prints the attributes for the chosen EGLContext. Make QT_QPA_EGLFS_DEBUG=2 print the same for all EGLContexts. Change-Id: Id161d04789fbd015e29e5a5a89a0901000096ea3 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit d8c771c53acb58cc79cadbb795d59d5e8db7754e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/opengl/platform/egl/qeglplatformcontext.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
index 561079b48f..47e0b890d8 100644
--- a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
+++ b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
@@ -194,6 +194,21 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform
if (printConfig) {
qDebug() << "Created context for format" << format << "with config:";
q_printEglConfig(m_eglDisplay, m_eglConfig);
+
+ static const bool printAllConfigs = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEBUG") > 1;
+ if (printAllConfigs) {
+ EGLint numConfigs = 0;
+ eglGetConfigs(m_eglDisplay, nullptr, 0, &numConfigs);
+ QVector<EGLConfig> configs;
+ configs.resize(numConfigs);
+ eglGetConfigs(m_eglDisplay, configs.data(), numConfigs, &numConfigs);
+ qDebug("\nAll EGLConfigs: count=%d", numConfigs);
+ for (EGLint i = 0; i < numConfigs; ++i) {
+ qDebug("EGLConfig #%d", i);
+ q_printEglConfig(m_eglDisplay, configs[i]);
+ }
+ qDebug("\n");
+ }
}
// Cannot just call updateFormatFromGL() since it relies on virtuals. Defer it to initialize().