2021-05-18 10:46:21 +08:00
|
|
|
/*
|
2024-03-07 18:08:04 +08:00
|
|
|
* Copyright (C) 2021-2024 Intel Corporation
|
2021-05-18 10:46:21 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "shared/source/command_stream/stream_property.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
2023-02-17 00:51:55 +08:00
|
|
|
enum PreemptionMode : uint32_t;
|
|
|
|
struct HardwareInfo;
|
2022-12-19 20:25:44 +08:00
|
|
|
struct RootDeviceEnvironment;
|
2021-05-18 10:46:21 +08:00
|
|
|
|
2022-08-23 12:02:33 +08:00
|
|
|
struct StateComputeModePropertiesSupport {
|
|
|
|
bool coherencyRequired = false;
|
|
|
|
bool largeGrfMode = false;
|
|
|
|
bool zPassAsyncComputeThreadLimit = false;
|
|
|
|
bool pixelAsyncComputeThreadLimit = false;
|
|
|
|
bool threadArbitrationPolicy = false;
|
|
|
|
bool devicePreemptionMode = false;
|
2024-07-03 20:29:50 +08:00
|
|
|
bool allocationForScratchAndMidthreadPreemption = false;
|
2022-08-23 12:02:33 +08:00
|
|
|
};
|
|
|
|
|
2021-05-18 10:46:21 +08:00
|
|
|
struct StateComputeModeProperties {
|
|
|
|
StreamProperty isCoherencyRequired{};
|
2021-07-07 21:34:46 +08:00
|
|
|
StreamProperty largeGrfMode{};
|
2021-11-19 21:38:23 +08:00
|
|
|
StreamProperty zPassAsyncComputeThreadLimit{};
|
|
|
|
StreamProperty pixelAsyncComputeThreadLimit{};
|
2021-12-07 19:46:24 +08:00
|
|
|
StreamProperty threadArbitrationPolicy{};
|
2022-06-23 23:25:10 +08:00
|
|
|
StreamProperty devicePreemptionMode{};
|
2024-07-03 20:29:50 +08:00
|
|
|
StreamProperty memoryAllocationForScratchAndMidthreadPreemptionBuffers{};
|
2021-05-18 10:46:21 +08:00
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-04-04 06:03:02 +08:00
|
|
|
void resetState();
|
2023-03-10 07:12:09 +08:00
|
|
|
|
|
|
|
void setPropertiesAll(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, PreemptionMode devicePreemptionMode);
|
|
|
|
void setPropertiesGrfNumberThreadArbitration(uint32_t numGrfRequired, int32_t threadArbitrationPolicy);
|
|
|
|
void setPropertiesCoherencyDevicePreemption(bool requiresCoherency, PreemptionMode devicePreemptionMode, bool clearDirtyState);
|
2023-03-11 02:36:22 +08:00
|
|
|
|
|
|
|
void copyPropertiesAll(const StateComputeModeProperties &properties);
|
|
|
|
void copyPropertiesGrfNumberThreadArbitration(const StateComputeModeProperties &properties);
|
|
|
|
|
2021-12-09 19:01:40 +08:00
|
|
|
bool isDirty() const;
|
2023-03-11 05:51:52 +08:00
|
|
|
void clearIsDirty();
|
2022-03-08 21:46:04 +08:00
|
|
|
|
|
|
|
protected:
|
2023-02-10 17:51:27 +08:00
|
|
|
void clearIsDirtyExtraPerContext();
|
2022-03-08 21:46:04 +08:00
|
|
|
bool isDirtyExtra() const;
|
2023-04-04 06:03:02 +08:00
|
|
|
void resetStateExtra();
|
2023-02-10 17:51:27 +08:00
|
|
|
|
|
|
|
void setPropertiesExtraPerContext();
|
2023-03-11 02:36:22 +08:00
|
|
|
|
|
|
|
void copyPropertiesExtra(const StateComputeModeProperties &properties);
|
2023-02-10 17:51:27 +08:00
|
|
|
|
2023-02-07 22:56:40 +08:00
|
|
|
void setCoherencyProperty(bool requiresCoherency);
|
|
|
|
void setDevicePreemptionProperty(PreemptionMode devicePreemptionMode);
|
|
|
|
void setGrfNumberProperty(uint32_t numGrfRequired);
|
2023-03-10 07:12:09 +08:00
|
|
|
void setThreadArbitrationProperty(int32_t threadArbitrationPolicy);
|
2022-08-23 12:02:33 +08:00
|
|
|
|
|
|
|
StateComputeModePropertiesSupport scmPropertiesSupport = {};
|
2023-03-10 07:12:09 +08:00
|
|
|
int32_t defaultThreadArbitrationPolicy = 0;
|
2022-08-23 12:02:33 +08:00
|
|
|
bool propertiesSupportLoaded = false;
|
2021-05-18 10:46:21 +08:00
|
|
|
};
|
|
|
|
|
2022-08-23 12:02:33 +08:00
|
|
|
struct FrontEndPropertiesSupport {
|
2022-08-30 04:06:04 +08:00
|
|
|
bool computeDispatchAllWalker = false;
|
|
|
|
bool disableEuFusion = false;
|
|
|
|
bool disableOverdispatch = false;
|
|
|
|
bool singleSliceDispatchCcsMode = false;
|
2022-08-23 12:02:33 +08:00
|
|
|
};
|
|
|
|
|
2021-05-18 10:46:21 +08:00
|
|
|
struct FrontEndProperties {
|
2022-02-11 07:33:40 +08:00
|
|
|
StreamProperty computeDispatchAllWalkerEnable{};
|
|
|
|
StreamProperty disableEUFusion{};
|
2021-07-29 01:17:51 +08:00
|
|
|
StreamProperty disableOverdispatch{};
|
2021-08-13 22:48:13 +08:00
|
|
|
StreamProperty singleSliceDispatchCcsMode{};
|
2021-07-29 01:17:51 +08:00
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-04-04 06:03:02 +08:00
|
|
|
void resetState();
|
2023-03-10 07:12:09 +08:00
|
|
|
|
2024-05-07 20:04:40 +08:00
|
|
|
void setPropertiesAll(bool isCooperativeKernel, bool disableEuFusion, bool disableOverdispatch, int32_t engineInstancedDevice);
|
2023-03-10 07:12:09 +08:00
|
|
|
void setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice);
|
|
|
|
void setPropertiesDisableOverdispatchEngineInstanced(bool disableOverdispatch, int32_t engineInstancedDevice, bool clearDirtyState);
|
|
|
|
void setPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(bool isCooperativeKernel, bool disableEuFusion);
|
2023-03-11 02:36:22 +08:00
|
|
|
|
|
|
|
void copyPropertiesAll(const FrontEndProperties &properties);
|
|
|
|
void copyPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(const FrontEndProperties &properties);
|
|
|
|
|
2021-12-09 19:01:40 +08:00
|
|
|
bool isDirty() const;
|
2021-05-26 21:51:11 +08:00
|
|
|
void clearIsDirty();
|
2022-08-30 04:06:04 +08:00
|
|
|
|
2023-03-11 05:51:52 +08:00
|
|
|
protected:
|
2022-08-30 04:06:04 +08:00
|
|
|
FrontEndPropertiesSupport frontEndPropertiesSupport = {};
|
|
|
|
bool propertiesSupportLoaded = false;
|
2021-05-18 10:46:21 +08:00
|
|
|
};
|
|
|
|
|
2022-09-13 03:11:56 +08:00
|
|
|
struct PipelineSelectPropertiesSupport {
|
|
|
|
bool mediaSamplerDopClockGate = false;
|
|
|
|
bool systolicMode = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PipelineSelectProperties {
|
|
|
|
StreamProperty modeSelected{};
|
|
|
|
StreamProperty mediaSamplerDopClockGate{};
|
|
|
|
StreamProperty systolicMode{};
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-04-04 06:03:02 +08:00
|
|
|
void resetState();
|
2023-03-10 07:12:09 +08:00
|
|
|
|
|
|
|
void setPropertiesAll(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode);
|
|
|
|
void setPropertiesModeSelectedMediaSamplerClockGate(bool modeSelected, bool mediaSamplerDopClockGate, bool clearDirtyState);
|
|
|
|
void setPropertySystolicMode(bool systolicMode);
|
2023-03-11 02:36:22 +08:00
|
|
|
|
|
|
|
void copyPropertiesAll(const PipelineSelectProperties &properties);
|
|
|
|
void copyPropertiesSystolicMode(const PipelineSelectProperties &properties);
|
|
|
|
|
2022-09-13 03:11:56 +08:00
|
|
|
bool isDirty() const;
|
|
|
|
void clearIsDirty();
|
|
|
|
|
2023-03-11 05:51:52 +08:00
|
|
|
protected:
|
2022-09-13 03:11:56 +08:00
|
|
|
PipelineSelectPropertiesSupport pipelineSelectPropertiesSupport = {};
|
|
|
|
bool propertiesSupportLoaded = false;
|
|
|
|
};
|
|
|
|
|
2022-11-23 01:17:04 +08:00
|
|
|
struct StateBaseAddressPropertiesSupport {
|
|
|
|
bool bindingTablePoolBaseAddress = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StateBaseAddressProperties {
|
|
|
|
StreamProperty64 bindingTablePoolBaseAddress{};
|
|
|
|
StreamProperty64 surfaceStateBaseAddress{};
|
|
|
|
StreamProperty64 dynamicStateBaseAddress{};
|
|
|
|
StreamProperty64 indirectObjectBaseAddress{};
|
2023-01-26 22:42:33 +08:00
|
|
|
StreamPropertySizeT bindingTablePoolSize{};
|
2022-11-23 01:17:04 +08:00
|
|
|
StreamPropertySizeT surfaceStateSize{};
|
|
|
|
StreamPropertySizeT dynamicStateSize{};
|
|
|
|
StreamPropertySizeT indirectObjectSize{};
|
|
|
|
StreamProperty statelessMocs{};
|
|
|
|
|
2023-03-10 07:12:09 +08:00
|
|
|
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-04-04 06:03:02 +08:00
|
|
|
void resetState();
|
2023-03-10 07:12:09 +08:00
|
|
|
|
2024-03-08 14:38:34 +08:00
|
|
|
void setPropertiesAll(int32_t statelessMocs,
|
2023-02-10 17:51:27 +08:00
|
|
|
int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
|
|
|
|
int64_t surfaceStateBaseAddress, size_t surfaceStateSize,
|
|
|
|
int64_t dynamicStateBaseAddress, size_t dynamicStateSize,
|
2023-03-10 07:12:09 +08:00
|
|
|
int64_t indirectObjectBaseAddress, size_t indirectObjectSize);
|
2023-03-11 02:36:22 +08:00
|
|
|
void setPropertiesBindingTableSurfaceState(int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
|
|
|
|
int64_t surfaceStateBaseAddress, size_t surfaceStateSize);
|
|
|
|
void setPropertiesSurfaceState(int64_t surfaceStateBaseAddress, size_t surfaceStateSize);
|
2023-02-10 17:51:27 +08:00
|
|
|
void setPropertiesDynamicState(int64_t dynamicStateBaseAddress, size_t dynamicStateSize);
|
|
|
|
void setPropertiesIndirectState(int64_t indirectObjectBaseAddress, size_t indirectObjectSize);
|
2023-02-10 17:51:27 +08:00
|
|
|
void setPropertyStatelessMocs(int32_t statelessMocs);
|
2023-03-11 02:36:22 +08:00
|
|
|
|
|
|
|
void copyPropertiesAll(const StateBaseAddressProperties &properties);
|
|
|
|
void copyPropertiesStatelessMocs(const StateBaseAddressProperties &properties);
|
|
|
|
void copyPropertiesStatelessMocsIndirectState(const StateBaseAddressProperties &properties);
|
2023-06-06 22:26:51 +08:00
|
|
|
void copyPropertiesBindingTableSurfaceState(const StateBaseAddressProperties &properties);
|
|
|
|
void copyPropertiesSurfaceState(const StateBaseAddressProperties &properties);
|
|
|
|
void copyPropertiesDynamicState(const StateBaseAddressProperties &properties);
|
2023-03-11 02:36:22 +08:00
|
|
|
|
2022-11-23 01:17:04 +08:00
|
|
|
bool isDirty() const;
|
|
|
|
void clearIsDirty();
|
|
|
|
|
2023-03-11 05:51:52 +08:00
|
|
|
protected:
|
2022-11-23 01:17:04 +08:00
|
|
|
StateBaseAddressPropertiesSupport stateBaseAddressPropertiesSupport = {};
|
|
|
|
bool propertiesSupportLoaded = false;
|
|
|
|
};
|
|
|
|
|
2021-05-18 10:46:21 +08:00
|
|
|
} // namespace NEO
|