Commit f5cb6aa5 by Corentin Wallez

Port gpu_test_expectations and angle_deqp_googletest to Linux

BUG=angleproject:1051 Change-Id: I46c3a5651d36750558735eb626ed5c9424b250b4 Reviewed-on: https://chromium-review.googlesource.com/282596Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 2c70e64b
...@@ -1168,6 +1168,19 @@ ...@@ -1168,6 +1168,19 @@
'<(angle_path)/util/util.gyp:angle_util', '<(angle_path)/util/util.gyp:angle_util',
], ],
'copies':
[
{
'destination': '<(PRODUCT_DIR)/deqp_support',
'files':
[
'deqp_support/dEQP-GLES2-cases.txt.gz',
'deqp_support/dEQP-GLES3-cases.txt.gz',
'deqp_support/deqp_test_expectations.txt',
],
},
],
'direct_dependent_settings': 'direct_dependent_settings':
{ {
'include_dirs': 'include_dirs':
...@@ -1192,19 +1205,6 @@ ...@@ -1192,19 +1205,6 @@
'<@(deqp_undefines)', '<@(deqp_undefines)',
], ],
'copies':
[
{
'destination': '<(PRODUCT_DIR)/deqp_support',
'files':
[
'deqp_support/dEQP-GLES2-cases.txt.gz',
'deqp_support/dEQP-GLES3-cases.txt.gz',
'deqp_support/deqp_test_expectations.txt',
],
},
],
'msvs_settings': 'msvs_settings':
{ {
'VCLinkerTool': 'VCLinkerTool':
...@@ -1277,12 +1277,7 @@ ...@@ -1277,12 +1277,7 @@
'deqp_support/angle_deqp_tests_main.cpp', 'deqp_support/angle_deqp_tests_main.cpp',
], ],
}, },
], # targets
}], # (OS=="win" or OS=="linux") and angle_standalone==1
['OS=="win" and angle_standalone==1',
{
"targets":
[
{ {
'target_name': 'angle_deqp_googletest', 'target_name': 'angle_deqp_googletest',
'type': 'executable', 'type': 'executable',
...@@ -1295,8 +1290,22 @@ ...@@ -1295,8 +1290,22 @@
[ [
'deqp_support/angle_deqp_gtest_main.cpp', 'deqp_support/angle_deqp_gtest_main.cpp',
], ],
'conditions':
[
['OS=="linux"',
{
'ldflags':
[
'<!@(pkg-config --libs-only-L --libs-only-other libpci)',
],
'libraries':
[
'<!@(pkg-config --libs-only-l libpci)',
],
}],
],
}, },
], # targets ], # targets
}], # OS=="win" and angle_standalone==1 }], # (OS=="win" or OS=="linux") and angle_standalone==1
], # conditions ], # conditions
} }
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
// 91531 MAC WIN LINUX : conformance_more_* = SKIP // 91531 MAC WIN LINUX : conformance_more_* = SKIP
// 91532 MAC NVIDIA 0x0640 : tex_image_and_sub_image_2d_with_video = PASS FAIL // 91532 MAC NVIDIA 0x0640 : tex_image_and_sub_image_2d_with_video = PASS FAIL
// TODO(jmadill): triage these into temporary and permananet suppressions // TODO(cwallez): make suppression for Linux
// TODO(jmadill): triage these into temporary and permanent suppressions
989 WIN : dEQP-GLES2.functional.shaders.preprocessor.basic.identifier_with_double_underscore_vertex = FAIL 989 WIN : dEQP-GLES2.functional.shaders.preprocessor.basic.identifier_with_double_underscore_vertex = FAIL
989 WIN : dEQP-GLES2.functional.shaders.preprocessor.basic.identifier_with_double_underscore_fragment = FAIL 989 WIN : dEQP-GLES2.functional.shaders.preprocessor.basic.identifier_with_double_underscore_fragment = FAIL
989 WIN : dEQP-GLES2.functional.shaders.preprocessor.pragmas.invalid_pragma_invalid_* = FAIL 989 WIN : dEQP-GLES2.functional.shaders.preprocessor.pragmas.invalid_pragma_invalid_* = FAIL
...@@ -295,8 +297,8 @@ ...@@ -295,8 +297,8 @@
1034 WIN : dEQP-GLES2.functional.flush_finish.finish_wait = FAIL 1034 WIN : dEQP-GLES2.functional.flush_finish.finish_wait = FAIL
// Don't run these tests for faster turnover // Don't run these tests for faster turnover
998 WIN : dEQP-GLES2.performance.* = SKIP 998 WIN LINUX : dEQP-GLES2.performance.* = SKIP
998 WIN : dEQP-GLES2.stress.* = SKIP 998 WIN LINUX : dEQP-GLES2.stress.* = SKIP
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// //
......
Because the ```gpu_test_expectations``` directory is based on parts of Chromium's ```gpu/config``
directory, we want to keep a patch of the changes added to make it compile with ANGLE. This
will allow us to merge Chromium changes easily in our ```gpu_test_expectations```.
In order to make a change to this directory, do the following:
- copy the directory somewhere like in ```gpu_test_expectations_reverted```
- in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R angle-mods.patch```
- do your changes in ```gpu_test_expectations```
- delete angle-mods.path in both directories
- run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
- copy ```angle-mods.patch``` in ```gpu_test_expectations```
diff --git a/src/tests/third_party/gpu_test_expectations/angle_config.h b/src/tests/third_party/gpu_test_expectations/angle_config.h diff -u -rupN gpu_test_expectations_reverted/angle_config.h gpu_test_expectations/angle_config.h
new file mode 100644 --- gpu_test_expectations_reverted/angle_config.h 1969-12-31 19:00:00.000000000 -0500
index 0000000..7643346 +++ gpu_test_expectations/angle_config.h 2015-06-30 09:42:29.959897518 -0400
--- /dev/null @@ -0,0 +1,45 @@
+++ b/src/tests/third_party/gpu_test_expectations/angle_config.h
@@ -0,0 +1,39 @@
+// +//
+// Copyright 2015 The ANGLE Project Authors. All rights reserved. +// Copyright 2015 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be +// Use of this source code is governed by a BSD-style license that can be
...@@ -40,13 +38,18 @@ index 0000000..7643346 ...@@ -40,13 +38,18 @@ index 0000000..7643346
+using namespace angle; +using namespace angle;
+ +
+// TODO(jmadill): other platforms +// TODO(jmadill): other platforms
+#define OS_WIN +#if defined(_WIN32) || defined(_WIN64)
+# define OS_WIN
+#elif defined(__linux__)
+# define OS_LINUX
+#else
+# error "Unsupported platform"
+#endif
+ +
+#endif +#endif
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_info.cc b/src/tests/third_party/gpu_test_expectations/gpu_info.cc diff -u -rupN gpu_test_expectations_reverted/gpu_info.cc gpu_test_expectations/gpu_info.cc
index 85d26fb..c8e2988 100644 --- gpu_test_expectations_reverted/gpu_info.cc 2015-06-30 09:39:44.810612582 -0400
--- a/src/tests/third_party/gpu_test_expectations/gpu_info.cc +++ gpu_test_expectations/gpu_info.cc 2015-06-30 09:40:06.654788989 -0400
+++ b/src/tests/third_party/gpu_test_expectations/gpu_info.cc
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -56,7 +59,7 @@ index 85d26fb..c8e2988 100644 ...@@ -56,7 +59,7 @@ index 85d26fb..c8e2988 100644
namespace { namespace {
@@ -17,31 +17,6 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device, @@ -17,31 +17,6 @@ void EnumerateGPUDevice(const gpu::GPUIn
enumerator->EndGPUDevice(); enumerator->EndGPUDevice();
} }
...@@ -112,7 +115,7 @@ index 85d26fb..c8e2988 100644 ...@@ -112,7 +115,7 @@ index 85d26fb..c8e2988 100644
GPUDevice gpu; GPUDevice gpu;
std::vector<GPUDevice> secondary_gpus; std::vector<GPUDevice> secondary_gpus;
uint64 adapter_luid; uint64 adapter_luid;
@@ -109,14 +77,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { @@ -109,14 +77,6 @@ void GPUInfo::EnumerateFields(Enumerator
int process_crash_count; int process_crash_count;
CollectInfoResult basic_info_state; CollectInfoResult basic_info_state;
CollectInfoResult context_info_state; CollectInfoResult context_info_state;
...@@ -127,7 +130,7 @@ index 85d26fb..c8e2988 100644 ...@@ -127,7 +130,7 @@ index 85d26fb..c8e2988 100644
}; };
// If this assert fails then most likely something below needs to be updated. // If this assert fails then most likely something below needs to be updated.
@@ -134,15 +94,9 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { @@ -134,15 +94,9 @@ void GPUInfo::EnumerateFields(Enumerator
EnumerateGPUDevice(secondary_gpu, enumerator); EnumerateGPUDevice(secondary_gpu, enumerator);
enumerator->BeginAuxAttributes(); enumerator->BeginAuxAttributes();
...@@ -143,7 +146,7 @@ index 85d26fb..c8e2988 100644 ...@@ -143,7 +146,7 @@ index 85d26fb..c8e2988 100644
enumerator->AddInt64("adapterLuid", adapter_luid); enumerator->AddInt64("adapterLuid", adapter_luid);
enumerator->AddString("driverVendor", driver_vendor); enumerator->AddString("driverVendor", driver_vendor);
enumerator->AddString("driverVersion", driver_version); enumerator->AddString("driverVersion", driver_version);
@@ -168,14 +122,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { @@ -168,14 +122,6 @@ void GPUInfo::EnumerateFields(Enumerator
enumerator->AddInt("processCrashCount", process_crash_count); enumerator->AddInt("processCrashCount", process_crash_count);
enumerator->AddInt("basicInfoState", basic_info_state); enumerator->AddInt("basicInfoState", basic_info_state);
enumerator->AddInt("contextInfoState", context_info_state); enumerator->AddInt("contextInfoState", context_info_state);
...@@ -158,10 +161,9 @@ index 85d26fb..c8e2988 100644 ...@@ -158,10 +161,9 @@ index 85d26fb..c8e2988 100644
enumerator->EndAuxAttributes(); enumerator->EndAuxAttributes();
} }
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_info.h b/src/tests/third_party/gpu_test_expectations/gpu_info.h diff -u -rupN gpu_test_expectations_reverted/gpu_info.h gpu_test_expectations/gpu_info.h
index f377698..35e791e 100644 --- gpu_test_expectations_reverted/gpu_info.h 2015-06-30 09:39:44.806612549 -0400
--- a/src/tests/third_party/gpu_test_expectations/gpu_info.h +++ gpu_test_expectations/gpu_info.h 2015-06-30 09:40:06.654788989 -0400
+++ b/src/tests/third_party/gpu_test_expectations/gpu_info.h
@@ -11,13 +11,7 @@ @@ -11,13 +11,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -231,11 +233,11 @@ index f377698..35e791e 100644 ...@@ -231,11 +233,11 @@ index f377698..35e791e 100644
CollectInfoResult context_info_state; CollectInfoResult context_info_state;
-#if defined(OS_WIN) -#if defined(OS_WIN)
- CollectInfoResult dx_diagnostics_info_state; - CollectInfoResult dx_diagnostics_info_state;
-
- // The information returned by the DirectX Diagnostics Tool. - // The information returned by the DirectX Diagnostics Tool.
- DxDiagNode dx_diagnostics; - DxDiagNode dx_diagnostics;
-#endif -#endif
-
- VideoDecodeAcceleratorSupportedProfiles - VideoDecodeAcceleratorSupportedProfiles
- video_decode_accelerator_supported_profiles; - video_decode_accelerator_supported_profiles;
- VideoEncodeAcceleratorSupportedProfiles - VideoEncodeAcceleratorSupportedProfiles
...@@ -252,11 +254,10 @@ index f377698..35e791e 100644 ...@@ -252,11 +254,10 @@ index f377698..35e791e 100644
// Markers indicating that a GPUDevice is being described. // Markers indicating that a GPUDevice is being described.
virtual void BeginGPUDevice() = 0; virtual void BeginGPUDevice() = 0;
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc diff -u -rupN gpu_test_expectations_reverted/gpu_test_config.cc gpu_test_expectations/gpu_test_config.cc
index c062c4d..d9b0da2 100644 --- gpu_test_expectations_reverted/gpu_test_config.cc 2015-06-30 09:39:44.810612582 -0400
--- a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc +++ gpu_test_expectations/gpu_test_config.cc 2015-06-30 11:04:05.290002071 -0400
+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc @@ -2,20 +2,165 @@
@@ -2,24 +2,73 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -275,7 +276,15 @@ index c062c4d..d9b0da2 100644 ...@@ -275,7 +276,15 @@ index c062c4d..d9b0da2 100644
-#include "base/mac/mac_util.h" -#include "base/mac/mac_util.h"
-#elif defined(OS_WIN) -#elif defined(OS_WIN)
-#include "base/win/windows_version.h" -#include "base/win/windows_version.h"
-#endif +#if defined(OS_LINUX)
+extern "C" {
+# include <pci/pci.h>
+}
#endif
+using namespace gpu;
+
+#if defined(OS_WIN)
+// Disable the deprecated function warning for GetVersionEx +// Disable the deprecated function warning for GetVersionEx
+#pragma warning(disable: 4996) +#pragma warning(disable: 4996)
+ +
...@@ -296,11 +305,7 @@ index c062c4d..d9b0da2 100644 ...@@ -296,11 +305,7 @@ index c062c4d..d9b0da2 100644
+ *minor_version = version_info.dwMinorVersion; + *minor_version = version_info.dwMinorVersion;
+ *bugfix_version = version_info.dwBuildNumber; + *bugfix_version = version_info.dwBuildNumber;
+} +}
+
namespace gpu {
namespace {
+void DeviceIDToVendorAndDevice(const std::string& id, +void DeviceIDToVendorAndDevice(const std::string& id,
+ uint32* vendor_id, + uint32* vendor_id,
+ uint32* device_id) { + uint32* device_id) {
...@@ -338,10 +343,97 @@ index c062c4d..d9b0da2 100644 ...@@ -338,10 +343,97 @@ index c062c4d..d9b0da2 100644
+ return kCollectInfoNonFatalFailure; + return kCollectInfoNonFatalFailure;
+} +}
+ +
GPUTestConfig::OS GetCurrentOS() { +#endif // defined(OS_WIN)
#if defined(OS_CHROMEOS) +
return GPUTestConfig::kOsChromeOS; +#if defined(OS_LINUX)
@@ -282,21 +331,5 @@ bool GPUTestBotConfig::CurrentConfigMatches( +
+const uint32 kVendorIDIntel = 0x8086;
+const uint32 kVendorIDNVidia = 0x10de;
+const uint32 kVendorIDAMD = 0x1002;
+
+CollectInfoResult CollectPCIVideoCardInfo(GPUInfo* gpu_info) {
+ DCHECK(gpu_info);
+
+ struct pci_access* access = pci_alloc();
+ DCHECK(access != NULL);
+ pci_init(access);
+ pci_scan_bus(access);
+
+ bool primary_gpu_identified = false;
+ for (pci_dev* device = access->devices;
+ device != NULL; device = device->next) {
+ pci_fill_info(device, 33);
+ bool is_gpu = false;
+ switch (device->device_class) {
+ case PCI_CLASS_DISPLAY_VGA:
+ case PCI_CLASS_DISPLAY_XGA:
+ case PCI_CLASS_DISPLAY_3D:
+ is_gpu = true;
+ break;
+ case PCI_CLASS_DISPLAY_OTHER:
+ default:
+ break;
+ }
+ if (!is_gpu)
+ continue;
+ if (device->vendor_id == 0 || device->device_id == 0)
+ continue;
+
+ GPUInfo::GPUDevice gpu;
+ gpu.vendor_id = device->vendor_id;
+ gpu.device_id = device->device_id;
+
+ if (!primary_gpu_identified) {
+ primary_gpu_identified = true;
+ gpu_info->gpu = gpu;
+ } else {
+ // TODO(zmo): if there are multiple GPUs, we assume the non Intel
+ // one is primary. Revisit this logic because we actually don't know
+ // which GPU we are using at this point.
+ if (gpu_info->gpu.vendor_id == kVendorIDIntel &&
+ gpu.vendor_id != kVendorIDIntel) {
+ gpu_info->secondary_gpus.push_back(gpu_info->gpu);
+ gpu_info->gpu = gpu;
+ } else {
+ gpu_info->secondary_gpus.push_back(gpu);
+ }
+ }
+ }
+
+ // Detect Optimus or AMD Switchable GPU.
+ if (gpu_info->secondary_gpus.size() == 1 &&
+ gpu_info->secondary_gpus[0].vendor_id == kVendorIDIntel) {
+ if (gpu_info->gpu.vendor_id == kVendorIDNVidia)
+ gpu_info->optimus = true;
+ if (gpu_info->gpu.vendor_id == kVendorIDAMD)
+ gpu_info->amd_switchable = true;
+ }
+
+ pci_cleanup(access);
+ if (!primary_gpu_identified)
+ return kCollectInfoNonFatalFailure;
+ return kCollectInfoSuccess;
+}
+
+CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) {
+ DCHECK(vendor_id && device_id);
+ *vendor_id = 0;
+ *device_id = 0;
+
+ GPUInfo gpu_info;
+ CollectInfoResult result = CollectPCIVideoCardInfo(&gpu_info);
+ if (result == kCollectInfoSuccess) {
+ *vendor_id = gpu_info.gpu.vendor_id;
+ *device_id = gpu_info.gpu.device_id;
+ }
+ return result;
+}
+#endif // defined(OS_LINUX)
+
namespace gpu {
namespace {
@@ -282,21 +427,5 @@ bool GPUTestBotConfig::CurrentConfigMatc
return false; return false;
} }
...@@ -363,10 +455,9 @@ index c062c4d..d9b0da2 100644 ...@@ -363,10 +455,9 @@ index c062c4d..d9b0da2 100644
- -
} // namespace gpu } // namespace gpu
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config.h b/src/tests/third_party/gpu_test_expectations/gpu_test_config.h diff -u -rupN gpu_test_expectations_reverted/gpu_test_config.h gpu_test_expectations/gpu_test_config.h
index 8b184d3..e628886 100644 --- gpu_test_expectations_reverted/gpu_test_config.h 2015-06-30 09:39:44.810612582 -0400
--- a/src/tests/third_party/gpu_test_expectations/gpu_test_config.h +++ gpu_test_expectations/gpu_test_config.h 2015-06-30 09:40:06.654788989 -0400
+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config.h
@@ -8,9 +8,7 @@ @@ -8,9 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -378,7 +469,7 @@ index 8b184d3..e628886 100644 ...@@ -378,7 +469,7 @@ index 8b184d3..e628886 100644
namespace gpu { namespace gpu {
@@ -118,9 +116,6 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig { @@ -118,9 +116,6 @@ class GPU_EXPORT GPUTestBotConfig : publ
// Check if this bot's config matches |config_data| or any of the |configs|. // Check if this bot's config matches |config_data| or any of the |configs|.
static bool CurrentConfigMatches(const std::string& config_data); static bool CurrentConfigMatches(const std::string& config_data);
static bool CurrentConfigMatches(const std::vector<std::string>& configs); static bool CurrentConfigMatches(const std::vector<std::string>& configs);
...@@ -388,10 +479,9 @@ index 8b184d3..e628886 100644 ...@@ -388,10 +479,9 @@ index 8b184d3..e628886 100644
}; };
} // namespace gpu } // namespace gpu
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc diff -u -rupN gpu_test_expectations_reverted/gpu_test_expectations_parser.cc gpu_test_expectations/gpu_test_expectations_parser.cc
index 8b3584a..d6ba5c3 100644 --- gpu_test_expectations_reverted/gpu_test_expectations_parser.cc 2015-06-30 09:39:44.810612582 -0400
--- a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc +++ gpu_test_expectations/gpu_test_expectations_parser.cc 2015-06-30 09:40:06.654788989 -0400
+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc
@@ -2,14 +2,35 @@ @@ -2,14 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -435,7 +525,7 @@ index 8b3584a..d6ba5c3 100644 ...@@ -435,7 +525,7 @@ index 8b3584a..d6ba5c3 100644
namespace gpu { namespace gpu {
@@ -161,10 +182,10 @@ bool NamesMatching(const std::string& ref, const std::string& test_name) { @@ -161,10 +182,10 @@ bool NamesMatching(const std::string& re
GPUTestExpectationsParser::GPUTestExpectationsParser() { GPUTestExpectationsParser::GPUTestExpectationsParser() {
// Some sanity check. // Some sanity check.
...@@ -450,7 +540,7 @@ index 8b3584a..d6ba5c3 100644 ...@@ -450,7 +540,7 @@ index 8b3584a..d6ba5c3 100644
} }
GPUTestExpectationsParser::~GPUTestExpectationsParser() { GPUTestExpectationsParser::~GPUTestExpectationsParser() {
@@ -189,8 +210,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) { @@ -189,8 +210,8 @@ bool GPUTestExpectationsParser::LoadTest
return rt; return rt;
} }
...@@ -461,7 +551,7 @@ index 8b3584a..d6ba5c3 100644 ...@@ -461,7 +551,7 @@ index 8b3584a..d6ba5c3 100644
entries_.clear(); entries_.clear();
error_messages_.clear(); error_messages_.clear();
@@ -370,7 +391,7 @@ bool GPUTestExpectationsParser::ParseLine( @@ -370,7 +391,7 @@ bool GPUTestExpectationsParser::ParseLin
stage++; stage++;
break; break;
default: default:
...@@ -470,7 +560,7 @@ index 8b3584a..d6ba5c3 100644 ...@@ -470,7 +560,7 @@ index 8b3584a..d6ba5c3 100644
break; break;
} }
} }
@@ -446,7 +467,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig( @@ -446,7 +467,7 @@ bool GPUTestExpectationsParser::UpdateTe
config->build_type() | kTokenData[token].flag); config->build_type() | kTokenData[token].flag);
break; break;
default: default:
...@@ -479,10 +569,9 @@ index 8b3584a..d6ba5c3 100644 ...@@ -479,10 +569,9 @@ index 8b3584a..d6ba5c3 100644
break; break;
} }
return true; return true;
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h diff -u -rupN gpu_test_expectations_reverted/gpu_test_expectations_parser.h gpu_test_expectations/gpu_test_expectations_parser.h
index a69f7e9..a112700 100644 --- gpu_test_expectations_reverted/gpu_test_expectations_parser.h 2015-06-30 09:39:44.810612582 -0400
--- a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h +++ gpu_test_expectations/gpu_test_expectations_parser.h 2015-06-30 09:40:06.654788989 -0400
+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h
@@ -8,10 +8,8 @@ @@ -8,10 +8,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -496,7 +585,7 @@ index a69f7e9..a112700 100644 ...@@ -496,7 +585,7 @@ index a69f7e9..a112700 100644
namespace gpu { namespace gpu {
@@ -32,7 +30,7 @@ class GPU_EXPORT GPUTestExpectationsParser { @@ -32,7 +30,7 @@ class GPU_EXPORT GPUTestExpectationsPars
// save all the entries. Otherwise, generate error messages. // save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds. // Return true if parsing succeeds.
bool LoadTestExpectations(const std::string& data); bool LoadTestExpectations(const std::string& data);
...@@ -505,3 +594,18 @@ index a69f7e9..a112700 100644 ...@@ -505,3 +594,18 @@ index a69f7e9..a112700 100644
// Query error messages from the last LoadTestExpectations() call. // Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string>& GetErrorMessages() const; const std::vector<std::string>& GetErrorMessages() const;
diff -u -rupN gpu_test_expectations_reverted/HowToMakeChanges.md gpu_test_expectations/HowToMakeChanges.md
--- gpu_test_expectations_reverted/HowToMakeChanges.md 1969-12-31 19:00:00.000000000 -0500
+++ gpu_test_expectations/HowToMakeChanges.md 2015-06-30 11:30:57.871197838 -0400
@@ -0,0 +1,11 @@
+Because the ```gpu_test_expectations``` directory is based on parts of Chromium's ```gpu/config``
+directory, we want to keep a patch of the changes added to make it compile with ANGLE. This
+will allow us to merge Chromium changes easily in our ```gpu_test_expectations```.
+
+In order to make a change to this directory, do the following:
+ - copy the directory somewhere like in ```gpu_test_expectations_reverted```
+ - in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R angle-mods.patch```
+ - do your changes in ```gpu_test_expectations```
+ - delete angle-mods.path in both directories
+ - run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
+ - copy ```angle-mods.patch``` in ```gpu_test_expectations```
...@@ -34,6 +34,12 @@ typedef uint64_t uint64; ...@@ -34,6 +34,12 @@ typedef uint64_t uint64;
using namespace angle; using namespace angle;
// TODO(jmadill): other platforms // TODO(jmadill): other platforms
#define OS_WIN #if defined(_WIN32) || defined(_WIN64)
# define OS_WIN
#elif defined(__linux__)
# define OS_LINUX
#else
# error "Unsupported platform"
#endif
#endif #endif
...@@ -7,6 +7,15 @@ ...@@ -7,6 +7,15 @@
#include "gpu_info.h" #include "gpu_info.h"
#include "gpu_test_expectations_parser.h" #include "gpu_test_expectations_parser.h"
#if defined(OS_LINUX)
extern "C" {
# include <pci/pci.h>
}
#endif
using namespace gpu;
#if defined(OS_WIN)
// Disable the deprecated function warning for GetVersionEx // Disable the deprecated function warning for GetVersionEx
#pragma warning(disable: 4996) #pragma warning(disable: 4996)
...@@ -28,10 +37,6 @@ void SysInfo::OperatingSystemVersionNumbers( ...@@ -28,10 +37,6 @@ void SysInfo::OperatingSystemVersionNumbers(
*bugfix_version = version_info.dwBuildNumber; *bugfix_version = version_info.dwBuildNumber;
} }
namespace gpu {
namespace {
void DeviceIDToVendorAndDevice(const std::string& id, void DeviceIDToVendorAndDevice(const std::string& id,
uint32* vendor_id, uint32* vendor_id,
uint32* device_id) { uint32* device_id) {
...@@ -69,6 +74,97 @@ CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) { ...@@ -69,6 +74,97 @@ CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) {
return kCollectInfoNonFatalFailure; return kCollectInfoNonFatalFailure;
} }
#endif // defined(OS_WIN)
#if defined(OS_LINUX)
const uint32 kVendorIDIntel = 0x8086;
const uint32 kVendorIDNVidia = 0x10de;
const uint32 kVendorIDAMD = 0x1002;
CollectInfoResult CollectPCIVideoCardInfo(GPUInfo* gpu_info) {
DCHECK(gpu_info);
struct pci_access* access = pci_alloc();
DCHECK(access != NULL);
pci_init(access);
pci_scan_bus(access);
bool primary_gpu_identified = false;
for (pci_dev* device = access->devices;
device != NULL; device = device->next) {
pci_fill_info(device, 33);
bool is_gpu = false;
switch (device->device_class) {
case PCI_CLASS_DISPLAY_VGA:
case PCI_CLASS_DISPLAY_XGA:
case PCI_CLASS_DISPLAY_3D:
is_gpu = true;
break;
case PCI_CLASS_DISPLAY_OTHER:
default:
break;
}
if (!is_gpu)
continue;
if (device->vendor_id == 0 || device->device_id == 0)
continue;
GPUInfo::GPUDevice gpu;
gpu.vendor_id = device->vendor_id;
gpu.device_id = device->device_id;
if (!primary_gpu_identified) {
primary_gpu_identified = true;
gpu_info->gpu = gpu;
} else {
// TODO(zmo): if there are multiple GPUs, we assume the non Intel
// one is primary. Revisit this logic because we actually don't know
// which GPU we are using at this point.
if (gpu_info->gpu.vendor_id == kVendorIDIntel &&
gpu.vendor_id != kVendorIDIntel) {
gpu_info->secondary_gpus.push_back(gpu_info->gpu);
gpu_info->gpu = gpu;
} else {
gpu_info->secondary_gpus.push_back(gpu);
}
}
}
// Detect Optimus or AMD Switchable GPU.
if (gpu_info->secondary_gpus.size() == 1 &&
gpu_info->secondary_gpus[0].vendor_id == kVendorIDIntel) {
if (gpu_info->gpu.vendor_id == kVendorIDNVidia)
gpu_info->optimus = true;
if (gpu_info->gpu.vendor_id == kVendorIDAMD)
gpu_info->amd_switchable = true;
}
pci_cleanup(access);
if (!primary_gpu_identified)
return kCollectInfoNonFatalFailure;
return kCollectInfoSuccess;
}
CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) {
DCHECK(vendor_id && device_id);
*vendor_id = 0;
*device_id = 0;
GPUInfo gpu_info;
CollectInfoResult result = CollectPCIVideoCardInfo(&gpu_info);
if (result == kCollectInfoSuccess) {
*vendor_id = gpu_info.gpu.vendor_id;
*device_id = gpu_info.gpu.device_id;
}
return result;
}
#endif // defined(OS_LINUX)
namespace gpu {
namespace {
GPUTestConfig::OS GetCurrentOS() { GPUTestConfig::OS GetCurrentOS() {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
return GPUTestConfig::kOsChromeOS; return GPUTestConfig::kOsChromeOS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment