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```
...@@ -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