From ab9a9c8428693a64dee00f209e7f002de1d51680 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 5 Feb 2020 14:45:07 +0200 Subject: [PATCH] [libkwineffects] Detect AMD Navi GPUs Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: davidedmundson, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D27168 --- .../data/glplatform/amd-gallium-navi-4.5 | 21 +++++++++++++++++++ libkwineffects/kwinglplatform.cpp | 13 +++++++++++- libkwineffects/kwinglplatform.h | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 autotests/libkwineffects/data/glplatform/amd-gallium-navi-4.5 diff --git a/autotests/libkwineffects/data/glplatform/amd-gallium-navi-4.5 b/autotests/libkwineffects/data/glplatform/amd-gallium-navi-4.5 new file mode 100644 index 0000000000..056086c28c --- /dev/null +++ b/autotests/libkwineffects/data/glplatform/amd-gallium-navi-4.5 @@ -0,0 +1,21 @@ +[Driver] +Vendor=X.Org +Renderer=AMD NAVI10 (DRM 3.36.0, 5.5.1-arch1-1, LLVM 9.0.1) +Version=4.5 (Core Profile) Mesa 19.3.3 +ShadingLanguageVersion=4.50 + +[Settings] +LooseBinding=true +GLSL=true +TextureNPOT=true +Mesa=true +Gallium=true +Radeon=true +GLVersion=4,5 +GLSLVersion=4,50 +MesaVersion=19,3,3 +GalliumVersion=0,4 +DriverVersion=19,3,3 +Driver=16 +ChipClass=14 +Compositor=9 diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index da21b85417..25e8acfea8 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -225,6 +225,12 @@ static ChipClass detectRadeonClass(const QByteArray &chipset) return Vega; } + if (chipset.contains("NAVI10") || + chipset.contains("NAVI12") || + chipset.contains("NAVI14")) { + return Navi; + } + const QString chipset16 = QString::fromLatin1(chipset); QString name = extract(chipset16, QStringLiteral("HD [0-9]{4}")); // HD followed by a space and 4 digits if (!name.isEmpty()) { @@ -567,6 +573,8 @@ QByteArray GLPlatform::chipClassToString8(ChipClass chipClass) return QByteArrayLiteral("Arctic Islands"); case Vega: return QByteArrayLiteral("Vega"); + case Navi: + return QByteArrayLiteral("Navi"); case NV10: return QByteArrayLiteral("NV10"); @@ -876,7 +884,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) m_renderer.contains("VEGA10") || m_renderer.contains("VEGA12") || m_renderer.contains("VEGA20") || - m_renderer.contains("RAVEN"))) { + m_renderer.contains("RAVEN") || + m_renderer.contains("NAVI10") || + m_renderer.contains("NAVI12") || + m_renderer.contains("NAVI14"))) { m_chipClass = detectRadeonClass(m_renderer); m_driver = Driver_RadeonSI; } diff --git a/libkwineffects/kwinglplatform.h b/libkwineffects/kwinglplatform.h index 48f64af45d..ec9954239b 100644 --- a/libkwineffects/kwinglplatform.h +++ b/libkwineffects/kwinglplatform.h @@ -123,6 +123,7 @@ enum ChipClass { VolcanicIslands, // GL4.5 CL2.0 DX12 SM 6.0 2015 ArcticIslands, // GL4.5 CL2.0 DX12 SM 6.0 2016 Vega, // GL4.6 CL2.0 DX12 SM 6.0 2017 + Navi, // GL4.6 CL2.0 DX12.1 SM 6.4 2019 UnknownRadeon = 999, // NVIDIA