Revert "Stop using platformDevices to setup hw info on Linux"

This reverts commit 8bbb719a97.

Change-Id: I1335d6545a0e3497de008ecd185e50fde6418455
This commit is contained in:
Mrozek, Michal 2020-02-02 01:48:22 -08:00 committed by sys_ocldev
parent 0fff56b656
commit a8fbf4ecca
3 changed files with 4 additions and 21 deletions

View File

@ -6,7 +6,6 @@
*/
#include "core/debug_settings/debug_settings_manager.h"
#include "core/execution_environment/root_device_environment.h"
#include "core/gmm_helper/gmm_helper.h"
#include "core/helpers/hw_cmds.h"
#include "core/helpers/hw_helper.h"
@ -14,7 +13,6 @@
#include "core/helpers/options.h"
#include "core/os_interface/linux/drm_neo.h"
#include "core/os_interface/linux/drm_null_device.h"
#include "runtime/execution_environment/execution_environment.h"
#include "drm/i915_drm.h"
@ -168,7 +166,7 @@ Drm *Drm::create(int32_t deviceOrdinal, RootDeviceEnvironment &rootDeviceEnviron
}
}
if (device) {
rootDeviceEnvironment.executionEnvironment.setHwInfo(device->pHwInfo);
platformDevices[0] = device->pHwInfo;
ret = drmObject->setupHardwareInfo(const_cast<DeviceDescriptor *>(device), true);
if (ret != 0) {
return nullptr;

View File

@ -43,8 +43,9 @@ bool DeviceFactory::getDevices(size_t &numDevices, ExecutionEnvironment &executi
}
auto hardwareInfo = executionEnvironment.getMutableHardwareInfo();
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily);
if (hwConfig->configureHwInfo(hardwareInfo, hardwareInfo, executionEnvironment.rootDeviceEnvironments[0]->osInterface.get())) {
const HardwareInfo *pCurrDevice = platformDevices[devNum];
HwInfoConfig *hwConfig = HwInfoConfig::get(pCurrDevice->platform.eProductFamily);
if (hwConfig->configureHwInfo(pCurrDevice, hardwareInfo, executionEnvironment.rootDeviceEnvironments[0]->osInterface.get())) {
return false;
}
executionEnvironment.calculateMaxOsContextCount();

View File

@ -404,19 +404,3 @@ int main(int argc, char **argv) {
return retVal;
}
TEST_F(DrmTests, whenCreateDrmIsCalledThenProperHwInfoIsSetup) {
auto oldHwInfo = executionEnvironment.getMutableHardwareInfo();
oldHwInfo->platform.eProductFamily = IGFX_UNKNOWN;
oldHwInfo->platform.eRenderCoreFamily = IGFX_UNKNOWN_CORE;
auto drm = DrmWrap::createDrm(0, *rootDeviceEnvironment);
EXPECT_NE(drm, nullptr);
auto currentHwInfo = executionEnvironment.getHardwareInfo();
EXPECT_NE(IGFX_UNKNOWN, currentHwInfo->platform.eProductFamily);
EXPECT_NE(IGFX_UNKNOWN_CORE, currentHwInfo->platform.eRenderCoreFamily);
DrmWrap::closeDevice(0);
drm = DrmWrap::get(0);
EXPECT_EQ(drm, nullptr);
}