mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
Set root device index in OsContext
- correclty choose default engine context accounting for root device index and subdevices bitfield Related-To: NEO-7516 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4882f51721
commit
f19abda0e2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
return OsContextLinux::create(osInterface, contextId, engineDescriptor);
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
return OsContextLinux::create(osInterface, rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
if (osInterface) {
|
||||
if (osInterface->getDriverModel()->getDriverModelType() == DriverModelType::DRM) {
|
||||
return OsContextLinux::create(osInterface, contextId, engineDescriptor);
|
||||
return OsContextLinux::create(osInterface, rootDeviceIndex, contextId, engineDescriptor);
|
||||
} else {
|
||||
return OsContextWin::create(osInterface, contextId, engineDescriptor);
|
||||
return OsContextWin::create(osInterface, rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
}
|
||||
return OsContextLinux::create(osInterface, contextId, engineDescriptor);
|
||||
return OsContextLinux::create(osInterface, rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
return OsContextWin::create(osInterface, contextId, engineDescriptor);
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
return OsContextWin::create(osInterface, rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -19,15 +19,15 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
OsContext *OsContextLinux::create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
OsContext *OsContextLinux::create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
if (osInterface) {
|
||||
return new OsContextLinux(*osInterface->getDriverModel()->as<Drm>(), contextId, engineDescriptor);
|
||||
return new OsContextLinux(*osInterface->getDriverModel()->as<Drm>(), rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
return new OsContext(contextId, engineDescriptor);
|
||||
return new OsContext(rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
|
||||
OsContextLinux::OsContextLinux(Drm &drm, uint32_t contextId, const EngineDescriptor &engineDescriptor)
|
||||
: OsContext(contextId, engineDescriptor),
|
||||
OsContextLinux::OsContextLinux(Drm &drm, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor)
|
||||
: OsContext(rootDeviceIndex, contextId, engineDescriptor),
|
||||
drm(drm) {}
|
||||
|
||||
void OsContextLinux::initializeContext() {
|
||||
|
||||
@@ -20,7 +20,7 @@ class OsContextLinux : public OsContext {
|
||||
public:
|
||||
OsContextLinux() = delete;
|
||||
~OsContextLinux() override;
|
||||
OsContextLinux(Drm &drm, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
OsContextLinux(Drm &drm, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
|
||||
unsigned int getEngineFlag() const { return engineFlag; }
|
||||
void setEngineFlag(unsigned int engineFlag) { this->engineFlag = engineFlag; }
|
||||
@@ -41,7 +41,7 @@ class OsContextLinux : public OsContext {
|
||||
bool isDirectSubmissionSupported(const HardwareInfo &hwInfo) const override;
|
||||
Drm &getDrm() const;
|
||||
void waitForPagingFence();
|
||||
static OsContext *create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
static OsContext *create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
void reInitializeContext() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
namespace NEO {
|
||||
OsContext::OsContext(uint32_t contextId, const EngineDescriptor &engineDescriptor)
|
||||
: contextId(contextId),
|
||||
OsContext::OsContext(uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor)
|
||||
: rootDeviceIndex(rootDeviceIndex),
|
||||
contextId(contextId),
|
||||
deviceBitfield(engineDescriptor.deviceBitfield),
|
||||
preemptionMode(engineDescriptor.preemptionMode),
|
||||
numSupportedDevices(static_cast<uint32_t>(engineDescriptor.deviceBitfield.count())),
|
||||
|
||||
@@ -23,8 +23,8 @@ struct HardwareInfo;
|
||||
|
||||
class OsContext : public ReferenceTrackedObject<OsContext> {
|
||||
public:
|
||||
OsContext(uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
static OsContext *create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
OsContext(uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
static OsContext *create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
|
||||
bool isImmediateContextInitializationEnabled(bool isDefaultEngine) const;
|
||||
bool isInitialized() const { return contextInitialized; }
|
||||
@@ -58,9 +58,12 @@ class OsContext : public ReferenceTrackedObject<OsContext> {
|
||||
uint8_t getUmdPowerHintValue() { return powerHintValue; }
|
||||
void setUmdPowerHintValue(uint8_t powerHintValue) { this->powerHintValue = powerHintValue; }
|
||||
|
||||
uint32_t getRootDeviceIndex() { return rootDeviceIndex; }
|
||||
|
||||
protected:
|
||||
virtual void initializeContext() {}
|
||||
|
||||
const uint32_t rootDeviceIndex;
|
||||
const uint32_t contextId;
|
||||
const DeviceBitfield deviceBitfield;
|
||||
const PreemptionMode preemptionMode;
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
OsContext *OsContextWin::create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
OsContext *OsContextWin::create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor) {
|
||||
if (osInterface) {
|
||||
return new OsContextWin(*osInterface->getDriverModel()->as<Wddm>(), contextId, engineDescriptor);
|
||||
return new OsContextWin(*osInterface->getDriverModel()->as<Wddm>(), rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
return new OsContext(contextId, engineDescriptor);
|
||||
return new OsContext(rootDeviceIndex, contextId, engineDescriptor);
|
||||
}
|
||||
|
||||
OsContextWin::OsContextWin(Wddm &wddm, uint32_t contextId, const EngineDescriptor &engineDescriptor)
|
||||
: OsContext(contextId, engineDescriptor),
|
||||
OsContextWin::OsContextWin(Wddm &wddm, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor)
|
||||
: OsContext(rootDeviceIndex, contextId, engineDescriptor),
|
||||
residencyController(wddm, contextId),
|
||||
wddm(wddm) {
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class OsContextWin : public OsContext {
|
||||
OsContextWin() = delete;
|
||||
~OsContextWin() override;
|
||||
|
||||
OsContextWin(Wddm &wddm, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
OsContextWin(Wddm &wddm, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
|
||||
D3DKMT_HANDLE getWddmContextHandle() const { return wddmContextHandle; }
|
||||
void setWddmContextHandle(D3DKMT_HANDLE wddmContextHandle) { this->wddmContextHandle = wddmContextHandle; }
|
||||
@@ -33,7 +33,7 @@ class OsContextWin : public OsContext {
|
||||
void setHwQueue(HardwareQueue hardwareQueue) { this->hardwareQueue = hardwareQueue; }
|
||||
Wddm *getWddm() const { return &wddm; }
|
||||
MOCKABLE_VIRTUAL WddmResidencyController &getResidencyController() { return residencyController; }
|
||||
static OsContext *create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
static OsContext *create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
||||
void reInitializeContext() override;
|
||||
void getDeviceLuidArray(std::vector<uint8_t> &luidData, size_t arraySize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user