1- // Copyright 2020 Intel Corporation. All Rights Reserved.
1+ // Copyright 2020-2021 Intel Corporation. All Rights Reserved.
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -58,6 +58,8 @@ func getTestCases() []testcase {
5858 "gpu.intel.com/platform_new.count" : "1" ,
5959 "gpu.intel.com/platform_new.present" : "true" ,
6060 "gpu.intel.com/platform_new.tiles" : "1" ,
61+ "gpu.intel.com/graphics_version" : "9" ,
62+ "gpu.intel.com/media_version" : "9" ,
6163 "gpu.intel.com/platform_gen" : "9" ,
6264 "gpu.intel.com/cards" : "card0" ,
6365 },
@@ -104,6 +106,8 @@ func getTestCases() []testcase {
104106 "gpu.intel.com/platform_new.count" : "1" ,
105107 "gpu.intel.com/platform_new.present" : "true" ,
106108 "gpu.intel.com/platform_new.tiles" : "2" ,
109+ "gpu.intel.com/graphics_version" : "9" ,
110+ "gpu.intel.com/media_version" : "9" ,
107111 "gpu.intel.com/platform_gen" : "9" ,
108112 "gpu.intel.com/cards" : "card0" ,
109113 },
@@ -132,6 +136,8 @@ func getTestCases() []testcase {
132136 "gpu.intel.com/platform_new.count" : "1" ,
133137 "gpu.intel.com/platform_new.present" : "true" ,
134138 "gpu.intel.com/platform_new.tiles" : "1" ,
139+ "gpu.intel.com/graphics_version" : "9" ,
140+ "gpu.intel.com/media_version" : "9" ,
135141 "gpu.intel.com/platform_gen" : "9" ,
136142 "gpu.intel.com/cards" : "card0" ,
137143 },
@@ -157,6 +163,8 @@ func getTestCases() []testcase {
157163 "gpu.intel.com/platform_new.count" : "1" ,
158164 "gpu.intel.com/platform_new.present" : "true" ,
159165 "gpu.intel.com/platform_new.tiles" : "1" ,
166+ "gpu.intel.com/graphics_version" : "9" ,
167+ "gpu.intel.com/media_version" : "9" ,
160168 "gpu.intel.com/platform_gen" : "9" ,
161169 "gpu.intel.com/cards" : "card0" ,
162170 },
@@ -184,6 +192,60 @@ func getTestCases() []testcase {
184192 "gpu.intel.com/cards" : "card0" ,
185193 },
186194 },
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+ },
187249 {
188250 sysfsdirs : []string {
189251 "card0/device/drm/card0" ,
0 commit comments