Added Qualcomm ACPI vendor id support
Currently Dawn only support PCI id, meaning that functions like Is_Qualcomm(PCIVendorID vendorId, PCIDeviceID deviceId)
won't work for devices using ACPI id since the function is comparing the input ACPI id with its PCI id.
Note that not only the vendor ID differs between PCI and ACPI, but the device ID will also vary for the same GPU.
It is worth noting that unlike PCI device id, there is no mapping pattern between ACPI device id and the architecture.
This change added a new Qualcomm ACPI entry to gpu_info.json.
Bug: 42241431
Change-Id: I2478dc4a60baf7fb21c7600a76a91413c56363e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/202258
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
diff --git a/generator/dawn_gpu_info_generator.py b/generator/dawn_gpu_info_generator.py
index 4d196c7..8ad39bb 100644
--- a/generator/dawn_gpu_info_generator.py
+++ b/generator/dawn_gpu_info_generator.py
@@ -147,8 +147,12 @@
class Vendor:
def __init__(self, name, json_data):
self.name = Name(name)
+ self.name_override = None
self.id = json_data['id']
+ if 'name_override' in json_data:
+ self.name_override = Name(json_data['name_override'])
+
architecture_dict = {}
internal_architecture_dict = {}
diff --git a/generator/templates/dawn/common/GPUInfo.cpp b/generator/templates/dawn/common/GPUInfo.cpp
index 5e82d68..2f1778c 100644
--- a/generator/templates/dawn/common/GPUInfo.cpp
+++ b/generator/templates/dawn/common/GPUInfo.cpp
@@ -141,7 +141,12 @@
std::string GetVendorName(PCIVendorID vendorId) {
switch(vendorId) {
{% for vendor in vendors %}
- case kVendorID_{{vendor.name.CamelCase()}}: return "{{vendor.name.js_enum_case()}}";
+ case kVendorID_{{vendor.name.CamelCase()}}:
+ {% if vendor.name_override %}
+ return "{{vendor.name_override.js_enum_case()}}";
+ {% else %}
+ return "{{vendor.name.js_enum_case()}}";
+ {% endif %}
{% endfor %}
}
diff --git a/src/dawn/gpu_info.json b/src/dawn/gpu_info.json
index 2aa7c49..2617f1d 100644
--- a/src/dawn/gpu_info.json
+++ b/src/dawn/gpu_info.json
@@ -220,7 +220,8 @@
}]
},
- "Qualcomm": {
+ "Qualcomm_PCI": {
+ "name_override": "Qualcomm",
"id": "0x5143",
"devices": [{
@@ -234,6 +235,11 @@
}]
},
+ "Qualcomm_ACPI": {
+ "name_override": "Qualcomm",
+ "id": "0x4D4F4351"
+ },
+
"Samsung": {
"id": "0x144d",
diff --git a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
index bb361d8..70f2a6b 100644
--- a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
+++ b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
@@ -241,7 +241,7 @@
// Max number of "constants" where each constant is a 16-byte float4
limits->v1.maxUniformBufferBindingSize = D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * 16;
- if (gpu_info::IsQualcomm(GetVendorId())) {
+ if (gpu_info::IsQualcomm_ACPI(GetVendorId())) {
// limit of number of texels in a buffer == (1 << 27)
// D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP
// This limit doesn't apply to a raw buffer, but only applies to
diff --git a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
index 64231d6..ffc39e3 100644
--- a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
+++ b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
@@ -353,7 +353,7 @@
// Max number of "constants" where each constant is a 16-byte float4
limits->v1.maxUniformBufferBindingSize = D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * 16;
- if (gpu_info::IsQualcomm(GetVendorId())) {
+ if (gpu_info::IsQualcomm_ACPI(GetVendorId())) {
// limit of number of texels in a buffer == (1 << 27)
// D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP
// This limit doesn't apply to a raw buffer, but only applies to
diff --git a/src/dawn/native/opengl/PhysicalDeviceGL.cpp b/src/dawn/native/opengl/PhysicalDeviceGL.cpp
index da5a2aa..afad987 100644
--- a/src/dawn/native/opengl/PhysicalDeviceGL.cpp
+++ b/src/dawn/native/opengl/PhysicalDeviceGL.cpp
@@ -55,7 +55,7 @@
{"Imagination", gpu_info::kVendorID_ImgTec},
{"Intel", gpu_info::kVendorID_Intel},
{"NVIDIA", gpu_info::kVendorID_Nvidia},
- {"Qualcomm", gpu_info::kVendorID_Qualcomm}};
+ {"Qualcomm", gpu_info::kVendorID_Qualcomm_PCI}};
uint32_t GetVendorIdFromVendors(const char* vendor) {
uint32_t vendorId = 0;
diff --git a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
index 4d060ae..f990277 100644
--- a/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
+++ b/src/dawn/native/vulkan/PhysicalDeviceVk.cpp
@@ -830,7 +830,7 @@
// Android devices with Qualcomm GPUs have a myriad of known issues. (dawn:1549)
bool PhysicalDevice::IsAndroidQualcomm() const {
#if DAWN_PLATFORM_IS(ANDROID)
- return gpu_info::IsQualcomm(GetVendorId());
+ return gpu_info::IsQualcomm_PCI(GetVendorId());
#else
return false;
#endif
diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp
index b6547bf..7848458 100644
--- a/src/dawn/tests/DawnTest.cpp
+++ b/src/dawn/tests/DawnTest.cpp
@@ -874,7 +874,8 @@
}
bool DawnTestBase::IsQualcomm() const {
- return gpu_info::IsQualcomm(mParam.adapterProperties.vendorID);
+ return gpu_info::IsQualcomm_PCI(mParam.adapterProperties.vendorID) ||
+ gpu_info::IsQualcomm_ACPI(mParam.adapterProperties.vendorID);
}
bool DawnTestBase::IsSwiftshader() const {
diff --git a/src/dawn/tests/end2end/SubgroupsTests.cpp b/src/dawn/tests/end2end/SubgroupsTests.cpp
index ec15aa2..bb83ddf 100644
--- a/src/dawn/tests/end2end/SubgroupsTests.cpp
+++ b/src/dawn/tests/end2end/SubgroupsTests.cpp
@@ -501,8 +501,8 @@
// TODO(351745820): Suppress the test for Qualcomm Adreno 6xx until we figure out why creating
// compute pipeline with subgroupBroadcast shader fails on trybots using these devices.
- DAWN_SUPPRESS_TEST_IF(gpu_info::IsQualcommAdreno6xx(GetParam().adapterProperties.vendorID,
- GetParam().adapterProperties.deviceID));
+ DAWN_SUPPRESS_TEST_IF(gpu_info::IsQualcomm_PCIAdreno6xx(GetParam().adapterProperties.vendorID,
+ GetParam().adapterProperties.deviceID));
for (uint32_t workgroupSize : {1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128, 255, 256}) {
TestBroadcastSubgroupSize(workgroupSize);