Extend Intel graphics driver version to 2 fields

The 4th field of Intel new graphics driver will overflow soon. For
example, the lastest driver version is 27.20.100.9466 and the 4th field,
9466, will meet the maximum 9999 soon. Future driver will bump the 3rd
field from 100 to 101. This CL extends driver version check from 4th
field to both 3rd and 4th fields.
Check below 2 documents for more details.
https://www.intel.com/content/www/us/en/support/articles/000005654/graphics.html
https://docs.google.com/document/d/1Xm4afyGR3Ow3W2G-uig9fLQR01XzmSXeanM9OXDVhlg/edit#heading=h.k8onwbxk2ig

Bug: None
Change-Id: I0ce59ca81b1edd4c63b9f3b0128788c2bf6ade17
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57180
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Yang Gu
2021-07-07 08:58:01 +00:00
committed by Dawn LUCI CQ
parent 4a811043cc
commit c45c7a415c
4 changed files with 48 additions and 20 deletions

View File

@@ -0,0 +1,29 @@
// Copyright 2021 The Dawn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <gtest/gtest.h>
#include "common/GPUInfo.h"
namespace {
const PCIVendorID vendorID = 0x8086;
const gpu_info::D3DDriverVersion version1 = {21, 20, 16, 5077};
const gpu_info::D3DDriverVersion version2 = {27, 20, 100, 9946};
const gpu_info::D3DDriverVersion version3 = {27, 20, 101, 2003};
} // anonymous namespace
TEST(GPUInfo, CompareD3DDriverVersion) {
EXPECT_EQ(gpu_info::CompareD3DDriverVersion(vendorID, version1, version2), -1);
EXPECT_EQ(gpu_info::CompareD3DDriverVersion(vendorID, version2, version3), -1);
}