1 // 2 // Copyright 2013 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // SystemInfo_internal.h: Functions used by the SystemInfo_* files and unittests 8 9 #ifndef GPU_INFO_UTIL_SYSTEM_INFO_INTERNAL_H_ 10 #define GPU_INFO_UTIL_SYSTEM_INFO_INTERNAL_H_ 11 12 #include "common/platform.h" 13 #include "gpu_info_util/SystemInfo.h" 14 15 namespace angle 16 { 17 18 // Defined in SystemInfo_libpci when GPU_INFO_USE_LIBPCI is defined. 19 bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices); 20 // Defined in SystemInfo_x11 when GPU_INFO_USE_X11 is defined. 21 bool GetNvidiaDriverVersionWithXNVCtrl(std::string *version); 22 23 // Target specific helper functions that can be compiled on all targets 24 // Live in SystemInfo.cpp 25 bool ParseAMDBrahmaDriverVersion(const std::string &content, std::string *version); 26 bool ParseAMDCatalystDriverVersion(const std::string &content, std::string *version); 27 bool ParseMacMachineModel(const std::string &identifier, 28 std::string *type, 29 int32_t *major, 30 int32_t *minor); 31 bool CMDeviceIDToDeviceAndVendorID(const std::string &id, uint32_t *vendorId, uint32_t *deviceId); 32 33 #if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST) 34 bool GetSystemInfo_mac(SystemInfo *info); 35 #else 36 bool GetSystemInfo_ios(SystemInfo *info); 37 #endif 38 39 #if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST) 40 // Helper to get the active GPU ID from a given Core Graphics display ID. 41 uint64_t GetGpuIDFromDisplayID(uint32_t displayID); 42 43 // Helper to get the active GPU ID from an OpenGL display mask. 44 uint64_t GetGpuIDFromOpenGLDisplayMask(uint32_t displayMask); 45 46 // Get VendorID from metal device's registry ID 47 VendorID GetVendorIDFromMetalDeviceRegistryID(uint64_t registryID); 48 #endif 49 50 } // namespace angle 51 52 #endif // GPU_INFO_UTIL_SYSTEM_INFO_INTERNAL_H_ 53