diff --git a/autotests/openglinfosourcetest.cpp b/autotests/openglinfosourcetest.cpp --- a/autotests/openglinfosourcetest.cpp +++ b/autotests/openglinfosourcetest.cpp @@ -185,15 +185,19 @@ QTest::addColumn("renderer"); QTest::newRow("empty") << QString() << QString(); - QTest::newRow("intel mesa") << QStringLiteral("Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)") << QStringLiteral("HD Graphics 520 (Skylake GT2)"); + QTest::newRow("intel mesa") << QStringLiteral("Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)") << QStringLiteral("HD Graphics 520"); + QTest::newRow("intel mesa 2") << QStringLiteral("Mesa Intel HD Graphics 530 (Skylake GT2)") << QStringLiteral("HD Graphics 530"); + QTest::newRow("intel mesa 3") << QStringLiteral("Mesa Intel Iris Plus Graphics 640 (Kaby Lake GT3e) (KBL GT3)") << QStringLiteral("Iris Plus Graphics 640"); QTest::newRow("intel macOS") << QStringLiteral("Intel Iris Pro OpenGL Engine") << QStringLiteral("Iris Pro"); QTest::newRow("intel windows") << QStringLiteral("Intel(R) HD Graphics 4600") << QStringLiteral("HD Graphics 4600"); QTest::newRow("nvidia") << QStringLiteral("GeForce GTX 1060 6GB/PCIe/SSE2") << QStringLiteral("GeForce GTX 1060 6GB/PCIe/SSE2"); QTest::newRow("nvidia macos") << QStringLiteral("NVIDIA GeForce GT 750M OpenGL Engine") << QStringLiteral("GeForce GT 750M"); QTest::newRow("angle") << QStringLiteral("ANGLE (VirtualBox Graphics Adapter for Windows 8+ Direct3D9Ex vs_3_0 ps_3_0)") << QStringLiteral("ANGLE"); QTest::newRow("gallium") << QStringLiteral("Gallium 0.4 on AMD BARTS (DRM 2.49.0 / 4.11.1-1-default, LLVM 4.0.0)") << QStringLiteral("Gallium 0.4 on AMD BARTS"); QTest::newRow("AMD 1") << QStringLiteral("AMD BARTS (DRM 2.50.0 / 4.17.2-1-default, LLVM 6.0.0)") << QStringLiteral("AMD BARTS"); QTest::newRow("AMD 2") << QStringLiteral("AMD Radeon (TM) RX 480 Graphics (POLARIS10 / DRM 3.19.0 / 4.14.50-gentoo, LLVM 6.0.0)") << QStringLiteral("AMD Radeon RX 480 Graphics"); + QTest::newRow("Radeon") << QStringLiteral("Radeon RX 590 Series (POLARIS10, DRM 3.35.0, 5.4.13-zen1-1-zen, LLVM 9.0.1)") << QStringLiteral("Radeon RX 590 Series"); + QTest::newRow("llvmpipe") << QStringLiteral("llvmpipe (LLVM 9.0, 128 bits)") << QStringLiteral("llvmpipe"); } void testNormalizeRenderer() diff --git a/src/provider/core/openglinfosource_p.h b/src/provider/core/openglinfosource_p.h --- a/src/provider/core/openglinfosource_p.h +++ b/src/provider/core/openglinfosource_p.h @@ -124,14 +124,20 @@ // remove vendor prefixes, we already have that in the vendor field if (r.startsWith(QLatin1String("Mesa DRI "))) r = r.mid(9); + if (r.startsWith(QLatin1String("Mesa "))) + r = r.mid(5); if (r.startsWith(QLatin1String("Intel "))) r = r.mid(6); if (r.startsWith(QLatin1String("NVIDIA "))) r = r.mid(7); // remove excessive details that could enable fingerprinting - if (r.startsWith(QLatin1String("ANGLE ")) || r.startsWith(QLatin1String("Gallium ")) || r.startsWith(QLatin1String("AMD "))) - r = stripDetails(r); + if (r.endsWith(QLatin1Char(')'))) { + const auto idx = r.indexOf(QLatin1String(" (")); + if (idx > 0) { + r = r.left(idx); + } + } // strip macOS adding " OpenGL Engine" at the end if (r.endsWith(QLatin1String(" OpenGL Engine"))) @@ -149,14 +155,6 @@ return s.mid(2); return s; } - - static inline QString stripDetails(const QString &s) - { - auto idx = s.indexOf(QLatin1String(" (")); - if (idx < 1 || !s.endsWith(QLatin1Char(')'))) - return s; - return s.left(idx); - } }; }