summaryrefslogtreecommitdiffstats
path: root/content/gpu
diff options
context:
space:
mode:
authorapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 20:13:16 +0000
committerapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-07 20:13:16 +0000
commitf0c291658a13546113232d50ed8fa63d78e061ad (patch)
treef6e888512b0ff74b1edac91f0cbccd51012f29fc /content/gpu
parent6c94384d3a68b265644ff09171857bc330de1d16 (diff)
downloadchromium_src-f0c291658a13546113232d50ed8fa63d78e061ad.zip
chromium_src-f0c291658a13546113232d50ed8fa63d78e061ad.tar.gz
chromium_src-f0c291658a13546113232d50ed8fa63d78e061ad.tar.bz2
Revert 186559
> Windows: Only collect D3D11 UMA stats if the GPU process launches and initializes successfully. > > DisplayLink seems to make D3D initialization crash. It turns out we have the same issue with D3D9 as well. However, in the case of D3D9, the GPU process tends to crash first, causing the browser process to not use D3D for anything. By waiting to see whether the GPU process crashes, the browser process should not crash (often) if a problematic version of DisplayLink is installed. > > BUG=175525 > > Review URL: https://chromiumcodereview.appspot.com/12340089 BUG=180951 TBR=apatrick@chromium.org Review URL: https://codereview.chromium.org/12635005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r--content/gpu/gpu_info_collector.h22
-rw-r--r--content/gpu/gpu_info_collector_win.cc41
2 files changed, 35 insertions, 28 deletions
diff --git a/content/gpu/gpu_info_collector.h b/content/gpu/gpu_info_collector.h
index e70b832..b6b9bad 100644
--- a/content/gpu/gpu_info_collector.h
+++ b/content/gpu/gpu_info_collector.h
@@ -12,15 +12,6 @@
namespace gpu_info_collector {
-// Advanced Micro Devices has interesting configurations on laptops were
-// there are two videocards that can alternatively a given process output.
-enum AMDVideoCardType {
- UNKNOWN,
- STANDALONE,
- INTEGRATED,
- SWITCHABLE
-};
-
// Collect GPU vendor_id and device ID.
CONTENT_EXPORT bool CollectGpuID(uint32* vendor_id, uint32* device_id);
@@ -57,11 +48,14 @@ void MergeGPUInfo(content::GPUInfo* basic_gpu_info,
void MergeGPUInfoGL(content::GPUInfo* basic_gpu_info,
const content::GPUInfo& context_gpu_info);
-#if defined(OS_WIN)
-// Collects information about the level of D3D11 support and records it in
-// the UMA stats. Records no stats when D3D11 in not supported at all.
-void CollectD3D11Support();
-#endif
+// Advanced Micro Devices has interesting configurations on laptops were
+// there are two videocards that can alternatively a given process output.
+enum AMDVideoCardType {
+ UNKNOWN,
+ STANDALONE,
+ INTEGRATED,
+ SWITCHABLE
+};
} // namespace gpu_info_collector
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc
index c365a7f..3123eb39 100644
--- a/content/gpu/gpu_info_collector_win.cc
+++ b/content/gpu/gpu_info_collector_win.cc
@@ -199,7 +199,14 @@ AMDVideoCardType GetAMDVideocardType() {
AMDVideoCardType GetAMDVideocardType();
#endif
-void CollectD3D11Support() {
+// Collects information about the level of D3D11 support and records it in
+// the UMA stats. Records no stats when D3D11 in not supported at all.
+//
+// http://crbug.com/175525. Using D3D11 seems to crash when dlumd32.dll is
+// loaded. This function is not currently called.
+void CollectD3D11Support(HMODULE d3d11_module) {
+ TRACE_EVENT0("gpu", "CollectD3D11Support");
+
typedef HRESULT (WINAPI *D3D11CreateDeviceFunc)(
IDXGIAdapter* adapter,
D3D_DRIVER_TYPE driver_type,
@@ -228,27 +235,15 @@ void CollectD3D11Support() {
NUM_FEATURE_LEVELS
};
- TRACE_EVENT0("gpu", "CollectD3D11Support");
-
- // Windows XP is expected to not support D3D11.
- if (base::win::GetVersion() <= base::win::VERSION_XP)
- return;
-
FeatureLevel feature_level = FEATURE_LEVEL_UNKNOWN;
UINT bgra_support = 0;
- // This is leaked in case it is hooked by a third party DLL.
- base::NativeLibrary d3d11_module = base::LoadNativeLibrary(
- base::FilePath(L"d3d11.dll"),
- NULL);
-
if (!d3d11_module) {
feature_level = FEATURE_LEVEL_NO_D3D11_DLL;
} else {
D3D11CreateDeviceFunc create_func =
reinterpret_cast<D3D11CreateDeviceFunc>(
- base::GetFunctionPointerFromNativeLibrary(d3d11_module,
- "D3D11CreateDevice"));
+ GetProcAddress(d3d11_module, "D3D11CreateDevice"));
if (!create_func) {
feature_level = FEATURE_LEVEL_NO_CREATE_DEVICE_ENTRY_POINT;
} else {
@@ -325,6 +320,24 @@ void CollectD3D11Support() {
(bgra_support & D3D11_FORMAT_SUPPORT_RENDER_TARGET) != 0);
}
+void CollectD3D11SupportDelayed(
+ const scoped_refptr<base::MessageLoopProxy> main_loop) {
+ // Windows XP is expected to not support D3D11.
+ if (base::win::GetVersion() <= base::win::VERSION_XP)
+ return;
+
+ // This is leaked in case it is hooked by a third party DLL.
+ HMODULE d3d11_module = LoadLibrary(L"d3d11.dll");
+
+ // Collect the D3D11 stats after a delay to allow third party DLLs
+ // to hook D3D11 before we try to use it. Also do it on the main thread
+ // in case the third party DLL does this on the main thread.
+ main_loop->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(CollectD3D11Support, d3d11_module),
+ base::TimeDelta::FromSeconds(10));
+}
+
bool CollectDriverInfoD3D(const std::wstring& device_id,
content::GPUInfo* gpu_info) {
TRACE_EVENT0("gpu", "CollectDriverInfoD3D");