summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-02-05 18:22:51 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-02-08 12:32:13 +0100
commitd8c771c53acb58cc79cadbb795d59d5e8db7754e (patch)
treed77011f12b2021218af58a053f26b82340fa1c61
parent3bda970935d4d54c07fa1d6454e2472abff66a77 (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. Pick-to: 6.1 Change-Id: Id161d04789fbd015e29e5a5a89a0901000096ea3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-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().