mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 16:24:18 +08:00
Rename compression flags and helpers
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5c266f9ab0
commit
68aea5bf62
@@ -9,7 +9,7 @@
|
||||
#include "shared/source/memory_manager/compression_selector.h"
|
||||
|
||||
namespace NEO {
|
||||
bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
||||
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
||||
bool preferredCompression = false;
|
||||
int32_t compressionEnabled = DebugManager.flags.EnableUsmCompression.get();
|
||||
if (compressionEnabled == 1) {
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(CompressionSelectorL0Tests, GivenDefaultDebugFlagWhenProvidingUsmAllocation
|
||||
deviceBitfield);
|
||||
properties.flags.isUSMDeviceAllocation = 1u;
|
||||
|
||||
EXPECT_FALSE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties, *defaultHwInfo));
|
||||
EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo));
|
||||
}
|
||||
|
||||
TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionDisabled) {
|
||||
@@ -34,7 +34,7 @@ TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocatio
|
||||
deviceBitfield);
|
||||
properties.flags.isUSMDeviceAllocation = 1u;
|
||||
|
||||
EXPECT_FALSE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties, *defaultHwInfo));
|
||||
EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo));
|
||||
}
|
||||
|
||||
TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionEnabled) {
|
||||
@@ -47,7 +47,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocation
|
||||
deviceBitfield);
|
||||
properties.flags.isUSMDeviceAllocation = 1u;
|
||||
|
||||
EXPECT_TRUE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties, *defaultHwInfo));
|
||||
EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo));
|
||||
}
|
||||
|
||||
TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocationThenExpectCompressionEnabled) {
|
||||
@@ -59,7 +59,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocat
|
||||
GraphicsAllocation::AllocationType::SVM_GPU,
|
||||
deviceBitfield);
|
||||
|
||||
EXPECT_TRUE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties, *defaultHwInfo));
|
||||
EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo));
|
||||
}
|
||||
|
||||
TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocationThenExpectCompressionDisabled) {
|
||||
@@ -71,7 +71,7 @@ TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocati
|
||||
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY,
|
||||
deviceBitfield);
|
||||
|
||||
EXPECT_FALSE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties, *defaultHwInfo));
|
||||
EXPECT_FALSE(NEO::CompressionSelector::preferCompressedAllocation(properties, *defaultHwInfo));
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
|
||||
@@ -30,7 +30,7 @@ class ClHwHelper {
|
||||
|
||||
virtual bool requiresNonAuxMode(const ArgDescPointer &argAsPtr, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool requiresAuxResolves(const KernelInfo &kernelInfo, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const = 0;
|
||||
virtual bool allowCompressionForContext(const ClDevice &clDevice, const Context &context) const = 0;
|
||||
virtual cl_command_queue_capabilities_intel getAdditionalDisabledQueueFamilyCapabilities(EngineGroupType type) const = 0;
|
||||
virtual bool getQueueFamilyName(std::string &name, EngineGroupType type) const = 0;
|
||||
virtual cl_ulong getKernelPrivateMemSize(const KernelInfo &kernelInfo) const = 0;
|
||||
@@ -61,7 +61,7 @@ class ClHwHelperHw : public ClHwHelper {
|
||||
|
||||
bool requiresNonAuxMode(const ArgDescPointer &argAsPtr, const HardwareInfo &hwInfo) const override;
|
||||
bool requiresAuxResolves(const KernelInfo &kernelInfo, const HardwareInfo &hwInfo) const override;
|
||||
bool allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const override;
|
||||
bool allowCompressionForContext(const ClDevice &clDevice, const Context &context) const override;
|
||||
cl_command_queue_capabilities_intel getAdditionalDisabledQueueFamilyCapabilities(EngineGroupType type) const override;
|
||||
bool getQueueFamilyName(std::string &name, EngineGroupType type) const override;
|
||||
cl_ulong getKernelPrivateMemSize(const KernelInfo &kernelInfo) const override;
|
||||
|
||||
@@ -34,7 +34,7 @@ inline bool ClHwHelperHw<GfxFamily>::hasStatelessAccessToBuffer(const KernelInfo
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline bool ClHwHelperHw<GfxFamily>::allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const {
|
||||
inline bool ClHwHelperHw<GfxFamily>::allowCompressionForContext(const ClDevice &clDevice, const Context &context) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ cl_int Kernel::initialize() {
|
||||
|
||||
auto &clHwHelper = ClHwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
|
||||
auxTranslationRequired = !program->getIsBuiltIn() && HwHelper::renderCompressedBuffersSupported(hwInfo) && clHwHelper.requiresAuxResolves(kernelInfo, hwInfo);
|
||||
auxTranslationRequired = !program->getIsBuiltIn() && HwHelper::compressedBuffersSupported(hwInfo) && clHwHelper.requiresAuxResolves(kernelInfo, hwInfo);
|
||||
|
||||
if (DebugManager.flags.ForceAuxTranslationEnabled.get() != -1) {
|
||||
auxTranslationRequired &= !!DebugManager.flags.ForceAuxTranslationEnabled.get();
|
||||
|
||||
@@ -187,8 +187,8 @@ Buffer *Buffer::create(Context *context,
|
||||
|
||||
auto hwInfo = (&memoryManager->peekExecutionEnvironment())->rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(HwHelper::renderCompressedBuffersSupported(*hwInfo), memoryProperties, *context,
|
||||
HwHelper::get(hwInfo->platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(size, *hwInfo));
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(HwHelper::compressedBuffersSupported(*hwInfo), memoryProperties, *context,
|
||||
HwHelper::get(hwInfo->platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(size, *hwInfo));
|
||||
|
||||
allocationInfo[rootDeviceIndex].allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, *context, compressionEnabled,
|
||||
memoryManager->isLocalMemorySupported(rootDeviceIndex));
|
||||
@@ -776,7 +776,7 @@ void Buffer::setSurfaceState(const Device *device,
|
||||
}
|
||||
|
||||
void Buffer::provideCompressionHint(bool compressionEnabled, Context *context, Buffer *buffer) {
|
||||
if (context->isProvidingPerformanceHints() && HwHelper::renderCompressedBuffersSupported(context->getDevice(0)->getHardwareInfo())) {
|
||||
if (context->isProvidingPerformanceHints() && HwHelper::compressedBuffersSupported(context->getDevice(0)->getHardwareInfo())) {
|
||||
if (compressionEnabled) {
|
||||
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, BUFFER_IS_COMPRESSED, buffer);
|
||||
} else {
|
||||
|
||||
@@ -200,8 +200,8 @@ Image *Image::create(Context *context,
|
||||
auto &clHwHelper = ClHwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
imgInfo.linearStorage = !defaultHwHelper.tilingAllowed(context->isSharedContext, Image::isImage1d(*imageDesc),
|
||||
memoryProperties.flags.forceLinearStorage);
|
||||
bool preferCompression = MemObjHelper::isSuitableForRenderCompression(!imgInfo.linearStorage, memoryProperties,
|
||||
*context, true);
|
||||
bool preferCompression = MemObjHelper::isSuitableForCompression(!imgInfo.linearStorage, memoryProperties,
|
||||
*context, true);
|
||||
preferCompression &= clHwHelper.allowImageCompression(surfaceFormat->OCLImageFormat);
|
||||
preferCompression &= !clHwHelper.isFormatRedescribable(surfaceFormat->OCLImageFormat);
|
||||
|
||||
@@ -386,7 +386,7 @@ Image *Image::create(Context *context,
|
||||
|
||||
auto &hwInfo = *memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
|
||||
if (context->isProvidingPerformanceHints() && HwHelper::renderCompressedImagesSupported(hwInfo)) {
|
||||
if (context->isProvidingPerformanceHints() && HwHelper::compressedImagesSupported(hwInfo)) {
|
||||
if (allocationInfo[rootDeviceIndex].memory->isCompressionEnabled()) {
|
||||
context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL, IMAGE_IS_COMPRESSED, image);
|
||||
} else {
|
||||
|
||||
@@ -101,8 +101,8 @@ SVMAllocsManager::SvmAllocationProperties MemObjHelper::getSvmAllocationProperti
|
||||
return svmProperties;
|
||||
}
|
||||
|
||||
bool MemObjHelper::isSuitableForRenderCompression(bool renderCompressedBuffers, const MemoryProperties &properties, Context &context, bool preferCompression) {
|
||||
if (!renderCompressedBuffers) {
|
||||
bool MemObjHelper::isSuitableForCompression(bool compressionSupported, const MemoryProperties &properties, Context &context, bool preferCompression) {
|
||||
if (!compressionSupported) {
|
||||
return false;
|
||||
}
|
||||
if (context.getRootDeviceIndices().size() > 1u) {
|
||||
@@ -112,7 +112,7 @@ bool MemObjHelper::isSuitableForRenderCompression(bool renderCompressedBuffers,
|
||||
auto rootDeviceIndex = pClDevice->getRootDeviceIndex();
|
||||
auto &hwInfo = pClDevice->getHardwareInfo();
|
||||
auto &clHwHelper = ClHwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
if (!clHwHelper.allowRenderCompressionForContext(*pClDevice, context)) {
|
||||
if (!clHwHelper.allowCompressionForContext(*pClDevice, context)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ class MemObjHelper {
|
||||
const HardwareInfo &hwInfo, DeviceBitfield subDevicesBitfieldParam, bool deviceOnlyVisibilty);
|
||||
static bool checkMemFlagsForSubBuffer(cl_mem_flags flags);
|
||||
static SVMAllocsManager::SvmAllocationProperties getSvmAllocationProperties(cl_mem_flags flags);
|
||||
static bool isSuitableForRenderCompression(bool renderCompressed, const MemoryProperties &properties, Context &context,
|
||||
bool preferCompression);
|
||||
static bool isSuitableForCompression(bool compressionSupported, const MemoryProperties &properties, Context &context,
|
||||
bool preferCompression);
|
||||
|
||||
protected:
|
||||
static bool validateExtraMemoryProperties(const MemoryProperties &memoryProperties, cl_mem_flags flags,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
namespace NEO {
|
||||
bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
||||
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
||||
switch (properties.allocationType) {
|
||||
case GraphicsAllocation::AllocationType::GLOBAL_SURFACE:
|
||||
case GraphicsAllocation::AllocationType::CONSTANT_SURFACE:
|
||||
|
||||
@@ -45,7 +45,7 @@ bool ClHwHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo, con
|
||||
}
|
||||
|
||||
template <>
|
||||
inline bool ClHwHelperHw<Family>::allowRenderCompressionForContext(const ClDevice &clDevice, const Context &context) const {
|
||||
inline bool ClHwHelperHw<Family>::allowCompressionForContext(const ClDevice &clDevice, const Context &context) const {
|
||||
auto rootDeviceIndex = clDevice.getRootDeviceIndex();
|
||||
auto &hwInfo = clDevice.getHardwareInfo();
|
||||
if (context.containsMultipleSubDevices(rootDeviceIndex) && HwHelperHw<Family>::get().isWorkaroundRequired(REVISION_A0, REVISION_A1, hwInfo)) {
|
||||
|
||||
@@ -18,7 +18,7 @@ using namespace NEO;
|
||||
|
||||
typedef EnqueueReadBufferTypeTest ReadWriteBufferCpuCopyTest;
|
||||
|
||||
HWTEST_F(ReadWriteBufferCpuCopyTest, givenRenderCompressedGmmWhenAskingForCpuOperationThenDisallow) {
|
||||
HWTEST_F(ReadWriteBufferCpuCopyTest, givenCompressedGmmWhenAskingForCpuOperationThenDisallow) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::Default));
|
||||
cl_int retVal;
|
||||
|
||||
@@ -679,8 +679,8 @@ HWTEST2_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenPrope
|
||||
Buffer::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context->getDevice(0)->getDevice()),
|
||||
0, 0, size, static_cast<void *>(NULL), retVal));
|
||||
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get());
|
||||
auto compressionSupported = HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(size, hwInfo) &&
|
||||
HwHelper::renderCompressedBuffersSupported(hwInfo);
|
||||
auto compressionSupported = HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(size, hwInfo) &&
|
||||
HwHelper::compressedBuffersSupported(hwInfo);
|
||||
if (compressionSupported) {
|
||||
EXPECT_TRUE(containsHint(expectedHint, userData));
|
||||
} else {
|
||||
@@ -705,10 +705,10 @@ TEST_F(PerformanceHintTest, givenUncompressedBufferWhenItsCreatedThenProperPerfo
|
||||
std::unique_ptr<Buffer> buffer;
|
||||
bool isCompressed = true;
|
||||
if (context->getMemoryManager()) {
|
||||
isCompressed = MemObjHelper::isSuitableForRenderCompression(
|
||||
HwHelper::renderCompressedBuffersSupported(hwInfo),
|
||||
isCompressed = MemObjHelper::isSuitableForCompression(
|
||||
HwHelper::compressedBuffersSupported(hwInfo),
|
||||
memoryProperties, *context,
|
||||
HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(size, hwInfo)) &&
|
||||
HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(size, hwInfo)) &&
|
||||
!is32bit && !context->isSharedContext &&
|
||||
(!memoryProperties.flags.useHostPtr || context->getMemoryManager()->isLocalMemorySupported(device->getRootDeviceIndex())) &&
|
||||
!memoryProperties.flags.forceHostMemory;
|
||||
@@ -786,7 +786,7 @@ HWTEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerfor
|
||||
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[IMAGE_IS_COMPRESSED], image.get());
|
||||
alignedFree(hostPtr);
|
||||
|
||||
if (HwHelper::renderCompressedImagesSupported(hwInfo)) {
|
||||
if (HwHelper::compressedImagesSupported(hwInfo)) {
|
||||
EXPECT_TRUE(containsHint(expectedHint, userData));
|
||||
} else {
|
||||
EXPECT_FALSE(containsHint(expectedHint, userData));
|
||||
@@ -849,7 +849,7 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor
|
||||
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[IMAGE_IS_NOT_COMPRESSED], image.get());
|
||||
alignedFree(hostPtr);
|
||||
|
||||
if (HwHelper::renderCompressedImagesSupported(hwInfo)) {
|
||||
if (HwHelper::compressedImagesSupported(hwInfo)) {
|
||||
EXPECT_TRUE(containsHint(expectedHint, userData));
|
||||
} else {
|
||||
EXPECT_FALSE(containsHint(expectedHint, userData));
|
||||
|
||||
@@ -27,7 +27,7 @@ template <typename T>
|
||||
class D3DAuxTests : public D3DTests<T> {};
|
||||
TYPED_TEST_CASE_P(D3DAuxTests);
|
||||
|
||||
TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsRenderCompressed) {
|
||||
TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsCompressed) {
|
||||
this->mockSharingFcns->mockTexture2dDesc.MiscFlags = D3DResourceFlags::MISC_SHARED;
|
||||
this->mockSharingFcns->mockTexture2dDesc.ArraySize = 4;
|
||||
this->mockSharingFcns->mockTexture2dDesc.MipLevels = 4;
|
||||
@@ -46,7 +46,7 @@ TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithUnifiedAuxFlagsWhenCreatingT
|
||||
EXPECT_TRUE(gmm->isCompressionEnabled);
|
||||
}
|
||||
|
||||
TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsRenderCompressed) {
|
||||
TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsCompressed) {
|
||||
this->mockSharingFcns->mockTexture2dDesc.MiscFlags = D3DResourceFlags::MISC_SHARED;
|
||||
this->mockSharingFcns->mockTexture2dDesc.ArraySize = 4;
|
||||
this->mockSharingFcns->mockTexture2dDesc.MipLevels = 4;
|
||||
@@ -82,7 +82,7 @@ TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithoutUnifiedAuxFlagsWhenCreati
|
||||
EXPECT_FALSE(gmm->isCompressionEnabled);
|
||||
}
|
||||
|
||||
TYPED_TEST_P(D3DAuxTests, given2dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetRenderCompressed) {
|
||||
TYPED_TEST_P(D3DAuxTests, given2dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetCompressed) {
|
||||
mockGmmResInfo->setUnifiedAuxTranslationCapable();
|
||||
EXPECT_CALL(*this->mockSharingFcns, getTexture2dDesc(_, _)).Times(1).WillOnce(SetArgPointee<0>(this->mockSharingFcns->mockTexture2dDesc));
|
||||
|
||||
@@ -98,7 +98,7 @@ TYPED_TEST_P(D3DAuxTests, given2dNonSharableTextureWithUnifiedAuxFlagsWhenCreati
|
||||
EXPECT_TRUE(gmm->isCompressionEnabled);
|
||||
}
|
||||
|
||||
TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsRenderCompressed) {
|
||||
TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsCompressed) {
|
||||
this->mockSharingFcns->mockTexture3dDesc.MiscFlags = D3DResourceFlags::MISC_SHARED;
|
||||
|
||||
mockGmmResInfo->setUnifiedAuxTranslationCapable();
|
||||
@@ -115,7 +115,7 @@ TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithUnifiedAuxFlagsWhenCreatingT
|
||||
EXPECT_TRUE(gmm->isCompressionEnabled);
|
||||
}
|
||||
|
||||
TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsRenderCompressed) {
|
||||
TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsCompressed) {
|
||||
this->mockSharingFcns->mockTexture3dDesc.MiscFlags = D3DResourceFlags::MISC_SHARED;
|
||||
|
||||
mockGmmResInfo->setUnifiedAuxTranslationCapable();
|
||||
@@ -147,7 +147,7 @@ TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithoutUnifiedAuxFlagsWhenCreati
|
||||
EXPECT_FALSE(gmm->isCompressionEnabled);
|
||||
}
|
||||
|
||||
TYPED_TEST_P(D3DAuxTests, given3dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetRenderCompressed) {
|
||||
TYPED_TEST_P(D3DAuxTests, given3dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetCompressed) {
|
||||
mockGmmResInfo->setUnifiedAuxTranslationCapable();
|
||||
EXPECT_CALL(*this->mockSharingFcns, getTexture3dDesc(_, _)).Times(1).WillOnce(SetArgPointee<0>(this->mockSharingFcns->mockTexture3dDesc));
|
||||
|
||||
@@ -164,14 +164,14 @@ TYPED_TEST_P(D3DAuxTests, given3dNonSharableTextureWithUnifiedAuxFlagsWhenCreati
|
||||
}
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(D3DAuxTests,
|
||||
given2dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsRenderCompressed,
|
||||
given2dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsRenderCompressed,
|
||||
given2dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsCompressed,
|
||||
given2dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsCompressed,
|
||||
given2dSharableTextureWithoutUnifiedAuxFlagsWhenCreatingThenDontMapAuxTable,
|
||||
given2dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetRenderCompressed,
|
||||
given3dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsRenderCompressed,
|
||||
given3dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsRenderCompressed,
|
||||
given2dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetCompressed,
|
||||
given3dSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetAsCompressed,
|
||||
given3dSharableTextureWithUnifiedAuxFlagsWhenFailOnAuxMappingThenDontSetAsCompressed,
|
||||
given3dSharableTextureWithoutUnifiedAuxFlagsWhenCreatingThenDontMapAuxTable,
|
||||
given3dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetRenderCompressed);
|
||||
given3dNonSharableTextureWithUnifiedAuxFlagsWhenCreatingThenMapAuxTableAndSetCompressed);
|
||||
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(D3DSharingTests, D3DAuxTests, D3DTypes);
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenDifferentSizesOfAllocationWhenCheckingCo
|
||||
|
||||
const size_t sizesToCheck[] = {128, 256, 512, 1023, 1024, 1025};
|
||||
for (size_t size : sizesToCheck) {
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForRenderCompression(size, *defaultHwInfo));
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForCompression(size, *defaultHwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ GEN12LPTEST_F(ImageClearColorFixture, givenMcsAllocationWhenSetArgIsCalledWithUn
|
||||
EXPECT_EQ(surfaceState.getAuxiliarySurfaceMode(), AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_MCS_LCE);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(gen12LpImageTests, givenRenderCompressionThenSurfaceStateParamsAreSetForRenderCompression) {
|
||||
GEN12LPTEST_F(gen12LpImageTests, givenCompressionThenSurfaceStateParamsAreSetForCompression) {
|
||||
MockContext context;
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
cl_image_desc imgDesc = Image2dDefaults::imageDesc;
|
||||
|
||||
@@ -970,7 +970,7 @@ TEST_F(GmmCompressionTests, givenNotAllowedRenderCompressionWhenQueryingThenSetA
|
||||
EXPECT_FALSE(queryGmm->isCompressionEnabled);
|
||||
}
|
||||
|
||||
HWTEST_F(GmmCompressionTests, givenNotAllowedRenderCompressionAndEnabledDebugFlagWhenQueryingThenSetAppropriateFlags) {
|
||||
HWTEST_F(GmmCompressionTests, givenNotAllowedCompressionAndEnabledDebugFlagWhenQueryingThenSetAppropriateFlags) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.RenderCompressedImagesEnabled.set(1);
|
||||
localPlatformDevice->capabilityTable.ftrRenderCompressedImages = false;
|
||||
@@ -1073,7 +1073,7 @@ TEST_F(GmmCompressionTests, givenPackedYuvFormatWhenQueryingThenDisallow) {
|
||||
EXPECT_FALSE(queryGmm->isCompressionEnabled);
|
||||
}
|
||||
}
|
||||
HWTEST_F(GmmCompressionTests, whenConstructedWithPreferRenderCompressionFlagThenApplyAuxFlags) {
|
||||
HWTEST_F(GmmCompressionTests, whenConstructedWithPreferCompressionFlagThenApplyAuxFlags) {
|
||||
Gmm gmm1(getGmmClientContext(), nullptr, 1, 0, false);
|
||||
EXPECT_EQ(0u, gmm1.resourceParams.Flags.Info.RenderCompressed);
|
||||
|
||||
|
||||
@@ -38,35 +38,35 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(HwHelperSimpleTest, givenDebugVariableWhenAskingForRenderCompressionThenReturnCorrectValue) {
|
||||
TEST(HwHelperSimpleTest, givenDebugVariableWhenAskingForCompressionThenReturnCorrectValue) {
|
||||
DebugManagerStateRestore restore;
|
||||
HardwareInfo localHwInfo = *defaultHwInfo;
|
||||
|
||||
// debug variable not set
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedBuffers = false;
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedImages = false;
|
||||
EXPECT_FALSE(HwHelper::renderCompressedBuffersSupported(localHwInfo));
|
||||
EXPECT_FALSE(HwHelper::renderCompressedImagesSupported(localHwInfo));
|
||||
EXPECT_FALSE(HwHelper::compressedBuffersSupported(localHwInfo));
|
||||
EXPECT_FALSE(HwHelper::compressedImagesSupported(localHwInfo));
|
||||
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedImages = true;
|
||||
EXPECT_TRUE(HwHelper::renderCompressedBuffersSupported(localHwInfo));
|
||||
EXPECT_TRUE(HwHelper::renderCompressedImagesSupported(localHwInfo));
|
||||
EXPECT_TRUE(HwHelper::compressedBuffersSupported(localHwInfo));
|
||||
EXPECT_TRUE(HwHelper::compressedImagesSupported(localHwInfo));
|
||||
|
||||
// debug variable set
|
||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
||||
DebugManager.flags.RenderCompressedImagesEnabled.set(1);
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedBuffers = false;
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedImages = false;
|
||||
EXPECT_TRUE(HwHelper::renderCompressedBuffersSupported(localHwInfo));
|
||||
EXPECT_TRUE(HwHelper::renderCompressedImagesSupported(localHwInfo));
|
||||
EXPECT_TRUE(HwHelper::compressedBuffersSupported(localHwInfo));
|
||||
EXPECT_TRUE(HwHelper::compressedImagesSupported(localHwInfo));
|
||||
|
||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(0);
|
||||
DebugManager.flags.RenderCompressedImagesEnabled.set(0);
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
localHwInfo.capabilityTable.ftrRenderCompressedImages = true;
|
||||
EXPECT_FALSE(HwHelper::renderCompressedBuffersSupported(localHwInfo));
|
||||
EXPECT_FALSE(HwHelper::renderCompressedImagesSupported(localHwInfo));
|
||||
EXPECT_FALSE(HwHelper::compressedBuffersSupported(localHwInfo));
|
||||
EXPECT_FALSE(HwHelper::compressedImagesSupported(localHwInfo));
|
||||
}
|
||||
|
||||
TEST_F(HwHelperTest, WhenGettingHelperThenValidHelperReturned) {
|
||||
@@ -838,20 +838,20 @@ HWTEST_F(HwHelperTest, givenDebugVariableSetWhenAskingForAuxTranslationModeThenR
|
||||
EXPECT_EQ(AuxTranslationMode::Builtin, HwHelperHw<FamilyType>::getAuxTranslationMode(hwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, givenDebugFlagWhenCheckingIfBufferIsSuitableForRenderCompressionThenReturnCorrectValue) {
|
||||
HWTEST_F(HwHelperTest, givenDebugFlagWhenCheckingIfBufferIsSuitableForCompressionThenReturnCorrectValue) {
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
|
||||
DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(0);
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForRenderCompression(0, *defaultHwInfo));
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForRenderCompression(KB, *defaultHwInfo));
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForRenderCompression(KB + 1, *defaultHwInfo));
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForCompression(0, *defaultHwInfo));
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForCompression(KB, *defaultHwInfo));
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForCompression(KB + 1, *defaultHwInfo));
|
||||
|
||||
DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(1);
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForRenderCompression(0, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForRenderCompression(KB, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForRenderCompression(KB + 1, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForCompression(0, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForCompression(KB, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForCompression(KB + 1, *defaultHwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForTilingSupportThenReturnValidValue) {
|
||||
@@ -1254,7 +1254,7 @@ TEST_F(HwHelperTest, givenGenHelperWhenKernelArgumentIsNotPureStatefulThenRequir
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, whenSetRenderCompressedFlagThenProperFlagSet) {
|
||||
HWTEST_F(HwHelperTest, whenSetCompressedFlagThenProperFlagSet) {
|
||||
auto &hwHelper = HwHelper::get(renderCoreFamily);
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
|
||||
gmm->resourceParams.Flags.Info.RenderCompressed = 0;
|
||||
|
||||
@@ -159,7 +159,7 @@ HWTEST_F(BufferSetArgTest, givenSetArgBufferWithNullArgStatelessThenDontProgramN
|
||||
EXPECT_EQ(memcmp(sshOriginal, surfaceStateHeap, sizeof(surfaceStateHeap)), 0);
|
||||
}
|
||||
|
||||
HWTEST_F(BufferSetArgTest, givenNonPureStatefulArgWhenRenderCompressedBufferIsSetThenSetNonAuxMode) {
|
||||
HWTEST_F(BufferSetArgTest, givenNonPureStatefulArgWhenCompressedBufferIsSetThenSetNonAuxMode) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
|
||||
pKernelInfo->argAsPtr(0).bindful = 0;
|
||||
|
||||
@@ -356,7 +356,7 @@ TEST(Buffer, givenNullptrPassedToBufferCreateWhenAllocationIsNotSystemMemoryPool
|
||||
EXPECT_EQ(hostPtrAllocationCountBefore, hostPtrAllocationCountAfter);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenNullptrPassedToBufferCreateWhenNoSharedContextOrRenderCompressedBuffersThenBuffersAllocationTypeIsBufferOrBufferHostMemory) {
|
||||
TEST(Buffer, givenNullptrPassedToBufferCreateWhenNoSharedContextOrCompressedBuffersThenBuffersAllocationTypeIsBufferOrBufferHostMemory) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
MockContext ctx(device.get());
|
||||
|
||||
@@ -395,7 +395,7 @@ TEST(Buffer, givenHostPtrPassedToBufferCreateWhenMemUseHostPtrFlagisSetAndBuffer
|
||||
alignedFree(ptr);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenAlignedHostPtrPassedToBufferCreateWhenNoSharedContextOrRenderCompressedBuffersThenBuffersAllocationTypeIsBufferHostMemory) {
|
||||
TEST(Buffer, givenAlignedHostPtrPassedToBufferCreateWhenNoSharedContextOrCompressedBuffersThenBuffersAllocationTypeIsBufferHostMemory) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
MockContext ctx(device.get());
|
||||
|
||||
@@ -409,7 +409,7 @@ TEST(Buffer, givenAlignedHostPtrPassedToBufferCreateWhenNoSharedContextOrRenderC
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType());
|
||||
}
|
||||
|
||||
TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrRenderCompressedBuffersThenBuffersAllocationTypeIsBufferHostMemory) {
|
||||
TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrCompressedBuffersThenBuffersAllocationTypeIsBufferHostMemory) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
MockContext ctx(device.get());
|
||||
|
||||
@@ -422,13 +422,13 @@ TEST(Buffer, givenAllocHostPtrFlagPassedToBufferCreateWhenNoSharedContextOrRende
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, buffer->getMultiGraphicsAllocation().getAllocationType());
|
||||
}
|
||||
|
||||
TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturnedIn64Bit) {
|
||||
TEST(Buffer, givenCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturnedIn64Bit) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true);
|
||||
EXPECT_TRUE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -436,13 +436,13 @@ TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenB
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) {
|
||||
TEST(Buffer, givenCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(false, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(false, memoryProperties, context, true);
|
||||
EXPECT_FALSE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true);
|
||||
@@ -456,7 +456,7 @@ TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTy
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = true;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(false, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(false, memoryProperties, context, true);
|
||||
EXPECT_FALSE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -464,13 +464,13 @@ TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTy
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenSharedContextAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
|
||||
TEST(Buffer, givenSharedContextAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = true;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true);
|
||||
EXPECT_TRUE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -485,7 +485,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledWhenAllocationTypeIsQuerie
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(false, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(false, memoryProperties, context, true);
|
||||
EXPECT_FALSE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -500,7 +500,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledWhenAllocationTypeIsQueried
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(false, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(false, memoryProperties, context, true);
|
||||
EXPECT_FALSE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true);
|
||||
@@ -515,7 +515,7 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(false, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(false, memoryProperties, context, true);
|
||||
EXPECT_FALSE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -523,14 +523,14 @@ TEST(Buffer, givenAllocHostPtrFlagWhenAllocationTypeIsQueriedThenBufferTypeIsRet
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true);
|
||||
EXPECT_TRUE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -538,14 +538,14 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryDisabledAndRenderCompressedBuffers
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
|
||||
TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferMemoryTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true);
|
||||
EXPECT_TRUE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true);
|
||||
@@ -560,7 +560,7 @@ TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemory
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true);
|
||||
EXPECT_TRUE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, true);
|
||||
@@ -568,14 +568,14 @@ TEST(Buffer, givenUseHostPointerFlagAndForceSharedPhysicalStorageWhenLocalMemory
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturned) {
|
||||
TEST(Buffer, givenAllocHostPtrFlagAndCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenBufferCompressedTypeIsReturned) {
|
||||
cl_mem_flags flags = CL_MEM_ALLOC_HOST_PTR;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true);
|
||||
EXPECT_TRUE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -583,13 +583,13 @@ TEST(Buffer, givenAllocHostPtrFlagAndRenderCompressedBuffersEnabledWhenAllocatio
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type);
|
||||
}
|
||||
|
||||
TEST(Buffer, givenZeroFlagsNoSharedContextAndRenderCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
|
||||
TEST(Buffer, givenZeroFlagsNoSharedContextAndCompressedBuffersDisabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturned) {
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE;
|
||||
context.isSharedContext = false;
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(false, memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(false, memoryProperties, context, true);
|
||||
EXPECT_FALSE(compressionEnabled);
|
||||
|
||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, context, compressionEnabled, false);
|
||||
@@ -624,7 +624,7 @@ TEST(Buffer, givenClMemCopyHostPointerPassedToBufferCreateWhenAllocationIsNotInS
|
||||
EXPECT_LT(taskCount, taskCountSent);
|
||||
}
|
||||
}
|
||||
struct RenderCompressedBuffersTests : public ::testing::Test {
|
||||
struct CompressedBuffersTests : public ::testing::Test {
|
||||
void SetUp() override {
|
||||
ExecutionEnvironment *executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u);
|
||||
for (auto &rootDeviceEnvironment : executionEnvironment->rootDeviceEnvironments) {
|
||||
@@ -649,7 +649,7 @@ struct RenderCompressedBuffersTests : public ::testing::Test {
|
||||
size_t bufferSize = sizeof(hostPtr);
|
||||
};
|
||||
|
||||
TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyHostPtrWhenCheckingMemoryPropertiesThenUseHostPtrAndDontAllocateStorage) {
|
||||
TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyHostPtrWhenCheckingMemoryPropertiesThenUseHostPtrAndDontAllocateStorage) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = false;
|
||||
|
||||
void *cacheAlignedHostPtr = alignedMalloc(MemoryConstants::cacheLineSize, MemoryConstants::cacheLineSize);
|
||||
@@ -684,14 +684,14 @@ TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationAndZeroCopyH
|
||||
alignedFree(cacheAlignedHostPtr);
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersTests, givenAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedThenItIsZeroCopy) {
|
||||
TEST_F(CompressedBuffersTests, givenAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedThenItIsZeroCopy) {
|
||||
buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, 1u, nullptr, retVal));
|
||||
EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
EXPECT_TRUE(buffer->isMemObjZeroCopy());
|
||||
EXPECT_EQ(1u, buffer->getSize());
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersTests, givenRenderCompressedBuffersAndAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedThenItIsZeroCopy) {
|
||||
TEST_F(CompressedBuffersTests, givenCompressedBuffersAndAllocationCreatedWithForceSharedPhysicalMemoryWhenItIsCreatedThenItIsZeroCopy) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
buffer.reset(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, 1u, nullptr, retVal));
|
||||
EXPECT_EQ(buffer->getGraphicsAllocation(device->getRootDeviceIndex())->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
@@ -699,7 +699,7 @@ TEST_F(RenderCompressedBuffersTests, givenRenderCompressedBuffersAndAllocationCr
|
||||
EXPECT_EQ(1u, buffer->getSize());
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhenCheckingMemoryPropertiesThenForceDisableZeroCopy) {
|
||||
TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhenCheckingMemoryPropertiesThenForceDisableZeroCopy) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = false;
|
||||
|
||||
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
|
||||
@@ -714,7 +714,7 @@ TEST_F(RenderCompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHost
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
|
||||
allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(bufferSize, *hwInfo)) {
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) {
|
||||
EXPECT_FALSE(buffer->isMemObjZeroCopy());
|
||||
EXPECT_EQ(allocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
|
||||
} else {
|
||||
@@ -723,13 +723,13 @@ TEST_F(RenderCompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHost
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationWhenSharedContextIsUsedThenForceDisableCompression) {
|
||||
TEST_F(CompressedBuffersTests, givenBufferCompressedAllocationWhenSharedContextIsUsedThenForceDisableCompression) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
context->isSharedContext = false;
|
||||
|
||||
buffer.reset(Buffer::create(context.get(), CL_MEM_READ_WRITE, bufferSize, nullptr, retVal));
|
||||
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(bufferSize, *hwInfo)) {
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) {
|
||||
EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
|
||||
} else {
|
||||
EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
@@ -740,7 +740,7 @@ TEST_F(RenderCompressedBuffersTests, givenBufferCompressedAllocationWhenSharedCo
|
||||
EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelectOptionFromDebugFlag) {
|
||||
TEST_F(CompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelectOptionFromDebugFlag) {
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = false;
|
||||
@@ -748,7 +748,7 @@ TEST_F(RenderCompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThen
|
||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
||||
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
|
||||
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(bufferSize, *hwInfo)) {
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) {
|
||||
EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
|
||||
} else {
|
||||
EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
@@ -760,7 +760,7 @@ TEST_F(RenderCompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThen
|
||||
EXPECT_NE(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
|
||||
}
|
||||
|
||||
struct RenderCompressedBuffersSvmTests : public RenderCompressedBuffersTests {
|
||||
struct CompressedBuffersSvmTests : public CompressedBuffersTests {
|
||||
void SetUp() override {
|
||||
ExecutionEnvironment *executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u);
|
||||
for (auto &rootDeviceEnvironment : executionEnvironment->rootDeviceEnvironments) {
|
||||
@@ -769,11 +769,11 @@ struct RenderCompressedBuffersSvmTests : public RenderCompressedBuffersTests {
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1u);
|
||||
hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||
hwInfo->capabilityTable.gpuAddressSpace = MemoryConstants::max48BitAddress;
|
||||
RenderCompressedBuffersTests::SetUp(executionEnvironment);
|
||||
CompressedBuffersTests::SetUp(executionEnvironment);
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(RenderCompressedBuffersSvmTests, givenSvmAllocationWhenCreatingBufferThenForceDisableCompression) {
|
||||
TEST_F(CompressedBuffersSvmTests, givenSvmAllocationWhenCreatingBufferThenForceDisableCompression) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
|
||||
auto svmPtr = context->getSVMAllocsManager()->createSVMAlloc(sizeof(uint32_t), {}, context->getRootDeviceIndices(), context->getDeviceBitfields());
|
||||
@@ -785,9 +785,9 @@ TEST_F(RenderCompressedBuffersSvmTests, givenSvmAllocationWhenCreatingBufferThen
|
||||
context->getSVMAllocsManager()->freeSVMAlloc(svmPtr);
|
||||
}
|
||||
|
||||
struct RenderCompressedBuffersCopyHostMemoryTests : public RenderCompressedBuffersTests {
|
||||
struct CompressedBuffersCopyHostMemoryTests : public CompressedBuffersTests {
|
||||
void SetUp() override {
|
||||
RenderCompressedBuffersTests::SetUp();
|
||||
CompressedBuffersTests::SetUp();
|
||||
device->injectMemoryManager(new MockMemoryManager(true, false, *device->getExecutionEnvironment()));
|
||||
context->memoryManager = device->getMemoryManager();
|
||||
mockCmdQ = new MockCommandQueue();
|
||||
@@ -797,7 +797,7 @@ struct RenderCompressedBuffersCopyHostMemoryTests : public RenderCompressedBuffe
|
||||
MockCommandQueue *mockCmdQ = nullptr;
|
||||
};
|
||||
|
||||
TEST_F(RenderCompressedBuffersCopyHostMemoryTests, givenRenderCompressedBufferWhenCopyFromHostPtrIsRequiredThenCallWriteBuffer) {
|
||||
TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenCopyFromHostPtrIsRequiredThenCallWriteBuffer) {
|
||||
if (is32bit) {
|
||||
return;
|
||||
}
|
||||
@@ -805,7 +805,7 @@ TEST_F(RenderCompressedBuffersCopyHostMemoryTests, givenRenderCompressedBufferWh
|
||||
|
||||
buffer.reset(Buffer::create(context.get(), CL_MEM_COPY_HOST_PTR, bufferSize, hostPtr, retVal));
|
||||
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(bufferSize, *hwInfo)) {
|
||||
if (HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) {
|
||||
EXPECT_EQ(graphicsAllocation->getAllocationType(), GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
|
||||
EXPECT_EQ(1u, mockCmdQ->writeBufferCounter);
|
||||
EXPECT_TRUE(mockCmdQ->writeBufferBlocking);
|
||||
@@ -823,17 +823,17 @@ TEST_F(RenderCompressedBuffersCopyHostMemoryTests, givenRenderCompressedBufferWh
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersCopyHostMemoryTests, givenBufferCreateWhenMemoryTransferWithEnqueueWriteBufferThenMapAllocationIsReused) {
|
||||
TEST_F(CompressedBuffersCopyHostMemoryTests, givenBufferCreateWhenMemoryTransferWithEnqueueWriteBufferThenMapAllocationIsReused) {
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
|
||||
auto &capabilityTable = device->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable;
|
||||
capabilityTable.blitterOperationsSupported = false;
|
||||
static_cast<MockMemoryManager *>(context->memoryManager)->forceRenderCompressed = true;
|
||||
static_cast<MockMemoryManager *>(context->memoryManager)->forceCompressed = true;
|
||||
std::unique_ptr<Buffer> buffer(Buffer::create(context.get(), flags, bufferSize, hostPtr, retVal));
|
||||
EXPECT_NE(nullptr, mockCmdQ->writeMapAllocation);
|
||||
EXPECT_EQ(buffer->getMapAllocation(device.get()->getRootDeviceIndex()), mockCmdQ->writeMapAllocation);
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersCopyHostMemoryTests, givenNonRenderCompressedBufferWhenCopyFromHostPtrIsRequiredThenDontCallWriteBuffer) {
|
||||
TEST_F(CompressedBuffersCopyHostMemoryTests, givenNonCompressedBufferWhenCopyFromHostPtrIsRequiredThenDontCallWriteBuffer) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = false;
|
||||
|
||||
buffer.reset(Buffer::create(context.get(), CL_MEM_COPY_HOST_PTR, sizeof(uint32_t), &hostPtr, retVal));
|
||||
@@ -844,8 +844,8 @@ TEST_F(RenderCompressedBuffersCopyHostMemoryTests, givenNonRenderCompressedBuffe
|
||||
EXPECT_EQ(0u, mockCmdQ->writeBufferCounter);
|
||||
}
|
||||
|
||||
TEST_F(RenderCompressedBuffersCopyHostMemoryTests, givenRenderCompressedBufferWhenWriteBufferFailsThenReturnErrorCode) {
|
||||
if (is32bit || !HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForRenderCompression(bufferSize, *hwInfo)) {
|
||||
TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenWriteBufferFailsThenReturnErrorCode) {
|
||||
if (is32bit || !HwHelper::get(context->getDevice(0)->getHardwareInfo().platform.eRenderCoreFamily).isBufferSizeSuitableForCompression(bufferSize, *hwInfo)) {
|
||||
return;
|
||||
}
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
@@ -1707,7 +1707,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, BufferSetSurfaceTests, givenAlignedCacheableNonReadO
|
||||
alignedFree(ptr);
|
||||
}
|
||||
|
||||
HWTEST_F(BufferSetSurfaceTests, givenRenderCompressedGmmResourceWhenSurfaceStateIsProgrammedThenSetAuxParams) {
|
||||
HWTEST_F(BufferSetSurfaceTests, givenCompressedGmmResourceWhenSurfaceStateIsProgrammedThenSetAuxParams) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
||||
|
||||
@@ -1730,7 +1730,7 @@ HWTEST_F(BufferSetSurfaceTests, givenRenderCompressedGmmResourceWhenSurfaceState
|
||||
EXPECT_TRUE(RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT == surfaceState.getCoherencyType());
|
||||
}
|
||||
|
||||
HWTEST_F(BufferSetSurfaceTests, givenNonRenderCompressedGmmResourceWhenSurfaceStateIsProgrammedThenDontSetAuxParams) {
|
||||
HWTEST_F(BufferSetSurfaceTests, givenNonCompressedGmmResourceWhenSurfaceStateIsProgrammedThenDontSetAuxParams) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class ImageCompressionTests : public ::testing::Test {
|
||||
using MockMemoryManager::MockMemoryManager;
|
||||
GraphicsAllocation *allocateGraphicsMemoryForImage(const AllocationData &allocationData) override {
|
||||
mockMethodCalled = true;
|
||||
capturedPreferCompressed = allocationData.flags.preferRenderCompressed;
|
||||
capturedPreferCompressed = allocationData.flags.preferCompressed;
|
||||
return OsAgnosticMemoryManager::allocateGraphicsMemoryForImage(allocationData);
|
||||
}
|
||||
bool mockMethodCalled = false;
|
||||
|
||||
@@ -608,7 +608,7 @@ HWTEST_F(ImageSetArgTest, givenMultisampledR32Floatx8x24DepthStencilFormatWhenSe
|
||||
RENDER_SURFACE_STATE::MULTISAMPLED_SURFACE_STORAGE_FORMAT::MULTISAMPLED_SURFACE_STORAGE_FORMAT_MSS);
|
||||
}
|
||||
|
||||
HWTEST_F(ImageSetArgTest, givenMcsAllocationAndRenderCompressionWhenSetArgOnMultisampledImgIsCalledThenProgramAuxFieldsWithMcsParams) {
|
||||
HWTEST_F(ImageSetArgTest, givenMcsAllocationAndCompressionWhenSetArgOnMultisampledImgIsCalledThenProgramAuxFieldsWithMcsParams) {
|
||||
typedef typename FamilyType::RENDER_SURFACE_STATE RENDER_SURFACE_STATE;
|
||||
McsSurfaceInfo msi = {10, 20, 3};
|
||||
auto mcsAlloc = context->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
@@ -638,7 +638,7 @@ HWTEST_F(ImageSetArgTest, givenMcsAllocationAndRenderCompressionWhenSetArgOnMult
|
||||
EXPECT_EQ(mcsAlloc->getGpuAddress(), surfaceState->getAuxiliarySurfaceBaseAddress());
|
||||
}
|
||||
|
||||
HWTEST_F(ImageSetArgTest, givenDepthFormatAndRenderCompressionWhenSetArgOnMultisampledImgIsCalledThenDontProgramAuxFields) {
|
||||
HWTEST_F(ImageSetArgTest, givenDepthFormatAndCompressionWhenSetArgOnMultisampledImgIsCalledThenDontProgramAuxFields) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
||||
|
||||
@@ -875,7 +875,7 @@ HWTEST_F(ImageSetArgTest, WhenSettingArgThenImageIsReturned) {
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(ImageSetArgTest, givenRenderCompressedResourceWhenSettingImgArgThenSetCorrectAuxParams) {
|
||||
HWTEST_F(ImageSetArgTest, givenCompressedResourceWhenSettingImgArgThenSetCorrectAuxParams) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
||||
|
||||
@@ -890,7 +890,7 @@ HWTEST_F(ImageSetArgTest, givenRenderCompressedResourceWhenSettingImgArgThenSetC
|
||||
EXPECT_EQ(0u, surfaceState.getAuxiliarySurfaceQpitch());
|
||||
}
|
||||
|
||||
HWTEST_F(ImageSetArgTest, givenNonRenderCompressedResourceWhenSettingImgArgThenDontSetAuxParams) {
|
||||
HWTEST_F(ImageSetArgTest, givenNonCompressedResourceWhenSettingImgArgThenDontSetAuxParams) {
|
||||
typedef typename FamilyType::RENDER_SURFACE_STATE RENDER_SURFACE_STATE;
|
||||
typedef typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE AUXILIARY_SURFACE_MODE;
|
||||
auto surfaceState = FamilyType::cmdInitRenderSurfaceState;
|
||||
|
||||
@@ -1143,7 +1143,7 @@ TEST(ImageGetSurfaceFormatInfoTest, givenNullptrFormatWhenGetSurfaceFormatInfoIs
|
||||
EXPECT_EQ(nullptr, surfaceFormat);
|
||||
}
|
||||
|
||||
HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferRenderCompression) {
|
||||
HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferCompression) {
|
||||
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
imageDesc.image_width = 5;
|
||||
imageDesc.image_height = 5;
|
||||
@@ -1159,7 +1159,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferR
|
||||
EXPECT_EQ(UnitTestHelper<FamilyType>::tiledImagesSupported, myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
|
||||
TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPreferRenderCompression) {
|
||||
TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPreferCompression) {
|
||||
imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D;
|
||||
imageDesc.image_width = 5;
|
||||
MockContext context;
|
||||
@@ -1174,7 +1174,7 @@ TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPr
|
||||
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
|
||||
HWTEST_F(ImageCompressionTests, givenTiledImageAndVariousFlagsWhenCreatingAllocationThenCorrectlySetPreferRenderCompression) {
|
||||
HWTEST_F(ImageCompressionTests, givenTiledImageAndVariousFlagsWhenCreatingAllocationThenCorrectlySetPreferCompression) {
|
||||
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
imageDesc.image_width = 5;
|
||||
imageDesc.image_height = 5;
|
||||
@@ -1203,7 +1203,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageAndVariousFlagsWhenCreatingAlloca
|
||||
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
|
||||
TEST_F(ImageCompressionTests, givenNonTiledImageAndVariousFlagsWhenCreatingAllocationThenDontPreferRenderCompression) {
|
||||
TEST_F(ImageCompressionTests, givenNonTiledImageAndVariousFlagsWhenCreatingAllocationThenDontPreferCompression) {
|
||||
imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D;
|
||||
imageDesc.image_width = 5;
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@ HWTEST2_F(XeHPAndLaterImageTests, givenMediaCompressionWhenAppendingNewAllocatio
|
||||
EXPECT_EQ(surfaceState.getAuxiliarySurfaceMode(), RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
}
|
||||
|
||||
HWTEST2_F(XeHPAndLaterImageTests, givenRenderCompressionWhenAppendingNewAllocationThenNotZeroIsSetAsCompressionType, CompressionParamsSupportedMatcher) {
|
||||
HWTEST2_F(XeHPAndLaterImageTests, givenCompressionWhenAppendingNewAllocationThenNotZeroIsSetAsCompressionType, CompressionParamsSupportedMatcher) {
|
||||
MockContext context;
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
auto hwInfo = defaultHwInfo.get();
|
||||
@@ -686,7 +686,7 @@ HWTEST2_F(XeHPAndLaterImageHelperTests, givenAuxModeMcsLceWhenAppendingSurfaceSt
|
||||
EXPECT_EQ(expectedGetMediaSurfaceStateCompressionFormatCalled, gmmClientContext->getMediaSurfaceStateCompressionFormatCalled);
|
||||
}
|
||||
|
||||
HWTEST2_F(ImageCompressionTests, givenXeHpCoreAndRedescribableFormatWhenCreatingAllocationThenDoNotPreferRenderCompression, IsXeHpCore) {
|
||||
HWTEST2_F(ImageCompressionTests, givenXeHpCoreAndRedescribableFormatWhenCreatingAllocationThenDoNotPreferCompression, IsXeHpCore) {
|
||||
MockContext context{};
|
||||
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
imageDesc.image_width = 5;
|
||||
|
||||
@@ -160,11 +160,11 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
|
||||
}
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenContextWithMultipleRootDevicesWhenIsSuitableForRenderCompressionIsCalledThenFalseIsReturned) {
|
||||
TEST(MemObjHelper, givenContextWithMultipleRootDevicesWhenIsSuitableForCompressionIsCalledThenFalseIsReturned) {
|
||||
MockDefaultContext context;
|
||||
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.pRootDevice0->getDevice());
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenCompressionEnabledButNotPreferredWhenCompressionHintIsPassedThenCompressionIsUsed) {
|
||||
@@ -174,15 +174,15 @@ TEST(MemObjHelper, givenCompressionEnabledButNotPreferredWhenCompressionHintIsPa
|
||||
MemoryProperties memoryProperties =
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_DEFAULT;
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, false));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, false));
|
||||
flags = CL_MEM_COMPRESSED_HINT_INTEL;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, false));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, false));
|
||||
flagsIntel = CL_MEM_COMPRESSED_HINT_INTEL;
|
||||
flags = 0;
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, false));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, false));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenCompressionHintIsPassedThenCompressionIsUsed) {
|
||||
@@ -192,33 +192,33 @@ TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenCompressionHintIsPasse
|
||||
MemoryProperties memoryProperties =
|
||||
ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_DEFAULT;
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
flags = CL_MEM_COMPRESSED_HINT_INTEL;
|
||||
flagsIntel = 0;
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
flagsIntel = CL_MEM_COMPRESSED_HINT_INTEL;
|
||||
flags = 0;
|
||||
memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenRenderCompressionWhenCL_MEM_COMPRESSEDIsNotSetThenFalseReturned) {
|
||||
TEST(MemObjHelper, givenCompressionWhenCL_MEM_COMPRESSEDIsNotSetThenFalseReturned) {
|
||||
cl_mem_flags_intel flagsIntel = 0;
|
||||
cl_mem_flags flags = 0;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_DEFAULT;
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, false));
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, false));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenRenderCompressionWhenCL_MEM_COMPRESSEDThenTrueIsReturned) {
|
||||
TEST(MemObjHelper, givenCompressionWhenCL_MEM_COMPRESSEDThenTrueIsReturned) {
|
||||
cl_mem_flags_intel flagsIntel = CL_MEM_COMPRESSED_HINT_INTEL;
|
||||
cl_mem_flags flags = CL_MEM_COMPRESSED_HINT_INTEL;
|
||||
MockContext context;
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel, 0, &context.getDevice(0)->getDevice());
|
||||
context.contextType = ContextType::CONTEXT_TYPE_DEFAULT;
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelperMultiTile, givenValidExtraPropertiesWhenValidatingExtraPropertiesThenTrueIsReturned) {
|
||||
@@ -281,9 +281,9 @@ TEST(MemObjHelper, givenMultipleSubDevicesWhenDefaultContextIsUsedThenResourcesA
|
||||
MockContext context(platform()->getClDevice(0));
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_ONLY, 0u, 0, &context.getDevice(0)->getDevice());
|
||||
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
memoryProperties.flags.hostNoAccess = true;
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextRequiresResolveThenResourceNotSuitableForCompression) {
|
||||
@@ -293,7 +293,7 @@ TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextRequiresResolve
|
||||
context.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED;
|
||||
context.resolvesRequiredInKernels = true;
|
||||
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextNotRequiresResolveThenResourceSuitableForCompression) {
|
||||
@@ -303,7 +303,7 @@ TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextNotRequiresReso
|
||||
context.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED;
|
||||
context.resolvesRequiredInKernels = false;
|
||||
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextNotRequiresResolveAndForceHintDisableCompressionThenResourceNotSuitableForCompression) {
|
||||
@@ -316,7 +316,7 @@ TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextNotRequiresReso
|
||||
context.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED;
|
||||
context.resolvesRequiredInKernels = false;
|
||||
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_FALSE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextRequiresResolveAndForceHintEnableCompressionThenResourceSuitableForCompression) {
|
||||
@@ -329,7 +329,7 @@ TEST(MemObjHelper, givenCompressionEnabledAndPreferredWhenContextRequiresResolve
|
||||
context.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED;
|
||||
context.resolvesRequiredInKernels = true;
|
||||
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||
EXPECT_TRUE(MemObjHelper::isSuitableForCompression(true, memoryProperties, context, true));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenDifferentCapabilityAndDebugFlagValuesWhenCheckingBufferCompressionSupportThenCorrectValueIsReturned) {
|
||||
@@ -347,13 +347,13 @@ TEST(MemObjHelper, givenDifferentCapabilityAndDebugFlagValuesWhenCheckingBufferC
|
||||
auto &device = context.getDevice(0)->getDevice();
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &device);
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(HwHelper::renderCompressedBuffersSupported(*defaultHwInfo), memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(HwHelper::compressedBuffersSupported(*defaultHwInfo), memoryProperties, context, true);
|
||||
|
||||
auto allocationType = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(
|
||||
memoryProperties, context, compressionEnabled, false);
|
||||
|
||||
bool expectBufferCompressed = ftrRenderCompressedBuffers && (enableMultiTileCompressionValue == 1);
|
||||
if (expectBufferCompressed && clHwHelper.allowRenderCompressionForContext(*context.getDevice(0), context)) {
|
||||
if (expectBufferCompressed && clHwHelper.allowCompressionForContext(*context.getDevice(0), context)) {
|
||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, allocationType);
|
||||
} else {
|
||||
EXPECT_NE(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, allocationType);
|
||||
@@ -409,7 +409,7 @@ TEST(MemObjHelper, givenDifferentValuesWhenCheckingBufferCompressionSupportThenC
|
||||
MemoryProperties memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(flags, flagsIntel,
|
||||
0, &device);
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForRenderCompression(HwHelper::renderCompressedBuffersSupported(*defaultHwInfo), memoryProperties, context, true);
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(HwHelper::compressedBuffersSupported(*defaultHwInfo), memoryProperties, context, true);
|
||||
auto allocationType = MockPublicAccessBuffer::getGraphicsAllocationTypeAndCompressionPreference(
|
||||
memoryProperties, context, compressionEnabled, false);
|
||||
|
||||
@@ -420,7 +420,7 @@ TEST(MemObjHelper, givenDifferentValuesWhenCheckingBufferCompressionSupportThenC
|
||||
bool isMultiTile = (numSubDevices > 1);
|
||||
if (expectBufferCompressed && isMultiTile) {
|
||||
bool isBufferReadOnly = isValueSet(flags, CL_MEM_READ_ONLY | CL_MEM_HOST_NO_ACCESS);
|
||||
expectBufferCompressed = clHwHelper.allowRenderCompressionForContext(*context.getDevice(0), context) &&
|
||||
expectBufferCompressed = clHwHelper.allowCompressionForContext(*context.getDevice(0), context) &&
|
||||
((contextType == ContextType::CONTEXT_TYPE_SPECIALIZED) || isBufferReadOnly);
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ TEST(MemObj, givenTiledObjectWhenAskedForCpuMappingThenReturnFalse) {
|
||||
EXPECT_FALSE(memObj.mappingOnCpuAllowed());
|
||||
}
|
||||
|
||||
TEST(MemObj, givenRenderCompressedGmmWhenAskingForMappingOnCpuThenDisallow) {
|
||||
TEST(MemObj, givenCompressedGmmWhenAskingForMappingOnCpuThenDisallow) {
|
||||
MockContext context;
|
||||
MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment());
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, givenAllocatio
|
||||
EXPECT_EQ(allocType, allocData.type);
|
||||
}
|
||||
|
||||
TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, given64kbAllowedAllocationTypeWhenAllocatingThenPreferRenderCompressionOnlyForSpecificTypes) {
|
||||
TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, given64kbAllowedAllocationTypeWhenAllocatingThenPreferCompressionOnlyForSpecificTypes) {
|
||||
auto allocType = GetParam();
|
||||
AllocationData allocData;
|
||||
AllocationProperties properties(mockRootDeviceIndex, 10, allocType, mockDeviceBitfield);
|
||||
@@ -258,7 +258,7 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, given64kbAllow
|
||||
auto allocation = mockMemoryManager.allocateGraphicsMemory(allocData);
|
||||
|
||||
EXPECT_TRUE(mockMemoryManager.allocation64kbPageCreated);
|
||||
EXPECT_EQ(mockMemoryManager.preferRenderCompressedFlagPassed, bufferCompressedType);
|
||||
EXPECT_EQ(mockMemoryManager.preferCompressedFlagPassed, bufferCompressedType);
|
||||
|
||||
mockMemoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
@@ -1005,7 +1005,7 @@ TEST(OsAgnosticMemoryManager, givenCompressionEnabledWhenAllocateGraphicsMemoryW
|
||||
AllocationData allocationData;
|
||||
allocationData.size = 4096u;
|
||||
allocationData.alignment = MemoryConstants::pageSize;
|
||||
allocationData.flags.preferRenderCompressed = true;
|
||||
allocationData.flags.preferCompressed = true;
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithAlignment(allocationData);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(MemoryPool::System4KBPages, allocation->getMemoryPool());
|
||||
@@ -1038,7 +1038,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesEnabledAndCompressi
|
||||
AllocationData allocationData;
|
||||
allocationData.size = 4096u;
|
||||
allocationData.alignment = MemoryConstants::pageSize;
|
||||
allocationData.flags.preferRenderCompressed = true;
|
||||
allocationData.flags.preferCompressed = true;
|
||||
auto allocation = memoryManager.allocateGraphicsMemory64kb(allocationData);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(MemoryPool::System64KBPages, allocation->getMemoryPool());
|
||||
|
||||
@@ -204,11 +204,11 @@ TEST_F(SVMMemoryAllocatorTest, whenCouldNotAllocateInMemoryManagerThenCreateUnif
|
||||
svmManager->freeSVMAlloc(ptr);
|
||||
}
|
||||
|
||||
TEST_F(SVMMemoryAllocatorTest, given64kbAllowedWhenAllocatingSvmMemoryThenDontPreferRenderCompression) {
|
||||
TEST_F(SVMMemoryAllocatorTest, given64kbAllowedWhenAllocatingSvmMemoryThenDontPreferCompression) {
|
||||
MockMemoryManager memoryManager64Kb(true, false, executionEnvironment);
|
||||
svmManager->memoryManager = &memoryManager64Kb;
|
||||
auto ptr = svmManager->createSVMAlloc(MemoryConstants::pageSize, {}, rootDeviceIndices, deviceBitfields);
|
||||
EXPECT_FALSE(memoryManager64Kb.preferRenderCompressedFlagPassed);
|
||||
EXPECT_FALSE(memoryManager64Kb.preferCompressedFlagPassed);
|
||||
svmManager->freeSVMAlloc(ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HwInfoConfigTest, givenHwInfoConfigWhenAdditionalKer
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
EXPECT_TRUE(hwInfoConfig.allowRenderCompression(pInHwInfo));
|
||||
EXPECT_TRUE(hwInfoConfig.allowCompression(pInHwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, WhenAllowStatelessCompressionIsCalledThenReturnCorrectValue) {
|
||||
|
||||
@@ -86,7 +86,7 @@ TEST_F(Wddm20Tests, GivenExisitingContextWhenInitializingWddmThenCreateContextRe
|
||||
EXPECT_EQ(1u, wddm->createContextResult.called);
|
||||
}
|
||||
|
||||
TEST_F(Wddm20Tests, givenNullPageTableManagerAndRenderCompressedResourceWhenMappingGpuVaThenDontUpdateAuxTable) {
|
||||
TEST_F(Wddm20Tests, givenNullPageTableManagerAndCompressedResourceWhenMappingGpuVaThenDontUpdateAuxTable) {
|
||||
auto gmm = std::unique_ptr<Gmm>(new Gmm(getGmmClientContext(), nullptr, 1, 0, false));
|
||||
auto mockGmmRes = reinterpret_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get());
|
||||
mockGmmRes->setUnifiedAuxTranslationCapable();
|
||||
|
||||
@@ -451,7 +451,7 @@ TEST_F(WddmMemoryManagerSimpleTestWithLocalMemory, givenLocalMemoryAndImageOrSha
|
||||
AllocationData allocData;
|
||||
allocData.allFlags = 0;
|
||||
allocData.size = MemoryConstants::pageSize;
|
||||
allocData.flags.preferRenderCompressed = true;
|
||||
allocData.flags.preferCompressed = true;
|
||||
|
||||
allocData.imgInfo = &imgInfo;
|
||||
|
||||
|
||||
@@ -1846,7 +1846,7 @@ TEST_F(MockWddmMemoryManagerTest, givenPageTableManagerWhenMapAuxGpuVaCalledThen
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenMappedGpuVaAndPageTableNotSupportedThenMapAuxVa) {
|
||||
TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationWhenMappedGpuVaAndPageTableNotSupportedThenMapAuxVa) {
|
||||
if (HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
@@ -1879,7 +1879,7 @@ TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenMappedGpuVa
|
||||
EXPECT_EQ(GmmHelper::canonize(wddm.getGfxPartition().Standard.Base), gpuVa);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenMappedGpuVaAndPageTableSupportedThenMapAuxVa) {
|
||||
TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationWhenMappedGpuVaAndPageTableSupportedThenMapAuxVa) {
|
||||
if (!HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
@@ -1922,7 +1922,7 @@ TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationWhenMappedGpuVa
|
||||
EXPECT_TRUE(memcmp(&expectedDdiUpdateAuxTable, &givenDdiUpdateAuxTable, sizeof(GMM_DDI_UPDATEAUXTABLE)) == 0);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationAndPageTableSupportedWhenReleaseingThenUnmapAuxVa) {
|
||||
TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationAndPageTableSupportedWhenReleaseingThenUnmapAuxVa) {
|
||||
if (!HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
@@ -1962,7 +1962,7 @@ TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedAllocationAndPageTableSup
|
||||
EXPECT_TRUE(memcmp(&expectedDdiUpdateAuxTable, &givenDdiUpdateAuxTable, sizeof(GMM_DDI_UPDATEAUXTABLE)) == 0);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenNonRenderCompressedAllocationWhenReleaseingThenDontUnmapAuxVa) {
|
||||
TEST_F(MockWddmMemoryManagerTest, givenNonCompressedAllocationWhenReleaseingThenDontUnmapAuxVa) {
|
||||
wddm->init();
|
||||
WddmMemoryManager memoryManager(*executionEnvironment);
|
||||
|
||||
@@ -1987,7 +1987,7 @@ TEST_F(MockWddmMemoryManagerTest, givenNonRenderCompressedAllocationWhenReleasei
|
||||
memoryManager.freeGraphicsMemory(wddmAlloc);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenNonRenderCompressedAllocationWhenMappedGpuVaThenDontMapAuxVa) {
|
||||
TEST_F(MockWddmMemoryManagerTest, givenNonCompressedAllocationWhenMappedGpuVaThenDontMapAuxVa) {
|
||||
auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[1].get();
|
||||
std::unique_ptr<Gmm> gmm(new Gmm(rootDeviceEnvironment->getGmmClientContext(), reinterpret_cast<void *>(123), 4096u, 0, false));
|
||||
gmm->isCompressionEnabled = false;
|
||||
@@ -2026,7 +2026,7 @@ TEST_F(MockWddmMemoryManagerTest, givenFailingAllocationWhenMappedGpuVaThenRetur
|
||||
ASSERT_FALSE(result);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedFlagSetWhenInternalIsUnsetThenDontUpdateAuxTable) {
|
||||
TEST_F(MockWddmMemoryManagerTest, givenCompressedFlagSetWhenInternalIsUnsetThenDontUpdateAuxTable) {
|
||||
D3DGPU_VIRTUAL_ADDRESS gpuVa = 0;
|
||||
wddm->init();
|
||||
WddmMemoryManager memoryManager(*executionEnvironment);
|
||||
@@ -2060,7 +2060,7 @@ TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedFlagSetWhenInternalIsUnse
|
||||
memoryManager.freeGraphicsMemory(wddmAlloc);
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenRenderCompressedFlagSetWhenInternalIsSetThenUpdateAuxTable) {
|
||||
TEST_F(MockWddmMemoryManagerTest, givenCompressedFlagSetWhenInternalIsSetThenUpdateAuxTable) {
|
||||
if (!HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferPolicy, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenBufferSetSurfaceThatMemoryIsUnalignedToCachelineButReadOnlyThenL3CacheShouldBeStillOn, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowCompressionIsCalledThenTrueIsReturned, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfExtraParametersAreInvalidThenFalseIsReturned, IGFX_XE_HP_CORE);
|
||||
|
||||
@@ -64,7 +64,7 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXE_HP_COREWhenEnableStatelessComp
|
||||
EXPECT_FALSE(clHwHelper.requiresAuxResolves(kernelInfo, *defaultHwInfo));
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenDifferentBufferSizesWhenEnableStatelessCompressionThenEveryBufferSizeIsSuitableForRenderCompression) {
|
||||
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenDifferentBufferSizesWhenEnableStatelessCompressionThenEveryBufferSizeIsSuitableForCompression) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
@@ -72,7 +72,7 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenDifferentBufferSizesWhenEnableSta
|
||||
|
||||
const size_t sizesToCheck[] = {1, 128, 256, 1024, 2048};
|
||||
for (size_t size : sizesToCheck) {
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForRenderCompression(size, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForCompression(size, *defaultHwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,15 +94,15 @@ XEHPTEST_F(XeHPHwInfoConfig, givenA0OrA1SteppingWhenAskingIfExtraParametersAreIn
|
||||
|
||||
using XeHPHwHelperTest = HwHelperTest;
|
||||
|
||||
XEHPTEST_F(XeHPHwHelperTest, givenXeHPMultiConfigWhenAllowRenderCompressionIsCalledThenCorrectValueIsReturned) {
|
||||
XEHPTEST_F(XeHPHwHelperTest, givenXeHPMultiConfigWhenAllowCompressionIsCalledThenCorrectValueIsReturned) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
hwInfo.gtSystemInfo.EUCount = 512u;
|
||||
EXPECT_TRUE(hwInfoConfig->allowRenderCompression(hwInfo));
|
||||
EXPECT_TRUE(hwInfoConfig->allowCompression(hwInfo));
|
||||
|
||||
hwInfo.gtSystemInfo.EUCount = 256u;
|
||||
EXPECT_FALSE(hwInfoConfig->allowRenderCompression(hwInfo));
|
||||
EXPECT_FALSE(hwInfoConfig->allowCompression(hwInfo));
|
||||
}
|
||||
|
||||
XEHPTEST_F(XeHPHwInfoConfig, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "test.h"
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(HwHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowCompressionIsCalledThenTrueIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHardwareInfoWhenCallingIsAdditionalStateBaseAddressWARequiredThenFalseIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedForDefaultEngineTypeAdjustmentThenFalseIsReturned, IGFX_DG2);
|
||||
|
||||
@@ -65,7 +65,7 @@ XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenGenHelperWhenEnableStatelessCompre
|
||||
EXPECT_FALSE(clHwHelper.requiresAuxResolves(kernelInfo, *defaultHwInfo));
|
||||
}
|
||||
|
||||
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenDifferentBufferSizesWhenEnableStatelessCompressionThenEveryBufferSizeIsSuitableForRenderCompression) {
|
||||
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenDifferentBufferSizesWhenEnableStatelessCompressionThenEveryBufferSizeIsSuitableForCompression) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
@@ -73,7 +73,7 @@ XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenDifferentBufferSizesWhenEnableStat
|
||||
|
||||
const size_t sizesToCheck[] = {1, 128, 256, 1024, 2048};
|
||||
for (size_t size : sizesToCheck) {
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForRenderCompression(size, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForCompression(size, *defaultHwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenDebugFlagWhenCheckingIfBufferIsSui
|
||||
|
||||
for (size_t size : sizesToCheck) {
|
||||
if (debugFlag == 1) {
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForRenderCompression(size, *defaultHwInfo));
|
||||
EXPECT_TRUE(helper.isBufferSizeSuitableForCompression(size, *defaultHwInfo));
|
||||
} else {
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForRenderCompression(size, *defaultHwInfo));
|
||||
EXPECT_FALSE(helper.isBufferSizeSuitableForCompression(size, *defaultHwInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ XE_HPG_CORETEST_F(ImageCompressionTests, GivenDifferentImageFormatsWhenCreatingI
|
||||
}
|
||||
}
|
||||
|
||||
XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAllocationThenDoNotPreferRenderCompression) {
|
||||
XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAllocationThenDoNotPreferCompression) {
|
||||
MockContext context{};
|
||||
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
imageDesc.image_width = 5;
|
||||
|
||||
@@ -54,7 +54,7 @@ bool HwHelperHw<Family>::isLocalMemoryEnabled(const HardwareInfo &hwInfo) const
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
|
||||
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
namespace NEO {
|
||||
Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable) : Gmm(clientContext, alignedPtr, alignedSize, alignment, uncacheable, false, true, {}) {}
|
||||
|
||||
Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferRenderCompressed, bool systemMemoryPool, StorageInfo storageInfo)
|
||||
: Gmm(clientContext, alignedPtr, alignedSize, alignment, uncacheable, preferRenderCompressed, systemMemoryPool, storageInfo, true) {
|
||||
Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferCompressed, bool systemMemoryPool, StorageInfo storageInfo)
|
||||
: Gmm(clientContext, alignedPtr, alignedSize, alignment, uncacheable, preferCompressed, systemMemoryPool, storageInfo, true) {
|
||||
}
|
||||
|
||||
Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferRenderCompressed, bool systemMemoryPool, StorageInfo storageInfo, bool allowLargePages) : clientContext(clientContext) {
|
||||
Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferCompressed, bool systemMemoryPool, StorageInfo storageInfo, bool allowLargePages) : clientContext(clientContext) {
|
||||
resourceParams.Type = RESOURCE_BUFFER;
|
||||
resourceParams.Format = GMM_FORMAT_GENERIC_8BIT;
|
||||
resourceParams.BaseWidth64 = static_cast<uint64_t>(alignedSize);
|
||||
@@ -58,7 +58,7 @@ Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t aligned
|
||||
resourceParams.Flags.Gpu.NoRestriction = 1;
|
||||
}
|
||||
|
||||
applyAuxFlagsForBuffer(preferRenderCompressed);
|
||||
applyAuxFlagsForBuffer(preferCompressed);
|
||||
applyMemoryFlags(systemMemoryPool, storageInfo);
|
||||
applyAppResource(storageInfo);
|
||||
applyDebugOverrides();
|
||||
@@ -73,9 +73,9 @@ Gmm::Gmm(GmmClientContext *clientContext, GMM_RESOURCE_INFO *inputGmm) : clientC
|
||||
|
||||
Gmm::~Gmm() = default;
|
||||
|
||||
Gmm::Gmm(GmmClientContext *clientContext, ImageInfo &inputOutputImgInfo, StorageInfo storageInfo, bool preferRenderCompressed) : clientContext(clientContext) {
|
||||
Gmm::Gmm(GmmClientContext *clientContext, ImageInfo &inputOutputImgInfo, StorageInfo storageInfo, bool preferCompressed) : clientContext(clientContext) {
|
||||
this->resourceParams = {};
|
||||
setupImageResourceParams(inputOutputImgInfo, preferRenderCompressed);
|
||||
setupImageResourceParams(inputOutputImgInfo, preferCompressed);
|
||||
applyMemoryFlags(!inputOutputImgInfo.useLocalMemory, storageInfo);
|
||||
applyAppResource(storageInfo);
|
||||
applyDebugOverrides();
|
||||
@@ -86,7 +86,7 @@ Gmm::Gmm(GmmClientContext *clientContext, ImageInfo &inputOutputImgInfo, Storage
|
||||
queryImageParams(inputOutputImgInfo);
|
||||
}
|
||||
|
||||
void Gmm::setupImageResourceParams(ImageInfo &imgInfo, bool preferRenderCompressed) {
|
||||
void Gmm::setupImageResourceParams(ImageInfo &imgInfo, bool preferCompressed) {
|
||||
uint64_t imageWidth = static_cast<uint64_t>(imgInfo.imgDesc.imageWidth);
|
||||
uint32_t imageHeight = 1;
|
||||
uint32_t imageDepth = 1;
|
||||
@@ -138,16 +138,16 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo, bool preferRenderCompress
|
||||
resourceParams.Flags.Info.AllowVirtualPadding = true;
|
||||
}
|
||||
|
||||
applyAuxFlagsForImage(imgInfo, preferRenderCompressed);
|
||||
applyAuxFlagsForImage(imgInfo, preferCompressed);
|
||||
}
|
||||
|
||||
void Gmm::applyAuxFlagsForBuffer(bool preferRenderCompression) {
|
||||
void Gmm::applyAuxFlagsForBuffer(bool preferCompression) {
|
||||
auto hardwareInfo = clientContext->getHardwareInfo();
|
||||
bool allowRenderCompression = HwHelper::renderCompressedBuffersSupported(*hardwareInfo) &&
|
||||
preferRenderCompression;
|
||||
bool allowCompression = HwHelper::compressedBuffersSupported(*hardwareInfo) &&
|
||||
preferCompression;
|
||||
|
||||
auto &hwHelper = HwHelper::get(hardwareInfo->platform.eRenderCoreFamily);
|
||||
if (allowRenderCompression) {
|
||||
if (allowCompression) {
|
||||
hwHelper.applyRenderCompressionFlag(*this, 1);
|
||||
resourceParams.Flags.Gpu.CCS = 1;
|
||||
resourceParams.Flags.Gpu.UnifiedAuxSurface = 1;
|
||||
@@ -156,7 +156,7 @@ void Gmm::applyAuxFlagsForBuffer(bool preferRenderCompression) {
|
||||
hwHelper.applyAdditionalCompressionSettings(*this, !isCompressionEnabled);
|
||||
}
|
||||
|
||||
void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo, bool preferRenderCompressed) {
|
||||
void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo, bool preferCompressed) {
|
||||
uint8_t compressionFormat;
|
||||
if (this->resourceParams.Flags.Info.MediaCompressed) {
|
||||
compressionFormat = clientContext->getMediaSurfaceStateCompressionFormat(imgInfo.surfaceFormat->GMMSurfaceFormat);
|
||||
@@ -178,16 +178,16 @@ void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo, bool preferRenderCompressed)
|
||||
|
||||
auto hwInfo = clientContext->getHardwareInfo();
|
||||
|
||||
bool allowRenderCompression = HwHelper::renderCompressedImagesSupported(*hwInfo) &&
|
||||
preferRenderCompressed &&
|
||||
compressionFormatSupported &&
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat != GMM_RESOURCE_FORMAT::GMM_FORMAT_NV12 &&
|
||||
imgInfo.plane == GMM_YUV_PLANE_ENUM::GMM_NO_PLANE &&
|
||||
!isPackedYuv;
|
||||
bool allowCompression = HwHelper::compressedImagesSupported(*hwInfo) &&
|
||||
preferCompressed &&
|
||||
compressionFormatSupported &&
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat != GMM_RESOURCE_FORMAT::GMM_FORMAT_NV12 &&
|
||||
imgInfo.plane == GMM_YUV_PLANE_ENUM::GMM_NO_PLANE &&
|
||||
!isPackedYuv;
|
||||
|
||||
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
|
||||
if (imgInfo.useLocalMemory || !hwInfo->featureTable.flags.ftrLocalMemory) {
|
||||
if (allowRenderCompression) {
|
||||
if (allowCompression) {
|
||||
hwHelper.applyRenderCompressionFlag(*this, 1);
|
||||
this->resourceParams.Flags.Gpu.CCS = 1;
|
||||
this->resourceParams.Flags.Gpu.UnifiedAuxSurface = 1;
|
||||
|
||||
@@ -24,15 +24,15 @@ class Gmm {
|
||||
public:
|
||||
virtual ~Gmm();
|
||||
Gmm() = delete;
|
||||
Gmm(GmmClientContext *clientContext, ImageInfo &inputOutputImgInfo, StorageInfo storageInfo, bool preferRenderCompressed);
|
||||
Gmm(GmmClientContext *clientContext, ImageInfo &inputOutputImgInfo, StorageInfo storageInfo, bool preferCompressed);
|
||||
Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable);
|
||||
Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferRenderCompressed, bool systemMemoryPool, StorageInfo storageInfo);
|
||||
Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferRenderCompressed, bool systemMemoryPool, StorageInfo storageInfo, bool allowLargePages);
|
||||
Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferCompressed, bool systemMemoryPool, StorageInfo storageInfo);
|
||||
Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable, bool preferCompressed, bool systemMemoryPool, StorageInfo storageInfo, bool allowLargePages);
|
||||
Gmm(GmmClientContext *clientContext, GMM_RESOURCE_INFO *inputGmm);
|
||||
|
||||
void queryImageParams(ImageInfo &inputOutputImgInfo);
|
||||
|
||||
void applyAuxFlagsForBuffer(bool preferRenderCompression);
|
||||
void applyAuxFlagsForBuffer(bool preferCompression);
|
||||
void applyMemoryFlags(bool systemMemoryPool, StorageInfo &storageInfo);
|
||||
void applyAppResource(StorageInfo &storageInfo);
|
||||
|
||||
@@ -54,8 +54,8 @@ class Gmm {
|
||||
bool useSystemMemoryPool = true;
|
||||
|
||||
protected:
|
||||
void applyAuxFlagsForImage(ImageInfo &imgInfo, bool preferRenderCompressed);
|
||||
void setupImageResourceParams(ImageInfo &imgInfo, bool preferRenderCompressed);
|
||||
void applyAuxFlagsForImage(ImageInfo &imgInfo, bool preferCompressed);
|
||||
void setupImageResourceParams(ImageInfo &imgInfo, bool preferCompressed);
|
||||
bool extraMemoryFlagsRequired();
|
||||
void applyExtraMemoryFlags(const StorageInfo &storageInfo);
|
||||
void applyDebugOverrides();
|
||||
|
||||
@@ -18,14 +18,14 @@ HwHelper &HwHelper::get(GFXCORE_FAMILY gfxCore) {
|
||||
return *hwHelperFactory[gfxCore];
|
||||
}
|
||||
|
||||
bool HwHelper::renderCompressedBuffersSupported(const HardwareInfo &hwInfo) {
|
||||
bool HwHelper::compressedBuffersSupported(const HardwareInfo &hwInfo) {
|
||||
if (DebugManager.flags.RenderCompressedBuffersEnabled.get() != -1) {
|
||||
return !!DebugManager.flags.RenderCompressedBuffersEnabled.get();
|
||||
}
|
||||
return hwInfo.capabilityTable.ftrRenderCompressedBuffers;
|
||||
}
|
||||
|
||||
bool HwHelper::renderCompressedImagesSupported(const HardwareInfo &hwInfo) {
|
||||
bool HwHelper::compressedImagesSupported(const HardwareInfo &hwInfo) {
|
||||
if (DebugManager.flags.RenderCompressedImagesEnabled.get() != -1) {
|
||||
return !!DebugManager.flags.RenderCompressedImagesEnabled.get();
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ class HwHelper {
|
||||
virtual const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType) const = 0;
|
||||
virtual bool hvAlign4Required() const = 0;
|
||||
virtual bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0;
|
||||
virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const = 0;
|
||||
static bool renderCompressedBuffersSupported(const HardwareInfo &hwInfo);
|
||||
static bool renderCompressedImagesSupported(const HardwareInfo &hwInfo);
|
||||
static bool compressedBuffersSupported(const HardwareInfo &hwInfo);
|
||||
static bool compressedImagesSupported(const HardwareInfo &hwInfo);
|
||||
static bool cacheFlushAfterWalkerSupported(const HardwareInfo &hwInfo);
|
||||
virtual bool timestampPacketWriteSupported() const = 0;
|
||||
virtual size_t getRenderSurfaceStateSize() const = 0;
|
||||
@@ -131,7 +131,7 @@ class HwHelper {
|
||||
virtual size_t getTimestampPacketAllocatorAlignment() const = 0;
|
||||
virtual size_t getSingleTimestampPacketSize() const = 0;
|
||||
virtual void applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const = 0;
|
||||
virtual void applyRenderCompressionFlag(Gmm &gmm, uint32_t isRenderCompressed) const = 0;
|
||||
virtual void applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const = 0;
|
||||
virtual bool additionalPipeControlArgsRequired() const = 0;
|
||||
virtual bool isEngineTypeRemappingToHwSpecificRequired() const = 0;
|
||||
|
||||
@@ -232,7 +232,7 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
bool hvAlign4Required() const override;
|
||||
|
||||
bool isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const override;
|
||||
bool isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const override;
|
||||
|
||||
bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) override;
|
||||
|
||||
@@ -361,7 +361,7 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const override;
|
||||
|
||||
void applyRenderCompressionFlag(Gmm &gmm, uint32_t isRenderCompressed) const override;
|
||||
void applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const override;
|
||||
|
||||
bool additionalPipeControlArgsRequired() const override;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ template <typename Family>
|
||||
const AuxTranslationMode HwHelperHw<Family>::defaultAuxTranslationMode = AuxTranslationMode::Builtin;
|
||||
|
||||
template <typename Family>
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
|
||||
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
|
||||
}
|
||||
@@ -669,8 +669,8 @@ template <typename GfxFamily>
|
||||
void HwHelperHw<GfxFamily>::applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const {}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void HwHelperHw<GfxFamily>::applyRenderCompressionFlag(Gmm &gmm, uint32_t isRenderCompressed) const {
|
||||
gmm.resourceParams.Flags.Info.RenderCompressed = isRenderCompressed;
|
||||
void HwHelperHw<GfxFamily>::applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const {
|
||||
gmm.resourceParams.Flags.Info.RenderCompressed = isCompressed;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -98,7 +98,7 @@ struct AllocationData {
|
||||
uint32_t forcePin : 1;
|
||||
uint32_t uncacheable : 1;
|
||||
uint32_t flushL3 : 1;
|
||||
uint32_t preferRenderCompressed : 1;
|
||||
uint32_t preferCompressed : 1;
|
||||
uint32_t multiOsContextCapable : 1;
|
||||
uint32_t requiresCpuAccess : 1;
|
||||
uint32_t shareable : 1;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace NEO {
|
||||
class CompressionSelector {
|
||||
public:
|
||||
static bool preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo);
|
||||
static bool preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -425,8 +425,8 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
||||
allocationData.flags.uncacheable = properties.flags.uncacheable;
|
||||
allocationData.flags.flushL3 =
|
||||
(mayRequireL3Flush ? properties.flags.flushL3RequiredForRead | properties.flags.flushL3RequiredForWrite : 0u);
|
||||
allocationData.flags.preferRenderCompressed = properties.flags.preferCompressed;
|
||||
allocationData.flags.preferRenderCompressed |= CompressionSelector::preferRenderCompressedBuffer(properties, *hwInfo);
|
||||
allocationData.flags.preferCompressed = properties.flags.preferCompressed;
|
||||
allocationData.flags.preferCompressed |= CompressionSelector::preferCompressedAllocation(properties, *hwInfo);
|
||||
allocationData.flags.multiOsContextCapable = properties.flags.multiOsContextCapable;
|
||||
|
||||
if (properties.allocationType == GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA) {
|
||||
@@ -562,7 +562,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
|
||||
|
||||
GraphicsAllocation *MemoryManager::allocateGraphicsMemoryForImage(const AllocationData &allocationData) {
|
||||
auto gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), *allocationData.imgInfo,
|
||||
allocationData.storageInfo, allocationData.flags.preferRenderCompressed);
|
||||
allocationData.storageInfo, allocationData.flags.preferCompressed);
|
||||
|
||||
// AllocationData needs to be reconfigured for System Memory paths
|
||||
AllocationData allocationDataWithSize = allocationData;
|
||||
|
||||
@@ -104,8 +104,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment
|
||||
}
|
||||
|
||||
auto pHwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHardwareInfo();
|
||||
if (HwHelper::get(pHwInfo->platform.eRenderCoreFamily).renderCompressedBuffersSupported(*pHwInfo) &&
|
||||
allocationData.flags.preferRenderCompressed) {
|
||||
if (HwHelper::get(pHwInfo->platform.eRenderCoreFamily).compressedBuffersSupported(*pHwInfo) &&
|
||||
allocationData.flags.preferCompressed) {
|
||||
auto gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(),
|
||||
allocationData.hostPtr,
|
||||
sizeAligned,
|
||||
@@ -150,7 +150,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemory64kb(const Al
|
||||
allocationDataAlign.size = alignUp(allocationData.size, MemoryConstants::pageSize64k);
|
||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHardwareInfo();
|
||||
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
|
||||
allocationDataAlign.alignment = hwHelper.is1MbAlignmentSupported(*hwInfo, allocationData.flags.preferRenderCompressed)
|
||||
allocationDataAlign.alignment = hwHelper.is1MbAlignmentSupported(*hwInfo, allocationData.flags.preferCompressed)
|
||||
? MemoryConstants::megaByte
|
||||
: MemoryConstants::pageSize64k;
|
||||
auto memoryAllocation = allocateGraphicsMemoryWithAlignment(allocationDataAlign);
|
||||
@@ -162,7 +162,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemory64kb(const Al
|
||||
allocationDataAlign.size,
|
||||
allocationDataAlign.alignment,
|
||||
allocationData.flags.uncacheable,
|
||||
allocationData.flags.preferRenderCompressed,
|
||||
allocationData.flags.preferCompressed,
|
||||
allocationData.flags.useSystemMemory,
|
||||
allocationData.storageInfo);
|
||||
memoryAllocation->setDefaultGmm(gmm.release());
|
||||
@@ -469,12 +469,12 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool(
|
||||
allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY) {
|
||||
allocationData.imgInfo->useLocalMemory = true;
|
||||
gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), *allocationData.imgInfo,
|
||||
allocationData.storageInfo, allocationData.flags.preferRenderCompressed);
|
||||
allocationData.storageInfo, allocationData.flags.preferCompressed);
|
||||
sizeAligned64k = alignUp(allocationData.imgInfo->size, MemoryConstants::pageSize64k);
|
||||
} else {
|
||||
sizeAligned64k = alignUp(allocationData.size, MemoryConstants::pageSize64k);
|
||||
if (DebugManager.flags.RenderCompressedBuffersEnabled.get() &&
|
||||
allocationData.flags.preferRenderCompressed) {
|
||||
allocationData.flags.preferCompressed) {
|
||||
gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(),
|
||||
allocationData.hostPtr,
|
||||
sizeAligned64k,
|
||||
|
||||
@@ -58,7 +58,7 @@ class HwInfoConfig {
|
||||
virtual bool overrideGfxPartitionLayoutForWsl() const = 0;
|
||||
virtual std::string getDeviceMemoryName() const = 0;
|
||||
virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool allowRenderCompression(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool allowCompression(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool allowStatelessCompression(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0;
|
||||
@@ -123,7 +123,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const override;
|
||||
std::string getDeviceMemoryName() const override;
|
||||
bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override;
|
||||
bool allowRenderCompression(const HardwareInfo &hwInfo) const override;
|
||||
bool allowCompression(const HardwareInfo &hwInfo) const override;
|
||||
bool allowStatelessCompression(const HardwareInfo &hwInfo) const override;
|
||||
LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;
|
||||
bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const override;
|
||||
@@ -149,7 +149,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
protected:
|
||||
HwInfoConfigHw() = default;
|
||||
|
||||
void enableRenderCompression(HardwareInfo *hwInfo);
|
||||
void enableCompression(HardwareInfo *hwInfo);
|
||||
void enableBlitterOperationsSupport(HardwareInfo *hwInfo);
|
||||
uint64_t getHostMemCapabilitiesValue();
|
||||
bool getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo);
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
|
||||
enableRenderCompression(hwInfo);
|
||||
enableCompression(hwInfo);
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
return 0;
|
||||
@@ -171,7 +171,7 @@ bool HwInfoConfigHw<gfxProduct>::isDisableOverdispatchAvailable(const HardwareIn
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::allowRenderCompression(const HardwareInfo &hwInfo) const {
|
||||
bool HwInfoConfigHw<gfxProduct>::allowCompression(const HardwareInfo &hwInfo) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ uint64_t HwInfoConfigHw<gfxProduct>::getCrossDeviceSharedMemCapabilities() {
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void HwInfoConfigHw<gfxProduct>::enableRenderCompression(HardwareInfo *hwInfo) {
|
||||
void HwInfoConfigHw<gfxProduct>::enableCompression(HardwareInfo *hwInfo) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression;
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ uint64_t HwInfoConfigHw<gfxProduct>::getCrossDeviceSharedMemCapabilities() {
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void HwInfoConfigHw<gfxProduct>::enableRenderCompression(HardwareInfo *hwInfo) {
|
||||
void HwInfoConfigHw<gfxProduct>::enableCompression(HardwareInfo *hwInfo) {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression;
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression;
|
||||
}
|
||||
|
||||
@@ -1245,7 +1245,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A
|
||||
if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE) {
|
||||
allocationData.imgInfo->useLocalMemory = true;
|
||||
gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), *allocationData.imgInfo,
|
||||
allocationData.storageInfo, allocationData.flags.preferRenderCompressed);
|
||||
allocationData.storageInfo, allocationData.flags.preferCompressed);
|
||||
sizeAligned = alignUp(allocationData.imgInfo->size, MemoryConstants::pageSize64k);
|
||||
} else {
|
||||
if (allocationData.type == GraphicsAllocation::AllocationType::WRITE_COMBINED) {
|
||||
@@ -1259,7 +1259,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A
|
||||
sizeAligned,
|
||||
0u,
|
||||
allocationData.flags.uncacheable,
|
||||
allocationData.flags.preferRenderCompressed,
|
||||
allocationData.flags.preferCompressed,
|
||||
false,
|
||||
allocationData.storageInfo);
|
||||
}
|
||||
@@ -1279,7 +1279,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A
|
||||
createColouredGmms(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(),
|
||||
*allocation,
|
||||
allocationData.storageInfo,
|
||||
allocationData.flags.preferRenderCompressed);
|
||||
allocationData.flags.preferCompressed);
|
||||
} else {
|
||||
fillGmmsInAllocation(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), allocation.get(), allocationData.storageInfo);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryUsingKmdAndMapItToC
|
||||
auto gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), nullptr,
|
||||
sizeAligned, 0u,
|
||||
allocationData.flags.uncacheable,
|
||||
allocationData.flags.preferRenderCompressed, true,
|
||||
allocationData.flags.preferCompressed, true,
|
||||
allocationData.storageInfo,
|
||||
allowLargePages);
|
||||
wddmAllocation->setDefaultGmm(gmm);
|
||||
@@ -239,7 +239,8 @@ GraphicsAllocation *WddmMemoryManager::allocateSystemMemoryAndCreateGraphicsAllo
|
||||
maxOsContextCount);
|
||||
wddmAllocation->setDriverAllocatedCpuPtr(pSysMem);
|
||||
|
||||
gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), pSysMem, sizeAligned, 0u, allocationData.flags.uncacheable, allocationData.flags.preferRenderCompressed, true, allocationData.storageInfo);
|
||||
gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), pSysMem, sizeAligned, 0u,
|
||||
allocationData.flags.uncacheable, allocationData.flags.preferCompressed, true, allocationData.storageInfo);
|
||||
|
||||
wddmAllocation->setDefaultGmm(gmm);
|
||||
void *mapPtr = wddmAllocation->getAlignedCpuPtr();
|
||||
@@ -969,7 +970,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const
|
||||
if (allocationData.type == GraphicsAllocation::AllocationType::IMAGE ||
|
||||
allocationData.type == GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY) {
|
||||
allocationData.imgInfo->useLocalMemory = true;
|
||||
gmm = std::make_unique<Gmm>(gmmClientContext, *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferRenderCompressed);
|
||||
gmm = std::make_unique<Gmm>(gmmClientContext, *allocationData.imgInfo, allocationData.storageInfo, allocationData.flags.preferCompressed);
|
||||
alignment = MemoryConstants::pageSize64k;
|
||||
sizeAligned = allocationData.imgInfo->size;
|
||||
} else {
|
||||
@@ -982,7 +983,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const
|
||||
sizeAligned,
|
||||
alignment,
|
||||
allocationData.flags.uncacheable,
|
||||
allocationData.flags.preferRenderCompressed,
|
||||
allocationData.flags.preferCompressed,
|
||||
false,
|
||||
allocationData.storageInfo);
|
||||
}
|
||||
@@ -1000,7 +1001,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const
|
||||
wddmAllocation->setDefaultGmm(gmm.release());
|
||||
}
|
||||
} else if (allocationData.storageInfo.multiStorage) {
|
||||
createColouredGmms(gmmClientContext, *wddmAllocation, allocationData.storageInfo, allocationData.flags.preferRenderCompressed);
|
||||
createColouredGmms(gmmClientContext, *wddmAllocation, allocationData.storageInfo, allocationData.flags.preferCompressed);
|
||||
} else {
|
||||
fillGmmsInAllocation(gmmClientContext, wddmAllocation.get(), allocationData.storageInfo);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ bool HwHelperHw<Family>::isSipWANeeded(const HardwareInfo &hwInfo) const {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
|
||||
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ constexpr static auto gfxProduct = IGFX_XE_HP_SDV;
|
||||
|
||||
template <>
|
||||
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
|
||||
if (allowRenderCompression(*hwInfo)) {
|
||||
enableRenderCompression(hwInfo);
|
||||
if (allowCompression(*hwInfo)) {
|
||||
enableCompression(hwInfo);
|
||||
}
|
||||
|
||||
hwInfo->featureTable.flags.ftrRcsNode = false;
|
||||
|
||||
@@ -68,7 +68,7 @@ bool HwInfoConfigHw<gfxProduct>::isDisableOverdispatchAvailable(const HardwareIn
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::allowRenderCompression(const HardwareInfo &hwInfo) const {
|
||||
bool HwInfoConfigHw<gfxProduct>::allowCompression(const HardwareInfo &hwInfo) const {
|
||||
if (hwInfo.gtSystemInfo.EUCount == 256u) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ constexpr static auto gfxProduct = IGFX_XE_HP_SDV;
|
||||
|
||||
template <>
|
||||
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
|
||||
if (allowRenderCompression(*hwInfo)) {
|
||||
enableRenderCompression(hwInfo);
|
||||
if (allowCompression(*hwInfo)) {
|
||||
enableCompression(hwInfo);
|
||||
}
|
||||
|
||||
hwInfo->featureTable.flags.ftrRcsNode = false;
|
||||
|
||||
@@ -85,7 +85,7 @@ std::string HwHelperHw<Family>::getExtensions() const {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
bool HwHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
|
||||
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ constexpr static auto gfxProduct = IGFX_DG2;
|
||||
|
||||
template <>
|
||||
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
|
||||
if (allowRenderCompression(*hwInfo)) {
|
||||
enableRenderCompression(hwInfo);
|
||||
if (allowCompression(*hwInfo)) {
|
||||
enableCompression(hwInfo);
|
||||
}
|
||||
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
@@ -96,7 +96,7 @@ bool HwInfoConfigHw<gfxProduct>::isDisableOverdispatchAvailable(const HardwareIn
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::allowRenderCompression(const HardwareInfo &hwInfo) const {
|
||||
bool HwInfoConfigHw<gfxProduct>::allowCompression(const HardwareInfo &hwInfo) const {
|
||||
if (HwHelper::get(hwInfo.platform.eRenderCoreFamily).isWorkaroundRequired(REVISION_A0, REVISION_A1, hwInfo) &&
|
||||
(hwInfo.gtSystemInfo.EUCount != 128)) {
|
||||
return false;
|
||||
|
||||
@@ -22,8 +22,8 @@ constexpr static auto gfxProduct = IGFX_DG2;
|
||||
|
||||
template <>
|
||||
int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
|
||||
if (allowRenderCompression(*hwInfo)) {
|
||||
enableRenderCompression(hwInfo);
|
||||
if (allowCompression(*hwInfo)) {
|
||||
enableCompression(hwInfo);
|
||||
}
|
||||
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
@@ -149,7 +149,7 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::isDisableOverdispatchAvailable(const Hardware
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<IGFX_UNKNOWN>::allowRenderCompression(const HardwareInfo &hwInfo) const {
|
||||
bool HwInfoConfigHw<IGFX_UNKNOWN>::allowCompression(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,11 +85,11 @@ GraphicsAllocation *MockMemoryManager::allocateMemoryByKMD(const AllocationData
|
||||
|
||||
GraphicsAllocation *MockMemoryManager::allocateGraphicsMemory64kb(const AllocationData &allocationData) {
|
||||
allocation64kbPageCreated = true;
|
||||
preferRenderCompressedFlagPassed = forceRenderCompressed ? true : allocationData.flags.preferRenderCompressed;
|
||||
preferCompressedFlagPassed = forceCompressed ? true : allocationData.flags.preferCompressed;
|
||||
|
||||
auto allocation = OsAgnosticMemoryManager::allocateGraphicsMemory64kb(allocationData);
|
||||
if (allocation) {
|
||||
allocation->getDefaultGmm()->isCompressionEnabled = preferRenderCompressedFlagPassed;
|
||||
allocation->getDefaultGmm()->isCompressionEnabled = preferCompressedFlagPassed;
|
||||
}
|
||||
return allocation;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
|
||||
bool failInDevicePool = false;
|
||||
bool failInDevicePoolWithError = false;
|
||||
bool failInAllocateWithSizeAndAlignment = false;
|
||||
bool preferRenderCompressedFlagPassed = false;
|
||||
bool preferCompressedFlagPassed = false;
|
||||
bool allocateForImageCalled = false;
|
||||
bool allocate32BitGraphicsMemoryImplCalled = false;
|
||||
bool allocateGraphicsMemoryForNonSvmHostPtrCalled = false;
|
||||
@@ -189,7 +189,7 @@ class MockMemoryManager : public MemoryManagerCreate<OsAgnosticMemoryManager> {
|
||||
bool failAllocate32Bit = false;
|
||||
bool failSetMemAdvise = false;
|
||||
bool cpuCopyRequired = false;
|
||||
bool forceRenderCompressed = false;
|
||||
bool forceCompressed = false;
|
||||
bool forceFailureInPrimaryAllocation = false;
|
||||
bool forceFailureInAllocationWithHostPointer = false;
|
||||
bool isMockHostMemoryManager = false;
|
||||
|
||||
@@ -97,7 +97,7 @@ XEHPTEST_F(TestXeHPHwInfoConfig, givenHwInfoConfigWhenCreateMultipleSubDevicesAn
|
||||
EXPECT_TRUE(hwInfoConfig.allowStatelessCompression(hwInfo));
|
||||
}
|
||||
|
||||
XEHPTEST_F(TestXeHPHwInfoConfig, givenHwInfoConfigWhenRenderCompressedBuffersAreDisabledThenDontAllowStatelessCompression) {
|
||||
XEHPTEST_F(TestXeHPHwInfoConfig, givenHwInfoConfigWhenCompressedBuffersAreDisabledThenDontAllowStatelessCompression) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace NEO {
|
||||
namespace ImplicitScaling {
|
||||
bool apiSupport = false;
|
||||
} // namespace ImplicitScaling
|
||||
bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
||||
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties, const HardwareInfo &hwInfo) {
|
||||
return false;
|
||||
}
|
||||
void PageFaultManager::transferToCpu(void *ptr, size_t size, void *cmdQ) {
|
||||
|
||||
Reference in New Issue
Block a user