eglfs: Print the chosen config in debug mode

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 <jorgen.lind@digia.com>
This commit is contained in:
Laszlo Agocs 2014-03-24 20:09:11 +01:00 committed by The Qt Project
parent ebcb5c176f
commit dc685cf633
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -44,6 +44,7 @@
#include "qeglpbuffer_p.h"
#include <qpa/qplatformwindow.h>
#include <QOpenGLContext>
#include <QDebug>
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[] = {