Commit cf881af3 authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

In gpu control list, it's a match if device revision is not specified.

If an entry specify a device without revision number, then any revision
numbers should be considered a match.

Currently we always compare the numbers. When unspecified, revision
defaults to 0, so all devices end up as no match.

BUG=1093625
TEST=gpu_unittests
R=liberato@chromium.org

Change-Id: I146b0e725ebf3bf8aa22998011d98e77c773160f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2265237Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782124}
parent 1d95d5ad
......@@ -448,7 +448,7 @@ bool GpuControlList::Conditions::Contains(OsType target_os_type,
device_id != candidate.device_id)
continue;
#if defined(OS_WIN)
if (revision != candidate.revision)
if (revision && revision != candidate.revision)
continue;
#endif // OS_WIN
found = true;
......
......@@ -1174,6 +1174,20 @@ TEST_F(GpuControlListEntryTest, DeviceRevisionEntry) {
gpu_info.gpu.revision = 0xE3;
EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
}
TEST_F(GpuControlListEntryTest, DeviceRevisionUnspecifiedEntry) {
const Entry& entry =
GetEntry(kGpuControlListEntryTest_DeviceRevisionUnspecifiedEntry);
GPUInfo gpu_info;
gpu_info.gpu.vendor_id = 0x1002;
gpu_info.gpu.device_id = 0x15DD;
gpu_info.gpu.revision = 0x86;
EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.revision = 0x91;
EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.revision = 0x0;
EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
}
#endif // OS_WIN
} // namespace gpu
......@@ -977,6 +977,18 @@
"features": [
"test_feature_0"
]
},
{
"id": 79,
"description": "GpuControlListEntryTest.DeviceRevisionUnspecifiedEntry",
"os": {
"type": "win"
},
"vendor_id": "0x1002",
"device_id": ["0x15D8", "0x15DD"],
"features": [
"test_feature_0"
]
}
]
}
......@@ -2425,6 +2425,34 @@ const GpuControlList::More kMoreForEntry78_1440601243Exception1 = {
GpuControlList::kDontCare, // subpixel_font_rendering
};
const int kFeatureListForGpuControlTestingEntry79[1] = {
TEST_FEATURE_0,
};
const GpuControlList::Device kDevicesForGpuControlTestingEntry79[2] = {
{0x15D8, 0x0},
{0x15DD, 0x0},
};
const GpuControlList::More kMoreForEntry79_1440601243 = {
GpuControlList::kGLTypeNone, // gl_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // gl_version
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // pixel_shader_version
false, // in_process_gpu
0, // gl_reset_notification_strategy
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // direct_rendering_version
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr, nullptr}, // gpu_count
GpuControlList::kDontCare, // hardware_overlay
0, // test_group
GpuControlList::kDontCare, // subpixel_font_rendering
};
} // namespace gpu
#endif // GPU_CONFIG_GPU_CONTROL_LIST_TESTING_ARRAYS_AND_STRUCTS_AUTOGEN_H_
......@@ -2669,6 +2669,40 @@ const GpuControlList::Entry kGpuControlListTestingEntries[] = {
base::size(kExceptionsForEntry78), // exceptions count
kExceptionsForEntry78, // exceptions
},
{
79, // id
"GpuControlListEntryTest.DeviceRevisionUnspecifiedEntry",
base::size(kFeatureListForGpuControlTestingEntry79), // features size
kFeatureListForGpuControlTestingEntry79, // features
0, // DisabledExtensions size
nullptr, // DisabledExtensions
0, // DisabledWebGLExtensions size
nullptr, // DisabledWebGLExtensions
0, // CrBugs size
nullptr, // CrBugs
{
GpuControlList::kOsWin, // os_type
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // os_version
0x1002, // vendor_id
base::size(kDevicesForGpuControlTestingEntry79), // Devices size
kDevicesForGpuControlTestingEntry79, // Devices
GpuControlList::kMultiGpuCategoryNone, // multi_gpu_category
GpuControlList::kMultiGpuStyleNone, // multi_gpu_style
nullptr, // driver info
nullptr, // GL strings
nullptr, // machine model info
0, // intel_gpu_series size
nullptr, // intel_gpu_series
{GpuControlList::kUnknown, GpuControlList::kVersionStyleNumerical,
GpuControlList::kVersionSchemaCommon, nullptr,
nullptr}, // intel_gpu_generation
&kMoreForEntry79_1440601243, // more data
},
0, // exceptions count
nullptr, // exceptions
},
};
const size_t kGpuControlListTestingEntryCount = 78;
const size_t kGpuControlListTestingEntryCount = 79;
} // namespace gpu
......@@ -91,6 +91,7 @@ enum GpuControlListTestingEntryEnum {
kGpuControlListEntryTest_IntelDriverVersionEntry = 75,
kGpuControlListEntryTest_IntelOldDriverVersionEntry = 76,
kGpuControlListEntryTest_DeviceRevisionEntry = 77,
kGpuControlListEntryTest_DeviceRevisionUnspecifiedEntry = 78,
};
} // namespace gpu
......
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