Skip to content

Commit

Permalink
Distinguish Intel GPU newer and older driver in GpuControlList.
Browse files Browse the repository at this point in the history
According to
https://www.intel.com/content/www/us/en/support/articles/000005654/graphics.html,
newer Intel Graphics Driver version schema uses 100+ build number,
while older schema sticks to 100- build number. We need to keep the
driver version comparison inside the same category.

Bug: None
Change-Id: I15a07e9f6de1958d8b7afa0f276fbd6e3eca6c6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3300439
Reviewed-by: Maggie Chen <magchen@chromium.org>
Commit-Queue: Chunbo Hua <chunbo.hua@intel.com>
Cr-Commit-Position: refs/heads/main@{#946256}
  • Loading branch information
HuaChunbo authored and Chromium LUCI CQ committed Nov 30, 2021
1 parent cc65e2b commit 9baab1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions gpu/config/gpu_control_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ bool GpuControlList::Version::Contains(const std::string& version_string,
if (op == kBetween)
ref_version2.erase(ref_version2.begin());
}

// No comparison should be run if two being-compared versions do not match
// Intel driver version schema.
if (Version::Compare({version[0]}, {"100"}, style) >= 0) {
if ((Version::Compare({ref_version1[0]}, {"100"}, style) < 0) ||
(op == kBetween
? Version::Compare({ref_version2[0]}, {"100"}, style) < 0
: false))
return false;
} else if ((Version::Compare({ref_version1[0]}, {"100"}, style) >= 0) ||
(op == kBetween
? Version::Compare({ref_version2[0]}, {"100"}, style) >= 0
: false)) {
return false;
}
} else if (schema == kVersionSchemaNvidiaDriver) {
// The driver version we get from the os is "XX.XX.XXXA.BBCC", while the
// workaround is of the form "ABB.CC". Drop the first two stanzas from the
Expand Down
2 changes: 1 addition & 1 deletion gpu/config/gpu_control_list_entry_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ TEST_F(GpuControlListEntryTest, IntelDriverVersionEntry) {
gpu_info.gpu.driver_version = "25.20.100.6000";
EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.driver_version = "24.20.99.6000";
EXPECT_TRUE(entry.Contains(kOsWin, "", gpu_info));
EXPECT_FALSE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.driver_version = "24.20.101.6000";
EXPECT_FALSE(entry.Contains(kOsWin, "", gpu_info));
gpu_info.gpu.driver_version = "25.20.100.7000";
Expand Down

0 comments on commit 9baab1f

Please sign in to comment.