Revert "Stop using platformDevices to setup hw info on Linux"
This reverts commit 8bbb719a97
.
Change-Id: I1335d6545a0e3497de008ecd185e50fde6418455
This commit is contained in:
parent
0fff56b656
commit
a8fbf4ecca
|
@ -6,7 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "core/debug_settings/debug_settings_manager.h"
|
#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/gmm_helper/gmm_helper.h"
|
||||||
#include "core/helpers/hw_cmds.h"
|
#include "core/helpers/hw_cmds.h"
|
||||||
#include "core/helpers/hw_helper.h"
|
#include "core/helpers/hw_helper.h"
|
||||||
|
@ -14,7 +13,6 @@
|
||||||
#include "core/helpers/options.h"
|
#include "core/helpers/options.h"
|
||||||
#include "core/os_interface/linux/drm_neo.h"
|
#include "core/os_interface/linux/drm_neo.h"
|
||||||
#include "core/os_interface/linux/drm_null_device.h"
|
#include "core/os_interface/linux/drm_null_device.h"
|
||||||
#include "runtime/execution_environment/execution_environment.h"
|
|
||||||
|
|
||||||
#include "drm/i915_drm.h"
|
#include "drm/i915_drm.h"
|
||||||
|
|
||||||
|
@ -168,7 +166,7 @@ Drm *Drm::create(int32_t deviceOrdinal, RootDeviceEnvironment &rootDeviceEnviron
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (device) {
|
if (device) {
|
||||||
rootDeviceEnvironment.executionEnvironment.setHwInfo(device->pHwInfo);
|
platformDevices[0] = device->pHwInfo;
|
||||||
ret = drmObject->setupHardwareInfo(const_cast<DeviceDescriptor *>(device), true);
|
ret = drmObject->setupHardwareInfo(const_cast<DeviceDescriptor *>(device), true);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -43,8 +43,9 @@ bool DeviceFactory::getDevices(size_t &numDevices, ExecutionEnvironment &executi
|
||||||
}
|
}
|
||||||
|
|
||||||
auto hardwareInfo = executionEnvironment.getMutableHardwareInfo();
|
auto hardwareInfo = executionEnvironment.getMutableHardwareInfo();
|
||||||
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily);
|
const HardwareInfo *pCurrDevice = platformDevices[devNum];
|
||||||
if (hwConfig->configureHwInfo(hardwareInfo, hardwareInfo, executionEnvironment.rootDeviceEnvironments[0]->osInterface.get())) {
|
HwInfoConfig *hwConfig = HwInfoConfig::get(pCurrDevice->platform.eProductFamily);
|
||||||
|
if (hwConfig->configureHwInfo(pCurrDevice, hardwareInfo, executionEnvironment.rootDeviceEnvironments[0]->osInterface.get())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
executionEnvironment.calculateMaxOsContextCount();
|
executionEnvironment.calculateMaxOsContextCount();
|
||||||
|
|
|
@ -404,19 +404,3 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
return retVal;
|
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);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue