From dc685cf6331f5fb46285cf10d6464c2ecf41f73e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 24 Mar 2014 20:09:11 +0100 Subject: eglfs: Print the chosen config in debug mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit q_printEglConfig has been left unused. Start using it again, in case QT_QPA_EGLFS_DEBUG is set. This will, similarly to QSG_INFO, help debugging, especially on embedded devices. Change-Id: I1448632ed055dd71e98259f042d3cac64620a4ce Reviewed-by: Jørgen Lind --- src/platformsupport/eglconvenience/qeglconvenience.cpp | 4 +--- src/platformsupport/eglconvenience/qeglplatformcontext.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp index 7cf1f88b02..f014ae42e5 100644 --- a/src/platformsupport/eglconvenience/qeglconvenience.cpp +++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp @@ -446,11 +446,9 @@ void q_printEglConfig(EGLDisplay display, EGLConfig config) for (index = 0; attrs[index].attr != -1; ++index) { EGLint value; if (eglGetConfigAttrib(display, config, attrs[index].attr, &value)) { - qWarning("\t%s: %d\n", attrs[index].name, (int)value); + qDebug("\t%s: %d", attrs[index].name, (int)value); } } - - qWarning("\n"); } #ifdef Q_OS_LINUX diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 9c3b9b539c..0dcb9f68bb 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -44,6 +44,7 @@ #include "qeglpbuffer_p.h" #include #include +#include QT_BEGIN_NAMESPACE @@ -191,6 +192,12 @@ void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLCont return; } + static const bool printConfig = qgetenv("QT_QPA_EGLFS_DEBUG").toInt(); + if (printConfig) { + qDebug() << "Created context for format" << format << "with config:"; + q_printEglConfig(m_eglDisplay, m_eglConfig); + } + #ifndef QT_NO_OPENGL // Make the context current to ensure the GL version query works. This needs a surface too. const EGLint pbufferAttributes[] = { -- cgit v1.2.3