1 | /* |
---|---|
2 | * Copyright 2020 Google LLC |
3 | * |
4 | * Use of this source code is governed by a BSD-style license that can be |
5 | * found in the LICENSE file. |
6 | */ |
7 | |
8 | #include "src/gpu/GrUtil.h" |
9 | |
10 | GrIntelGpuFamily GrGetIntelGpuFamily(uint32_t deviceID) { |
11 | // https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units |
12 | uint32_t maskedID = deviceID & 0xFF00; |
13 | switch (maskedID) { |
14 | case 0x0100: |
15 | switch (deviceID & 0xFFF0) { |
16 | case 0x0100: |
17 | case 0x0110: |
18 | case 0x0120: |
19 | return kSandyBridge_IntelGpuFamily; |
20 | case 0x0150: |
21 | if (deviceID == 0x0155 || deviceID == 0x0157) { |
22 | return kValleyView_IntelGpuFamily; |
23 | } |
24 | if (deviceID == 0x0152 || deviceID == 0x015A) { |
25 | return kIvyBridge_IntelGpuFamily; |
26 | } |
27 | break; |
28 | case 0x0160: |
29 | return kIvyBridge_IntelGpuFamily; |
30 | default: |
31 | break; |
32 | } |
33 | break; |
34 | case 0x0F00: |
35 | return kValleyView_IntelGpuFamily; |
36 | case 0x0400: |
37 | case 0x0A00: |
38 | case 0x0D00: |
39 | return kHaswell_IntelGpuFamily; |
40 | case 0x2200: |
41 | return kCherryView_IntelGpuFamily; |
42 | case 0x1600: |
43 | return kBroadwell_IntelGpuFamily; |
44 | case 0x5A00: |
45 | return kApolloLake_IntelGpuFamily; |
46 | case 0x1900: |
47 | return kSkyLake_IntelGpuFamily; |
48 | case 0x3100: |
49 | return kGeminiLake_IntelGpuFamily; |
50 | case 0x5900: |
51 | return kKabyLake_IntelGpuFamily; |
52 | case 0x3E00: |
53 | return kCoffeeLake_IntelGpuFamily; |
54 | case 0x8A00: |
55 | return kIceLake_IntelGpuFamily; |
56 | default: |
57 | break; |
58 | } |
59 | return kUnknown_IntelGpuFamily; |
60 | } |
61 |