mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Check if direct submission enable in OsContext
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8a700c5187
commit
7c99739b89
@@ -1132,81 +1132,23 @@ template <typename GfxFamily>
|
||||
inline bool CommandStreamReceiverHw<GfxFamily>::initDirectSubmission(Device &device, OsContext &osContext) {
|
||||
bool ret = true;
|
||||
|
||||
if (DebugManager.flags.EnableDirectSubmission.get() == 1) {
|
||||
auto contextEngineType = osContext.getEngineType();
|
||||
const DirectSubmissionProperties &directSubmissionProperty =
|
||||
device.getHardwareInfo().capabilityTable.directSubmissionEngines.data[contextEngineType];
|
||||
bool submitOnInit = false;
|
||||
auto startDirect = osContext.isDirectSubmissionAvailable(device.getHardwareInfo(), submitOnInit);
|
||||
|
||||
bool startDirect = true;
|
||||
if (!osContext.isDefaultContext()) {
|
||||
startDirect = directSubmissionProperty.useNonDefault;
|
||||
}
|
||||
if (osContext.isLowPriority()) {
|
||||
startDirect = directSubmissionProperty.useLowPriority;
|
||||
}
|
||||
if (osContext.isInternalEngine()) {
|
||||
startDirect = directSubmissionProperty.useInternal;
|
||||
}
|
||||
if (osContext.isRootDevice()) {
|
||||
startDirect = directSubmissionProperty.useRootDevice;
|
||||
}
|
||||
|
||||
bool submitOnInit = directSubmissionProperty.submitOnInit;
|
||||
bool engineSupported = checkDirectSubmissionSupportsEngine(directSubmissionProperty,
|
||||
contextEngineType,
|
||||
submitOnInit,
|
||||
startDirect);
|
||||
if (engineSupported && startDirect) {
|
||||
if (contextEngineType == aub_stream::ENGINE_BCS) {
|
||||
blitterDirectSubmission = DirectSubmissionHw<GfxFamily, BlitterDispatcher<GfxFamily>>::create(device, osContext);
|
||||
ret = blitterDirectSubmission->initialize(submitOnInit);
|
||||
} else {
|
||||
directSubmission = DirectSubmissionHw<GfxFamily, RenderDispatcher<GfxFamily>>::create(device, osContext);
|
||||
ret = directSubmission->initialize(submitOnInit);
|
||||
this->dispatchMode = DispatchMode::ImmediateDispatch;
|
||||
}
|
||||
osContext.setDirectSubmissionActive();
|
||||
if (startDirect) {
|
||||
if (osContext.getEngineType() == aub_stream::ENGINE_BCS) {
|
||||
blitterDirectSubmission = DirectSubmissionHw<GfxFamily, BlitterDispatcher<GfxFamily>>::create(device, osContext);
|
||||
ret = blitterDirectSubmission->initialize(submitOnInit);
|
||||
} else {
|
||||
directSubmission = DirectSubmissionHw<GfxFamily, RenderDispatcher<GfxFamily>>::create(device, osContext);
|
||||
ret = directSubmission->initialize(submitOnInit);
|
||||
this->dispatchMode = DispatchMode::ImmediateDispatch;
|
||||
}
|
||||
osContext.setDirectSubmissionActive();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline bool CommandStreamReceiverHw<GfxFamily>::checkDirectSubmissionSupportsEngine(const DirectSubmissionProperties &directSubmissionProperty,
|
||||
aub_stream::EngineType contextEngineType,
|
||||
bool &startOnInit,
|
||||
bool &startInContext) {
|
||||
bool supported = directSubmissionProperty.engineSupported;
|
||||
startOnInit = directSubmissionProperty.submitOnInit;
|
||||
if (contextEngineType == aub_stream::ENGINE_BCS) {
|
||||
int32_t blitterOverrideKey = DebugManager.flags.DirectSubmissionOverrideBlitterSupport.get();
|
||||
if (blitterOverrideKey != -1) {
|
||||
supported = blitterOverrideKey == 0 ? false : true;
|
||||
startOnInit = blitterOverrideKey == 1 ? true : false;
|
||||
}
|
||||
} else if (contextEngineType == aub_stream::ENGINE_RCS) {
|
||||
int32_t renderOverrideKey = DebugManager.flags.DirectSubmissionOverrideRenderSupport.get();
|
||||
if (renderOverrideKey != -1) {
|
||||
supported = renderOverrideKey == 0 ? false : true;
|
||||
startOnInit = renderOverrideKey == 1 ? true : false;
|
||||
}
|
||||
} else {
|
||||
//assume else is CCS
|
||||
int32_t computeOverrideKey = DebugManager.flags.DirectSubmissionOverrideComputeSupport.get();
|
||||
if (computeOverrideKey != -1) {
|
||||
supported = computeOverrideKey == 0 ? false : true;
|
||||
startOnInit = computeOverrideKey == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
//enable start in context only when default support is overridden and enabled
|
||||
if (supported && !directSubmissionProperty.engineSupported) {
|
||||
startInContext = true;
|
||||
}
|
||||
|
||||
return supported;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPerDssBackedBuffer(const HardwareInfo &hwInfo) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user