Commit 5200de26 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Gpu tests: Allow zero device ID on in Mac GPUTestBotConfig::IsValid

The ARM DTK does not specify a PCI device ID for the GPU. Do not fail
in this configuration.

Bug: 1121672
Change-Id: Idf2d35ed7ff15d43c300203160cec6a74a31d5ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427567Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810321}
parent 790bea2c
...@@ -239,8 +239,12 @@ bool GPUTestBotConfig::IsValid() const { ...@@ -239,8 +239,12 @@ bool GPUTestBotConfig::IsValid() const {
} }
if (gpu_vendor().size() != 1 || gpu_vendor()[0] == 0) if (gpu_vendor().size() != 1 || gpu_vendor()[0] == 0)
return false; return false;
if (gpu_device_id() == 0) if (!(os() & gpu::GPUTestConfig::kOsMac)) {
return false; // ARM-based Mac GPUs do not have valid PCI device IDs.
// https://crbug.com/1110421
if (gpu_device_id() == 0)
return false;
}
switch (build_type()) { switch (build_type()) {
case kBuildTypeRelease: case kBuildTypeRelease:
case kBuildTypeDebug: case kBuildTypeDebug:
......
...@@ -66,8 +66,13 @@ TEST_F(GPUTestConfigTest, IsValid) { ...@@ -66,8 +66,13 @@ TEST_F(GPUTestConfigTest, IsValid) {
config.AddGPUVendor(0x10de); config.AddGPUVendor(0x10de);
EXPECT_TRUE(config.IsValid()); EXPECT_TRUE(config.IsValid());
// Device ID of 0 is valid only on macOS.
config.set_gpu_device_id(0); config.set_gpu_device_id(0);
config.set_os(GPUTestConfig::kOsMacBigSur);
EXPECT_TRUE(config.IsValid());
config.set_os(GPUTestConfig::kOsWin7);
EXPECT_FALSE(config.IsValid()); EXPECT_FALSE(config.IsValid());
config.set_gpu_device_id(0x0640); config.set_gpu_device_id(0x0640);
EXPECT_TRUE(config.IsValid()); EXPECT_TRUE(config.IsValid());
......
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