1
- // Copyright 2020 Intel Corporation. All Rights Reserved.
1
+ // Copyright 2020-2021 Intel Corporation. All Rights Reserved.
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -58,6 +58,8 @@ func getTestCases() []testcase {
58
58
"gpu.intel.com/platform_new.count" : "1" ,
59
59
"gpu.intel.com/platform_new.present" : "true" ,
60
60
"gpu.intel.com/platform_new.tiles" : "1" ,
61
+ "gpu.intel.com/graphics_version" : "9" ,
62
+ "gpu.intel.com/media_version" : "9" ,
61
63
"gpu.intel.com/platform_gen" : "9" ,
62
64
"gpu.intel.com/cards" : "card0" ,
63
65
},
@@ -104,6 +106,8 @@ func getTestCases() []testcase {
104
106
"gpu.intel.com/platform_new.count" : "1" ,
105
107
"gpu.intel.com/platform_new.present" : "true" ,
106
108
"gpu.intel.com/platform_new.tiles" : "2" ,
109
+ "gpu.intel.com/graphics_version" : "9" ,
110
+ "gpu.intel.com/media_version" : "9" ,
107
111
"gpu.intel.com/platform_gen" : "9" ,
108
112
"gpu.intel.com/cards" : "card0" ,
109
113
},
@@ -132,6 +136,8 @@ func getTestCases() []testcase {
132
136
"gpu.intel.com/platform_new.count" : "1" ,
133
137
"gpu.intel.com/platform_new.present" : "true" ,
134
138
"gpu.intel.com/platform_new.tiles" : "1" ,
139
+ "gpu.intel.com/graphics_version" : "9" ,
140
+ "gpu.intel.com/media_version" : "9" ,
135
141
"gpu.intel.com/platform_gen" : "9" ,
136
142
"gpu.intel.com/cards" : "card0" ,
137
143
},
@@ -157,6 +163,8 @@ func getTestCases() []testcase {
157
163
"gpu.intel.com/platform_new.count" : "1" ,
158
164
"gpu.intel.com/platform_new.present" : "true" ,
159
165
"gpu.intel.com/platform_new.tiles" : "1" ,
166
+ "gpu.intel.com/graphics_version" : "9" ,
167
+ "gpu.intel.com/media_version" : "9" ,
160
168
"gpu.intel.com/platform_gen" : "9" ,
161
169
"gpu.intel.com/cards" : "card0" ,
162
170
},
@@ -184,6 +192,60 @@ func getTestCases() []testcase {
184
192
"gpu.intel.com/cards" : "card0" ,
185
193
},
186
194
},
195
+ {
196
+ sysfsdirs : []string {
197
+ "card0/device/drm/card0" ,
198
+ },
199
+ sysfsfiles : map [string ][]byte {
200
+ "card0/device/vendor" : []byte ("0x8086" ),
201
+ },
202
+ name : "gen version missing, but media & graphics versions present" ,
203
+ memoryOverride : 16000000000 ,
204
+ capabilityFile : map [string ][]byte {
205
+ "0/i915_capabilities" : []byte (
206
+ "platform: new\n " +
207
+ "media version: 12.5\n " +
208
+ "graphics version: 12.2" ),
209
+ },
210
+ expectedRetval : nil ,
211
+ expectedLabels : labelMap {
212
+ "gpu.intel.com/millicores" : "1000" ,
213
+ "gpu.intel.com/memory.max" : "16000000000" ,
214
+ "gpu.intel.com/platform_new.count" : "1" ,
215
+ "gpu.intel.com/platform_new.present" : "true" ,
216
+ "gpu.intel.com/platform_new.tiles" : "1" ,
217
+ "gpu.intel.com/graphics_version" : "12.2" ,
218
+ "gpu.intel.com/media_version" : "12.5" ,
219
+ "gpu.intel.com/platform_gen" : "12" ,
220
+ "gpu.intel.com/cards" : "card0" ,
221
+ },
222
+ },
223
+ {
224
+ sysfsdirs : []string {
225
+ "card0/device/drm/card0" ,
226
+ },
227
+ sysfsfiles : map [string ][]byte {
228
+ "card0/device/vendor" : []byte ("0x8086" ),
229
+ },
230
+ name : "only media version present" ,
231
+ memoryOverride : 16000000000 ,
232
+ capabilityFile : map [string ][]byte {
233
+ "0/i915_capabilities" : []byte (
234
+ "platform: new\n " +
235
+ "media version: 12.5" ),
236
+ },
237
+ expectedRetval : nil ,
238
+ expectedLabels : labelMap {
239
+ "gpu.intel.com/millicores" : "1000" ,
240
+ "gpu.intel.com/memory.max" : "16000000000" ,
241
+ "gpu.intel.com/platform_new.count" : "1" ,
242
+ "gpu.intel.com/platform_new.present" : "true" ,
243
+ "gpu.intel.com/platform_new.tiles" : "1" ,
244
+ "gpu.intel.com/media_version" : "12.5" ,
245
+ "gpu.intel.com/platform_gen" : "12" ,
246
+ "gpu.intel.com/cards" : "card0" ,
247
+ },
248
+ },
187
249
{
188
250
sysfsdirs : []string {
189
251
"card0/device/drm/card0" ,
0 commit comments