Setup device registry path in GMM_INIT_IN_ARGS

Change-Id: If4eed9cb16bd0bba24a0d5803488e00ef48a3fa5
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2020-08-05 13:58:44 +02:00 committed by sys_ocldev
parent 7d9d4e743a
commit 171c40d58a
3 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@ class WddmMock : public Wddm {
using Wddm::currentPagingFenceValue;
using Wddm::dedicatedVideoMemory;
using Wddm::device;
using Wddm::deviceRegistryPath;
using Wddm::featureTable;
using Wddm::getSystemInfo;
using Wddm::gmmMemory;

View File

@ -26,6 +26,8 @@ TEST(osInterfaceTests, whenOsInterfaceSetupGmmInputArgsThenArgsAreSet) {
wddm->init();
EXPECT_NE(nullptr, rootDeviceEnvironment.osInterface.get());
wddm->deviceRegistryPath = "registyPath";
auto expectedRegistryPath = wddm->deviceRegistryPath.c_str();
auto &adapterBDF = wddm->adapterBDF;
adapterBDF.Bus = 0x12;
adapterBDF.Device = 0x34;
@ -33,9 +35,11 @@ TEST(osInterfaceTests, whenOsInterfaceSetupGmmInputArgsThenArgsAreSet) {
GMM_INIT_IN_ARGS gmmInputArgs = {};
EXPECT_NE(0, memcmp(&adapterBDF, &gmmInputArgs.stAdapterBDF, sizeof(ADAPTER_BDF)));
EXPECT_STRNE(expectedRegistryPath, gmmInputArgs.DeviceRegistryPath);
rootDeviceEnvironment.osInterface->setGmmInputArgs(&gmmInputArgs);
EXPECT_EQ(0, memcmp(&adapterBDF, &gmmInputArgs.stAdapterBDF, sizeof(ADAPTER_BDF)));
EXPECT_EQ(GMM_CLIENT::GMM_OCL_VISTA, gmmInputArgs.ClientType);
EXPECT_STREQ(expectedRegistryPath, gmmInputArgs.DeviceRegistryPath);
}

View File

@ -1017,6 +1017,7 @@ void Wddm::setGmmInputArg(void *args) {
gmmInArgs->stAdapterBDF = this->adapterBDF;
gmmInArgs->ClientType = GMM_CLIENT::GMM_OCL_VISTA;
gmmInArgs->DeviceRegistryPath = const_cast<char *>(deviceRegistryPath.c_str());
}
void Wddm::updatePagingFenceValue(uint64_t newPagingFenceValue) {