Set HwInfo to GmmHelper on Device creation

This allows querying HwInfo from code that doesnt have access to Device

Change-Id: I0084f824f557cd85c2fdfbf0ff2ec71118e9af2e
This commit is contained in:
Dunajski, Bartosz
2018-06-28 13:38:15 +02:00
committed by sys_ocldev
parent 5186474ef5
commit 5408913d38
17 changed files with 98 additions and 30 deletions

View File

@@ -620,6 +620,13 @@ TEST(GmmTest, whenContextIsDestroyedMultimpleTimesThenDontCrash) {
EXPECT_TRUE(GmmHelper::initContext(hwinfo->pPlatform, hwinfo->pSkuTable, hwinfo->pWaTable, hwinfo->pSysInfo));
}
TEST(GmmTest, givenHwInfoWhenDeviceIsCreatedTheSetThisHwInfoToGmmHelper) {
HardwareInfo localHwInfo = **platformDevices;
std::unique_ptr<MockDevice> device(Device::create<MockDevice>(&localHwInfo));
EXPECT_EQ(&localHwInfo, GmmHelper::hwInfo);
}
TEST(GmmTest, whenResourceIsCreatedThenHandleItsOwnership) {
struct MyMockResourecInfo : public GmmResourceInfo {
using GmmResourceInfo::resourceInfo;