Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: gpu/config/gpu_info_collector_win.cc

Issue 2698273004: Add workaround for GPU detection inside a Citrix remote session. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/config/gpu_info_collector.h" 5 #include "gpu/config/gpu_info_collector.h"
6 6
7 // This has to be included before windows.h. 7 // This has to be included before windows.h.
8 #include "third_party/re2/src/re2/re2.h" 8 #include "third_party/re2/src/re2/re2.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 dd.cb = sizeof(DISPLAY_DEVICE); 343 dd.cb = sizeof(DISPLAY_DEVICE);
344 std::wstring id; 344 std::wstring id;
345 for (int i = 0; EnumDisplayDevices(NULL, i, &dd, 0); ++i) { 345 for (int i = 0; EnumDisplayDevices(NULL, i, &dd, 0); ++i) {
346 if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) { 346 if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
347 id = dd.DeviceID; 347 id = dd.DeviceID;
348 break; 348 break;
349 } 349 }
350 } 350 }
351 351
352 if (id.length() <= 20) { 352 if (id.length() <= 20) {
353 // Check if it is the RDP mirror driver "RDPUDD Chained DD" 353 // EnumDisplayDevices returns an empty id when called inside a remote
354 if (wcscmp(dd.DeviceString, L"RDPUDD Chained DD") != 0) { 354 // session (unless that session happens to be attached to the console). In
355 // that case, we do not want to fail, as we should be able to grab the
356 // device/vendor ids from the D3D context, below. Therefore, only fail if
357 // the device string is not one of either the RDP mirror driver "RDPUDD
358 // Chained DD" or the citrix display driver.
359 if (wcscmp(dd.DeviceString, L"RDPUDD Chained DD") != 0 &&
360 wcscmp(dd.DeviceString, L"Citrix Systems Inc. Display Driver") != 0) {
355 gpu_info->basic_info_state = kCollectInfoNonFatalFailure; 361 gpu_info->basic_info_state = kCollectInfoNonFatalFailure;
356 return kCollectInfoNonFatalFailure; 362 return kCollectInfoNonFatalFailure;
357 } 363 }
358 } 364 }
359 365
360 DeviceIDToVendorAndDevice(id, &gpu_info->gpu.vendor_id, 366 DeviceIDToVendorAndDevice(id, &gpu_info->gpu.vendor_id,
361 &gpu_info->gpu.device_id); 367 &gpu_info->gpu.device_id);
362 // TODO(zmo): we only need to call CollectDriverInfoD3D() if we use ANGLE. 368 // TODO(zmo): we only need to call CollectDriverInfoD3D() if we use ANGLE.
363 if (!CollectDriverInfoD3D(id, gpu_info)) { 369 if (!CollectDriverInfoD3D(id, gpu_info)) {
364 gpu_info->basic_info_state = kCollectInfoNonFatalFailure; 370 gpu_info->basic_info_state = kCollectInfoNonFatalFailure;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 435 }
430 436
431 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); 437 MergeGPUInfoGL(basic_gpu_info, context_gpu_info);
432 438
433 basic_gpu_info->dx_diagnostics_info_state = 439 basic_gpu_info->dx_diagnostics_info_state =
434 context_gpu_info.dx_diagnostics_info_state; 440 context_gpu_info.dx_diagnostics_info_state;
435 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; 441 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics;
436 } 442 }
437 443
438 } // namespace gpu 444 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698