Hash :
7b4e00d2
Author :
Date :
2017-02-08T10:43:47
gpu_info_util: Implement GetSystemInfo on Linux BUG=angleproject:1874 Change-Id: Id39c26b806e6a7937517235afe0ca60f5087df5b Reviewed-on: https://chromium-review.googlesource.com/438940 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
//
// Copyright (c) 2013-2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// SystemInfo.h: gathers information available without starting a GPU driver.
#ifndef GPU_INFO_UTIL_SYSTEM_INFO_H_
#define GPU_INFO_UTIL_SYSTEM_INFO_H_
#include <cstdint>
#include <string>
#include <vector>
namespace angle
{
struct GPUDeviceInfo
{
uint32_t vendorId;
uint32_t deviceId;
std::string driverVendor;
std::string driverVersion;
std::string driverDate;
};
struct SystemInfo
{
std::vector<GPUDeviceInfo> gpus;
int primaryGPUIndex;
bool isOptimus;
bool isAMDSwitchable;
std::string machineModelName;
};
bool GetSystemInfo(SystemInfo *info);
enum VendorID : uint32_t
{
VENDOR_ID_UNKNOWN = 0x0,
VENDOR_ID_AMD = 0x1002,
VENDOR_ID_INTEL = 0x8086,
VENDOR_ID_NVIDIA = 0x10DE,
// This is Qualcomm PCI Vendor ID.
// Android doesn't have a PCI bus, but all we need is a unique id.
VENDOR_ID_QUALCOMM = 0x5143,
};
bool IsAMD(uint32_t vendorId);
bool IsIntel(uint32_t vendorId);
bool IsNvidia(uint32_t vendorId);
bool IsQualcomm(uint32_t vendorId);
} // namespace angle
#endif // GPU_INFO_UTIL_SYSTEM_INFO_H_