/src/mozilla-central/widget/GfxInfoX11.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
2 | | * vim: sw=2 ts=8 et : |
3 | | */ |
4 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
5 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 | | |
8 | | #include <unistd.h> |
9 | | #include <sys/types.h> |
10 | | #include <sys/wait.h> |
11 | | #include <errno.h> |
12 | | #include <sys/utsname.h> |
13 | | #include "nsCRTGlue.h" |
14 | | #include "nsExceptionHandler.h" |
15 | | #include "nsICrashReporter.h" |
16 | | #include "prenv.h" |
17 | | |
18 | | #include "GfxInfoX11.h" |
19 | | |
20 | | |
21 | | namespace mozilla { |
22 | | namespace widget { |
23 | | |
24 | | #ifdef DEBUG |
25 | | NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug) |
26 | | #endif |
27 | | |
28 | | // these global variables will be set when firing the glxtest process |
29 | | int glxtest_pipe = -1; |
30 | | pid_t glxtest_pid = 0; |
31 | | |
32 | | nsresult |
33 | | GfxInfo::Init() |
34 | 0 | { |
35 | 0 | mGLMajorVersion = 0; |
36 | 0 | mMajorVersion = 0; |
37 | 0 | mMinorVersion = 0; |
38 | 0 | mRevisionVersion = 0; |
39 | 0 | mIsMesa = false; |
40 | 0 | mIsNVIDIA = false; |
41 | 0 | mIsFGLRX = false; |
42 | 0 | mIsNouveau = false; |
43 | 0 | mIsIntel = false; |
44 | 0 | mIsOldSwrast = false; |
45 | 0 | mIsLlvmpipe = false; |
46 | 0 | mHasTextureFromPixmap = false; |
47 | 0 | return GfxInfoBase::Init(); |
48 | 0 | } |
49 | | |
50 | | void |
51 | | GfxInfo::GetData() |
52 | 0 | { |
53 | 0 | // to understand this function, see bug 639842. We retrieve the OpenGL driver information in a |
54 | 0 | // separate process to protect against bad drivers. |
55 | 0 |
|
56 | 0 | // if glxtest_pipe == -1, that means that we already read the information |
57 | 0 | if (glxtest_pipe == -1) |
58 | 0 | return; |
59 | 0 | |
60 | 0 | enum { buf_size = 1024 }; |
61 | 0 | char buf[buf_size]; |
62 | 0 | ssize_t bytesread = read(glxtest_pipe, |
63 | 0 | &buf, |
64 | 0 | buf_size-1); // -1 because we'll append a zero |
65 | 0 | close(glxtest_pipe); |
66 | 0 | glxtest_pipe = -1; |
67 | 0 |
|
68 | 0 | // bytesread < 0 would mean that the above read() call failed. |
69 | 0 | // This should never happen. If it did, the outcome would be to blacklist anyway. |
70 | 0 | if (bytesread < 0) |
71 | 0 | bytesread = 0; |
72 | 0 |
|
73 | 0 | // let buf be a zero-terminated string |
74 | 0 | buf[bytesread] = 0; |
75 | 0 |
|
76 | 0 | // Wait for the glxtest process to finish. This serves 2 purposes: |
77 | 0 | // * avoid having a zombie glxtest process laying around |
78 | 0 | // * get the glxtest process status info. |
79 | 0 | int glxtest_status = 0; |
80 | 0 | bool wait_for_glxtest_process = true; |
81 | 0 | bool waiting_for_glxtest_process_failed = false; |
82 | 0 | int waitpid_errno = 0; |
83 | 0 | while(wait_for_glxtest_process) { |
84 | 0 | wait_for_glxtest_process = false; |
85 | 0 | if (waitpid(glxtest_pid, &glxtest_status, 0) == -1) { |
86 | 0 | waitpid_errno = errno; |
87 | 0 | if (waitpid_errno == EINTR) { |
88 | 0 | wait_for_glxtest_process = true; |
89 | 0 | } else { |
90 | 0 | // Bug 718629 |
91 | 0 | // ECHILD happens when the glxtest process got reaped got reaped after a PR_CreateProcess |
92 | 0 | // as per bug 227246. This shouldn't matter, as we still seem to get the data |
93 | 0 | // from the pipe, and if we didn't, the outcome would be to blacklist anyway. |
94 | 0 | waiting_for_glxtest_process_failed = (waitpid_errno != ECHILD); |
95 | 0 | } |
96 | 0 | } |
97 | 0 | } |
98 | 0 |
|
99 | 0 | bool exited_with_error_code = !waiting_for_glxtest_process_failed && |
100 | 0 | WIFEXITED(glxtest_status) && |
101 | 0 | WEXITSTATUS(glxtest_status) != EXIT_SUCCESS; |
102 | 0 | bool received_signal = !waiting_for_glxtest_process_failed && |
103 | 0 | WIFSIGNALED(glxtest_status); |
104 | 0 |
|
105 | 0 | bool error = waiting_for_glxtest_process_failed || exited_with_error_code || received_signal; |
106 | 0 |
|
107 | 0 | nsCString textureFromPixmap; |
108 | 0 | nsCString *stringToFill = nullptr; |
109 | 0 | char *bufptr = buf; |
110 | 0 | if (!error) { |
111 | 0 | while(true) { |
112 | 0 | char *line = NS_strtok("\n", &bufptr); |
113 | 0 | if (!line) |
114 | 0 | break; |
115 | 0 | if (stringToFill) { |
116 | 0 | stringToFill->Assign(line); |
117 | 0 | stringToFill = nullptr; |
118 | 0 | } |
119 | 0 | else if(!strcmp(line, "VENDOR")) |
120 | 0 | stringToFill = &mVendor; |
121 | 0 | else if(!strcmp(line, "RENDERER")) |
122 | 0 | stringToFill = &mRenderer; |
123 | 0 | else if(!strcmp(line, "VERSION")) |
124 | 0 | stringToFill = &mVersion; |
125 | 0 | else if(!strcmp(line, "TFP")) |
126 | 0 | stringToFill = &textureFromPixmap; |
127 | 0 | } |
128 | 0 | } |
129 | 0 |
|
130 | 0 | if (!strcmp(textureFromPixmap.get(), "TRUE")) |
131 | 0 | mHasTextureFromPixmap = true; |
132 | 0 |
|
133 | 0 | // only useful for Linux kernel version check for FGLRX driver. |
134 | 0 | // assumes X client == X server, which is sad. |
135 | 0 | struct utsname unameobj; |
136 | 0 | if (uname(&unameobj) >= 0) |
137 | 0 | { |
138 | 0 | mOS.Assign(unameobj.sysname); |
139 | 0 | mOSRelease.Assign(unameobj.release); |
140 | 0 | } |
141 | 0 |
|
142 | 0 | const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR"); |
143 | 0 | if (spoofedVendor) |
144 | 0 | mVendor.Assign(spoofedVendor); |
145 | 0 | const char *spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER"); |
146 | 0 | if (spoofedRenderer) |
147 | 0 | mRenderer.Assign(spoofedRenderer); |
148 | 0 | const char *spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION"); |
149 | 0 | if (spoofedVersion) |
150 | 0 | mVersion.Assign(spoofedVersion); |
151 | 0 | const char *spoofedOS = PR_GetEnv("MOZ_GFX_SPOOF_OS"); |
152 | 0 | if (spoofedOS) |
153 | 0 | mOS.Assign(spoofedOS); |
154 | 0 | const char *spoofedOSRelease = PR_GetEnv("MOZ_GFX_SPOOF_OS_RELEASE"); |
155 | 0 | if (spoofedOSRelease) |
156 | 0 | mOSRelease.Assign(spoofedOSRelease); |
157 | 0 |
|
158 | 0 | if (error || |
159 | 0 | mVendor.IsEmpty() || |
160 | 0 | mRenderer.IsEmpty() || |
161 | 0 | mVersion.IsEmpty() || |
162 | 0 | mOS.IsEmpty() || |
163 | 0 | mOSRelease.IsEmpty()) |
164 | 0 | { |
165 | 0 | mAdapterDescription.AppendLiteral("GLXtest process failed"); |
166 | 0 | if (waiting_for_glxtest_process_failed) |
167 | 0 | mAdapterDescription.AppendPrintf(" (waitpid failed with errno=%d for pid %d)", waitpid_errno, glxtest_pid); |
168 | 0 | if (exited_with_error_code) |
169 | 0 | mAdapterDescription.AppendPrintf(" (exited with status %d)", WEXITSTATUS(glxtest_status)); |
170 | 0 | if (received_signal) |
171 | 0 | mAdapterDescription.AppendPrintf(" (received signal %d)", WTERMSIG(glxtest_status)); |
172 | 0 | if (bytesread) { |
173 | 0 | mAdapterDescription.AppendLiteral(": "); |
174 | 0 | mAdapterDescription.Append(nsDependentCString(buf)); |
175 | 0 | mAdapterDescription.Append('\n'); |
176 | 0 | } |
177 | 0 |
|
178 | 0 | CrashReporter::AppendAppNotesToCrashReport(mAdapterDescription); |
179 | 0 | return; |
180 | 0 | } |
181 | 0 |
|
182 | 0 | mAdapterDescription.Append(mVendor); |
183 | 0 | mAdapterDescription.AppendLiteral(" -- "); |
184 | 0 | mAdapterDescription.Append(mRenderer); |
185 | 0 |
|
186 | 0 | nsAutoCString note; |
187 | 0 | note.AppendLiteral("OpenGL: "); |
188 | 0 | note.Append(mAdapterDescription); |
189 | 0 | note.AppendLiteral(" -- "); |
190 | 0 | note.Append(mVersion); |
191 | 0 | if (mHasTextureFromPixmap) |
192 | 0 | note.AppendLiteral(" -- texture_from_pixmap"); |
193 | 0 | note.Append('\n'); |
194 | 0 |
|
195 | 0 | CrashReporter::AppendAppNotesToCrashReport(note); |
196 | 0 |
|
197 | 0 | // determine the major OpenGL version. That's the first integer in the version string. |
198 | 0 | mGLMajorVersion = strtol(mVersion.get(), 0, 10); |
199 | 0 |
|
200 | 0 | // determine driver type (vendor) and where in the version string |
201 | 0 | // the actual driver version numbers should be expected to be found (whereToReadVersionNumbers) |
202 | 0 | const char *whereToReadVersionNumbers = nullptr; |
203 | 0 | const char *Mesa_in_version_string = strstr(mVersion.get(), "Mesa"); |
204 | 0 | if (Mesa_in_version_string) { |
205 | 0 | mIsMesa = true; |
206 | 0 | // with Mesa, the version string contains "Mesa major.minor" and that's all the version information we get: |
207 | 0 | // there is no actual driver version info. |
208 | 0 | whereToReadVersionNumbers = Mesa_in_version_string + strlen("Mesa"); |
209 | 0 | if (strcasestr(mVendor.get(), "nouveau")) |
210 | 0 | mIsNouveau = true; |
211 | 0 | if (strcasestr(mRenderer.get(), "intel")) // yes, intel is in the renderer string |
212 | 0 | mIsIntel = true; |
213 | 0 | if (strcasestr(mRenderer.get(), "llvmpipe")) |
214 | 0 | mIsLlvmpipe = true; |
215 | 0 | if (strcasestr(mRenderer.get(), "software rasterizer")) |
216 | 0 | mIsOldSwrast = true; |
217 | 0 | } else if (strstr(mVendor.get(), "NVIDIA Corporation")) { |
218 | 0 | mIsNVIDIA = true; |
219 | 0 | // with the NVIDIA driver, the version string contains "NVIDIA major.minor" |
220 | 0 | // note that here the vendor and version strings behave differently, that's why we don't put this above |
221 | 0 | // alongside Mesa_in_version_string. |
222 | 0 | const char *NVIDIA_in_version_string = strstr(mVersion.get(), "NVIDIA"); |
223 | 0 | if (NVIDIA_in_version_string) |
224 | 0 | whereToReadVersionNumbers = NVIDIA_in_version_string + strlen("NVIDIA"); |
225 | 0 | } else if (strstr(mVendor.get(), "ATI Technologies Inc")) { |
226 | 0 | mIsFGLRX = true; |
227 | 0 | // with the FGLRX driver, the version string only gives a OpenGL version :/ so let's return that. |
228 | 0 | // that can at least give a rough idea of how old the driver is. |
229 | 0 | whereToReadVersionNumbers = mVersion.get(); |
230 | 0 | } |
231 | 0 |
|
232 | 0 | // read major.minor version numbers of the driver (not to be confused with the OpenGL version) |
233 | 0 | if (whereToReadVersionNumbers) { |
234 | 0 | // copy into writable buffer, for tokenization |
235 | 0 | strncpy(buf, whereToReadVersionNumbers, buf_size); |
236 | 0 | bufptr = buf; |
237 | 0 |
|
238 | 0 | // now try to read major.minor version numbers. In case of failure, gracefully exit: these numbers have |
239 | 0 | // been initialized as 0 anyways |
240 | 0 | char *token = NS_strtok(".", &bufptr); |
241 | 0 | if (token) { |
242 | 0 | mMajorVersion = strtol(token, 0, 10); |
243 | 0 | token = NS_strtok(".", &bufptr); |
244 | 0 | if (token) { |
245 | 0 | mMinorVersion = strtol(token, 0, 10); |
246 | 0 | token = NS_strtok(".", &bufptr); |
247 | 0 | if (token) |
248 | 0 | mRevisionVersion = strtol(token, 0, 10); |
249 | 0 | } |
250 | 0 | } |
251 | 0 | } |
252 | 0 | } |
253 | | |
254 | | static inline uint64_t version(uint32_t major, uint32_t minor, uint32_t revision = 0) |
255 | 0 | { |
256 | 0 | return (uint64_t(major) << 32) + (uint64_t(minor) << 16) + uint64_t(revision); |
257 | 0 | } |
258 | | |
259 | | const nsTArray<GfxDriverInfo>& |
260 | | GfxInfo::GetGfxDriverInfo() |
261 | 0 | { |
262 | 0 | // Nothing here yet. |
263 | 0 | //if (!sDriverInfo->Length()) { |
264 | 0 | // |
265 | 0 | //} |
266 | 0 | return *sDriverInfo; |
267 | 0 | } |
268 | | |
269 | | nsresult |
270 | | GfxInfo::GetFeatureStatusImpl(int32_t aFeature, |
271 | | int32_t *aStatus, |
272 | | nsAString & aSuggestedDriverVersion, |
273 | | const nsTArray<GfxDriverInfo>& aDriverInfo, |
274 | | nsACString& aFailureId, |
275 | | OperatingSystem* aOS /* = nullptr */) |
276 | | |
277 | 0 | { |
278 | 0 | NS_ENSURE_ARG_POINTER(aStatus); |
279 | 0 | *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN; |
280 | 0 | aSuggestedDriverVersion.SetIsVoid(true); |
281 | 0 | OperatingSystem os = OperatingSystem::Linux; |
282 | 0 | if (aOS) |
283 | 0 | *aOS = os; |
284 | 0 |
|
285 | 0 | if (sShutdownOccurred) { |
286 | 0 | return NS_OK; |
287 | 0 | } |
288 | 0 | |
289 | 0 | GetData(); |
290 | 0 |
|
291 | 0 | if (mGLMajorVersion == 1) { |
292 | 0 | // We're on OpenGL 1. In most cases that indicates really old hardware. |
293 | 0 | // We better block them, rather than rely on them to fail gracefully, because they don't! |
294 | 0 | // see bug 696636 |
295 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; |
296 | 0 | aFailureId = "FEATURE_FAILURE_OPENGL_1"; |
297 | 0 | return NS_OK; |
298 | 0 | } |
299 | 0 | |
300 | 0 | // Don't evaluate any special cases if we're checking the downloaded blocklist. |
301 | 0 | if (!aDriverInfo.Length()) { |
302 | 0 | // Blacklist software GL implementations from using layers acceleration. |
303 | 0 | // On the test infrastructure, we'll force-enable layers acceleration. |
304 | 0 | if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && |
305 | 0 | (mIsLlvmpipe || mIsOldSwrast) && |
306 | 0 | !PR_GetEnv("MOZ_LAYERS_ALLOW_SOFTWARE_GL")) |
307 | 0 | { |
308 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; |
309 | 0 | aFailureId = "FEATURE_FAILURE_SOFTWARE_GL"; |
310 | 0 | return NS_OK; |
311 | 0 | } |
312 | 0 | |
313 | 0 | if (aFeature == nsIGfxInfo::FEATURE_WEBRENDER) { |
314 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION; |
315 | 0 | aFailureId = "FEATURE_UNQUALIFIED_WEBRENDER_LINUX"; |
316 | 0 | return NS_OK; |
317 | 0 | } |
318 | 0 | |
319 | 0 | // Only check features relevant to Linux. |
320 | 0 | if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS || |
321 | 0 | aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL || |
322 | 0 | aFeature == nsIGfxInfo::FEATURE_WEBGL2 || |
323 | 0 | aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) { |
324 | 0 |
|
325 | 0 | // whitelist the linux test slaves' current configuration. |
326 | 0 | // this is necessary as they're still using the slightly outdated 190.42 driver. |
327 | 0 | // this isn't a huge risk, as at least this is the exact setting in which we do continuous testing, |
328 | 0 | // and this only affects GeForce 9400 cards on linux on this precise driver version, which is very few users. |
329 | 0 | // We do the same thing on Windows XP, see in widget/windows/GfxInfo.cpp |
330 | 0 | if (mIsNVIDIA && |
331 | 0 | !strcmp(mRenderer.get(), "GeForce 9400/PCI/SSE2") && |
332 | 0 | !strcmp(mVersion.get(), "3.2.0 NVIDIA 190.42")) |
333 | 0 | { |
334 | 0 | *aStatus = nsIGfxInfo::FEATURE_STATUS_OK; |
335 | 0 | return NS_OK; |
336 | 0 | } |
337 | 0 | |
338 | 0 | if (mIsMesa) { |
339 | 0 | if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(8,0)) { |
340 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; |
341 | 0 | aFailureId = "FEATURE_FAILURE_MESA_1"; |
342 | 0 | aSuggestedDriverVersion.AssignLiteral("Mesa 8.0"); |
343 | 0 | } |
344 | 0 | else if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) { |
345 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; |
346 | 0 | aFailureId = "FEATURE_FAILURE_MESA_2"; |
347 | 0 | aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3"); |
348 | 0 | } |
349 | 0 | else if (mIsOldSwrast) { |
350 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; |
351 | 0 | aFailureId = "FEATURE_FAILURE_SW_RAST"; |
352 | 0 | } |
353 | 0 | else if (mIsLlvmpipe && version(mMajorVersion, mMinorVersion) < version(9, 1)) { |
354 | 0 | // bug 791905, Mesa bug 57733, fixed in Mesa 9.1 according to |
355 | 0 | // https://bugs.freedesktop.org/show_bug.cgi?id=57733#c3 |
356 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; |
357 | 0 | aFailureId = "FEATURE_FAILURE_MESA_3"; |
358 | 0 | } |
359 | 0 | else if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) |
360 | 0 | { |
361 | 0 | if (mIsIntel && version(mMajorVersion, mMinorVersion) < version(8,1)) { |
362 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; |
363 | 0 | aFailureId = "FEATURE_FAILURE_MESA_4"; |
364 | 0 | aSuggestedDriverVersion.AssignLiteral("Mesa 8.1"); |
365 | 0 | } |
366 | 0 | } |
367 | 0 |
|
368 | 0 | } else if (mIsNVIDIA) { |
369 | 0 | if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) { |
370 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; |
371 | 0 | aFailureId = "FEATURE_FAILURE_OLD_NV"; |
372 | 0 | aSuggestedDriverVersion.AssignLiteral("NVIDIA 257.21"); |
373 | 0 | } |
374 | 0 | } else if (mIsFGLRX) { |
375 | 0 | // FGLRX does not report a driver version number, so we have the OpenGL version instead. |
376 | 0 | // by requiring OpenGL 3, we effectively require recent drivers. |
377 | 0 | if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(3, 0)) { |
378 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; |
379 | 0 | aFailureId = "FEATURE_FAILURE_OLD_FGLRX"; |
380 | 0 | aSuggestedDriverVersion.AssignLiteral("<Something recent>"); |
381 | 0 | } |
382 | 0 | // Bug 724640: FGLRX + Linux 2.6.32 is a crashy combo |
383 | 0 | bool unknownOS = mOS.IsEmpty() || mOSRelease.IsEmpty(); |
384 | 0 | bool badOS = mOS.Find("Linux", true) != -1 && |
385 | 0 | mOSRelease.Find("2.6.32") != -1; |
386 | 0 | if (unknownOS || badOS) { |
387 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION; |
388 | 0 | aFailureId = "FEATURE_FAILURE_OLD_OS"; |
389 | 0 | } |
390 | 0 | } else { |
391 | 0 | // like on windows, let's block unknown vendors. Think of virtual machines. |
392 | 0 | // Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed. |
393 | 0 | *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; |
394 | 0 | } |
395 | 0 | } |
396 | 0 | } |
397 | 0 |
|
398 | 0 | return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os); |
399 | 0 | } |
400 | | |
401 | | |
402 | | NS_IMETHODIMP |
403 | | GfxInfo::GetD2DEnabled(bool *aEnabled) |
404 | 0 | { |
405 | 0 | return NS_ERROR_FAILURE; |
406 | 0 | } |
407 | | |
408 | | NS_IMETHODIMP |
409 | | GfxInfo::GetDWriteEnabled(bool *aEnabled) |
410 | 0 | { |
411 | 0 | return NS_ERROR_FAILURE; |
412 | 0 | } |
413 | | |
414 | | NS_IMETHODIMP |
415 | | GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion) |
416 | 0 | { |
417 | 0 | return NS_ERROR_FAILURE; |
418 | 0 | } |
419 | | |
420 | | NS_IMETHODIMP |
421 | | GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams) |
422 | 0 | { |
423 | 0 | return NS_ERROR_FAILURE; |
424 | 0 | } |
425 | | |
426 | | NS_IMETHODIMP |
427 | | GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription) |
428 | 0 | { |
429 | 0 | GetData(); |
430 | 0 | AppendASCIItoUTF16(mAdapterDescription, aAdapterDescription); |
431 | 0 | return NS_OK; |
432 | 0 | } |
433 | | |
434 | | NS_IMETHODIMP |
435 | | GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription) |
436 | 0 | { |
437 | 0 | return NS_ERROR_FAILURE; |
438 | 0 | } |
439 | | |
440 | | NS_IMETHODIMP |
441 | | GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM) |
442 | 0 | { |
443 | 0 | aAdapterRAM.Truncate(); |
444 | 0 | return NS_OK; |
445 | 0 | } |
446 | | |
447 | | NS_IMETHODIMP |
448 | | GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM) |
449 | 0 | { |
450 | 0 | return NS_ERROR_FAILURE; |
451 | 0 | } |
452 | | |
453 | | NS_IMETHODIMP |
454 | | GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver) |
455 | 0 | { |
456 | 0 | aAdapterDriver.Truncate(); |
457 | 0 | return NS_OK; |
458 | 0 | } |
459 | | |
460 | | NS_IMETHODIMP |
461 | | GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver) |
462 | 0 | { |
463 | 0 | return NS_ERROR_FAILURE; |
464 | 0 | } |
465 | | |
466 | | NS_IMETHODIMP |
467 | | GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion) |
468 | 0 | { |
469 | 0 | GetData(); |
470 | 0 | CopyASCIItoUTF16(mVersion, aAdapterDriverVersion); |
471 | 0 | return NS_OK; |
472 | 0 | } |
473 | | |
474 | | NS_IMETHODIMP |
475 | | GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) |
476 | 0 | { |
477 | 0 | return NS_ERROR_FAILURE; |
478 | 0 | } |
479 | | |
480 | | NS_IMETHODIMP |
481 | | GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate) |
482 | 0 | { |
483 | 0 | aAdapterDriverDate.Truncate(); |
484 | 0 | return NS_OK; |
485 | 0 | } |
486 | | |
487 | | NS_IMETHODIMP |
488 | | GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate) |
489 | 0 | { |
490 | 0 | return NS_ERROR_FAILURE; |
491 | 0 | } |
492 | | |
493 | | NS_IMETHODIMP |
494 | | GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID) |
495 | 0 | { |
496 | 0 | GetData(); |
497 | 0 | CopyUTF8toUTF16(mVendor, aAdapterVendorID); |
498 | 0 | return NS_OK; |
499 | 0 | } |
500 | | |
501 | | NS_IMETHODIMP |
502 | | GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID) |
503 | 0 | { |
504 | 0 | return NS_ERROR_FAILURE; |
505 | 0 | } |
506 | | |
507 | | NS_IMETHODIMP |
508 | | GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID) |
509 | 0 | { |
510 | 0 | GetData(); |
511 | 0 | CopyUTF8toUTF16(mRenderer, aAdapterDeviceID); |
512 | 0 | return NS_OK; |
513 | 0 | } |
514 | | |
515 | | NS_IMETHODIMP |
516 | | GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID) |
517 | 0 | { |
518 | 0 | return NS_ERROR_FAILURE; |
519 | 0 | } |
520 | | |
521 | | NS_IMETHODIMP |
522 | | GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID) |
523 | 0 | { |
524 | 0 | return NS_ERROR_FAILURE; |
525 | 0 | } |
526 | | |
527 | | NS_IMETHODIMP |
528 | | GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID) |
529 | 0 | { |
530 | 0 | return NS_ERROR_FAILURE; |
531 | 0 | } |
532 | | |
533 | | NS_IMETHODIMP |
534 | | GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) |
535 | 0 | { |
536 | 0 | return NS_ERROR_FAILURE; |
537 | 0 | } |
538 | | |
539 | | #ifdef DEBUG |
540 | | |
541 | | // Implement nsIGfxInfoDebug |
542 | | // We don't support spoofing anything on Linux |
543 | | |
544 | | NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString & aVendorID) |
545 | | { |
546 | | CopyUTF16toUTF8(aVendorID, mVendor); |
547 | | return NS_OK; |
548 | | } |
549 | | |
550 | | NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString & aDeviceID) |
551 | | { |
552 | | CopyUTF16toUTF8(aDeviceID, mRenderer); |
553 | | return NS_OK; |
554 | | } |
555 | | |
556 | | NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString & aDriverVersion) |
557 | | { |
558 | | CopyUTF16toUTF8(aDriverVersion, mVersion); |
559 | | return NS_OK; |
560 | | } |
561 | | |
562 | | NS_IMETHODIMP GfxInfo::SpoofOSVersion(uint32_t aVersion) |
563 | | { |
564 | | // We don't support OS versioning on Linux. There's just "Linux". |
565 | | return NS_OK; |
566 | | } |
567 | | |
568 | | #endif |
569 | | |
570 | | } // end namespace widget |
571 | | } // end namespace mozilla |