mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Fixed blitter path for printf with stateless compression in sba
Related-To: NEO-5107 Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c656866b74
commit
754d6e40e0
@@ -26,6 +26,22 @@ using namespace NEO;
|
||||
|
||||
using PrintfHandlerTests = ::testing::Test;
|
||||
|
||||
TEST_F(PrintfHandlerTests, givenPrintfHandlerWhenBeingConstructedThenStorePrintfSurfaceInitialDataSize) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
|
||||
struct MockPrintfHandler : public PrintfHandler {
|
||||
using PrintfHandler::PrintfHandler;
|
||||
using PrintfHandler::printfSurfaceInitialDataSizePtr;
|
||||
|
||||
MockPrintfHandler(ClDevice &device) : PrintfHandler(device) {}
|
||||
};
|
||||
|
||||
MockPrintfHandler printfHandler(*device);
|
||||
|
||||
EXPECT_NE(nullptr, printfHandler.printfSurfaceInitialDataSizePtr);
|
||||
EXPECT_EQ(sizeof(uint32_t), *printfHandler.printfSurfaceInitialDataSizePtr);
|
||||
}
|
||||
|
||||
TEST_F(PrintfHandlerTests, givenNotPreparedPrintfHandlerWhenGetSurfaceIsCalledThenResultIsNullptr) {
|
||||
MockClDevice *device = new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr)};
|
||||
MockContext context;
|
||||
@@ -73,8 +89,10 @@ TEST_F(PrintfHandlerTests, givenPreparedPrintfHandlerWithUndefinedSshOffsetWhenG
|
||||
delete device;
|
||||
}
|
||||
|
||||
HWTEST_F(PrintfHandlerTests, givenEnabledStatelessCompressionWhenPrintEnqueueOutputIsCalledThenBCSEngineIsUsedForAuxTranslation) {
|
||||
REQUIRE_BLITTER_OR_SKIP(defaultHwInfo.get());
|
||||
HWTEST_F(PrintfHandlerTests, givenEnabledStatelessCompressionWhenPrintEnqueueOutputIsCalledThenBCSEngineIsUsedToDecompressPrintfOutput) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
REQUIRE_BLITTER_OR_SKIP(&hwInfo);
|
||||
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
@@ -105,7 +123,7 @@ HWTEST_F(PrintfHandlerTests, givenEnabledStatelessCompressionWhenPrintEnqueueOut
|
||||
|
||||
if (enable > 0) {
|
||||
EXPECT_EQ(1u, bcsCsr->blitBufferCalled);
|
||||
EXPECT_EQ(AuxTranslationDirection::AuxToNonAux, bcsCsr->receivedBlitProperties[0].auxTranslationDirection);
|
||||
EXPECT_EQ(BlitterConstants::BlitDirection::BufferToHostPtr, bcsCsr->receivedBlitProperties[0].blitDirection);
|
||||
} else {
|
||||
EXPECT_EQ(0u, bcsCsr->blitBufferCalled);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
#include "opencl/source/helpers/cl_hw_helper.h"
|
||||
#include "opencl/source/program/kernel_info.h"
|
||||
@@ -116,6 +117,23 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenDifferentBufferSizesWhenEnableSta
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenStatelessCompressionEnabledWhenSetExtraAllocationDataThenDontRequireCpuAccessNorMakeResourceLocableForCompressedAllocations) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
|
||||
for (auto allocType : {GraphicsAllocation::AllocationType::CONSTANT_SURFACE, GraphicsAllocation::AllocationType::GLOBAL_SURFACE, GraphicsAllocation::AllocationType::PRINTF_SURFACE}) {
|
||||
AllocationData allocData;
|
||||
AllocationProperties allocProperties(mockRootDeviceIndex, true, allocType, mockDeviceBitfield);
|
||||
|
||||
hwHelper.setExtraAllocationData(allocData, allocProperties, hwInfo);
|
||||
EXPECT_FALSE(allocData.flags.requiresCpuAccess);
|
||||
EXPECT_FALSE(allocData.storageInfo.isLockable);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenRevisionEnumAndPlatformFamilyTypeThenProperValueForIsWorkaroundRequiredIsReturned) {
|
||||
uint32_t steppings[] = {
|
||||
REVISION_A0,
|
||||
|
||||
Reference in New Issue
Block a user