1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
From e302f87598de6853147c872b631e9a1fe4864f42 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Sat, 23 Dec 2017 23:30:07 +0100
Subject: Properly detect Gallium drivers with newer Mesa
Summary:
The renderer string does not contain "Gallium 0.4 on" anymore,
instead it directly contains the gallium driver's name.
So assume that every unknown renderer is a gallium driver.
Test Plan: Added a testcase, it succeeds only with this patch.
Reviewers: #plasma, graesslin
Subscribers: kwin, plasma-devel, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D9495
---
.../libkwineffects/data/glplatform/llvmpipe-5.0 | 22 ++++
libkwineffects/kwinglplatform.cpp | 114 +++++++++++----------
2 files changed, 82 insertions(+), 54 deletions(-)
create mode 100644 autotests/libkwineffects/data/glplatform/llvmpipe-5.0
diff --git a/autotests/libkwineffects/data/glplatform/llvmpipe-5.0 b/autotests/libkwineffects/data/glplatform/llvmpipe-5.0
new file mode 100644
index 0000000..56aa352
--- /dev/null
+++ b/autotests/libkwineffects/data/glplatform/llvmpipe-5.0
@@ -0,0 +1,22 @@
+[Driver]
+Vendor=VMware, Inc.
+Renderer=llvmpipe (LLVM 5.0, 256 bits)
+Version=3.0 Mesa 17.2.6
+ShadingLanguageVersion=1.30
+
+[Settings]
+LooseBinding=true
+GLSL=true
+TextureNPOT=true
+Mesa=true
+Gallium=true
+SoftwareEmulation=true
+GLVersion=3,0
+GLSLVersion=1,30
+MesaVersion=17,2,6
+GalliumVersion=0,4
+DriverVersion=17,2,6
+Driver=12
+ChipClass=99999
+Compositor=9
+
diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp
index 2b7b9a4..f5febc0 100644
--- a/libkwineffects/kwinglplatform.cpp
+++ b/libkwineffects/kwinglplatform.cpp
@@ -702,14 +702,69 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
m_chipClass = detectIntelClass(chipset);
}
+ // Properietary drivers
+ // ====================================================
+ else if (m_vendor == "ATI Technologies Inc.") {
+ m_chipClass = detectRadeonClass(m_renderer);
+ m_driver = Driver_Catalyst;
+
+ if (versionTokens.count() > 1 && versionTokens.at(2)[0] == '(')
+ m_driverVersion = parseVersionString(versionTokens.at(1));
+ else if (versionTokens.count() > 0)
+ m_driverVersion = parseVersionString(versionTokens.at(0));
+ else
+ m_driverVersion = 0;
+ }
+
+ else if (m_vendor == "NVIDIA Corporation") {
+ m_chipClass = detectNVidiaClass(m_renderer);
+ m_driver = Driver_NVidia;
+
+ int index = versionTokens.indexOf("NVIDIA");
+ if (versionTokens.count() > index)
+ m_driverVersion = parseVersionString(versionTokens.at(index + 1));
+ else
+ m_driverVersion = 0;
+ }
+
+ else if (m_vendor == "Qualcomm") {
+ m_driver = Driver_Qualcomm;
+ m_chipClass = detectQualcommClass(m_renderer);
+ }
+
+ else if (m_renderer == "Software Rasterizer") {
+ m_driver = Driver_Swrast;
+ }
+
+ // Virtual Hardware
+ // ====================================================
+ else if (m_vendor == "Humper" && m_renderer == "Chromium") {
+ // Virtual Box
+ m_driver = Driver_VirtualBox;
+
+ const int index = versionTokens.indexOf("Chromium");
+ if (versionTokens.count() > index)
+ m_driverVersion = parseVersionString(versionTokens.at(index + 1));
+ else
+ m_driverVersion = 0;
+ }
+
// Gallium drivers
// ====================================================
- else if (m_renderer.contains("Gallium")) {
- // Sample renderer string: Gallium 0.4 on AMD RV740
+ else {
const QList<QByteArray> tokens = m_renderer.split(' ');
- m_galliumVersion = parseVersionString(tokens.at(1));
- m_chipset = (tokens.at(3) == "AMD" || tokens.at(3) == "ATI") ?
- tokens.at(4) : tokens.at(3);
+ if (m_renderer.contains("Gallium")) {
+ // Sample renderer string: Gallium 0.4 on AMD RV740
+ m_galliumVersion = parseVersionString(tokens.at(1));
+ m_chipset = (tokens.at(3) == "AMD" || tokens.at(3) == "ATI") ?
+ tokens.at(4) : tokens.at(3);
+ }
+ else {
+ // The renderer string does not contain "Gallium" anymore.
+ m_chipset = tokens.at(0);
+ // We don't know the actual version anymore, but it's at least 0.4.
+ m_galliumVersion = kVersionNumber(0, 4, 0);
+ }
// R300G
if (m_vendor == QByteArrayLiteral("X.Org R300 Project")) {
@@ -764,55 +819,6 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface)
}
}
-
- // Properietary drivers
- // ====================================================
- else if (m_vendor == "ATI Technologies Inc.") {
- m_chipClass = detectRadeonClass(m_renderer);
- m_driver = Driver_Catalyst;
-
- if (versionTokens.count() > 1 && versionTokens.at(2)[0] == '(')
- m_driverVersion = parseVersionString(versionTokens.at(1));
- else if (versionTokens.count() > 0)
- m_driverVersion = parseVersionString(versionTokens.at(0));
- else
- m_driverVersion = 0;
- }
-
- else if (m_vendor == "NVIDIA Corporation") {
- m_chipClass = detectNVidiaClass(m_renderer);
- m_driver = Driver_NVidia;
-
- int index = versionTokens.indexOf("NVIDIA");
- if (versionTokens.count() > index)
- m_driverVersion = parseVersionString(versionTokens.at(index + 1));
- else
- m_driverVersion = 0;
- }
-
- else if (m_vendor == "Qualcomm") {
- m_driver = Driver_Qualcomm;
- m_chipClass = detectQualcommClass(m_renderer);
- }
-
- else if (m_renderer == "Software Rasterizer") {
- m_driver = Driver_Swrast;
- }
-
- // Virtual Hardware
- // ====================================================
- else if (m_vendor == "Humper" && m_renderer == "Chromium") {
- // Virtual Box
- m_driver = Driver_VirtualBox;
-
- const int index = versionTokens.indexOf("Chromium");
- if (versionTokens.count() > index)
- m_driverVersion = parseVersionString(versionTokens.at(index + 1));
- else
- m_driverVersion = 0;
- }
-
-
// Driver/GPU specific features
// ====================================================
if (isRadeon()) {
--
cgit v0.11.2
|