diff --git a/runtime/helpers/blit_commands_helper.inl b/runtime/helpers/blit_commands_helper.inl index d6ce585433..3dbab57e47 100644 --- a/runtime/helpers/blit_commands_helper.inl +++ b/runtime/helpers/blit_commands_helper.inl @@ -67,6 +67,9 @@ void BlitCommandsHelper::dispatchBlitCommandsForBuffer(Buffer &buffer bltCmd->setDestinationX2CoordinateRight(static_cast(width)); bltCmd->setDestinationY2CoordinateBottom(static_cast(height)); + bltCmd->setDestinationPitch(static_cast(width)); + bltCmd->setSourcePitch(static_cast(width)); + bltCmd->setDestinationBaseAddress(buffer.getGraphicsAllocation()->getGpuAddress() + offset); bltCmd->setSourceBaseAddress(hostPtrAllocation.getGpuAddress() + offset); diff --git a/runtime/helpers/sampler_helpers.h b/runtime/helpers/sampler_helpers.h index f80c3ac5d8..3a7ef4e218 100644 --- a/runtime/helpers/sampler_helpers.h +++ b/runtime/helpers/sampler_helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,8 @@ #pragma once #include "CL/cl.h" +#include + // It's max SSH size per kernel (MAX_BINDING_TABLE_INDEX * 64) const uint32_t SAMPLER_OBJECT_ID_SHIFT = 253 * 64; diff --git a/runtime/memory_manager/memory_constants.h b/runtime/memory_manager/memory_constants.h index 5972b7bc1c..d2fe8e7fd2 100644 --- a/runtime/memory_manager/memory_constants.h +++ b/runtime/memory_manager/memory_constants.h @@ -49,7 +49,6 @@ static const uint64_t maxSvmAddress = is64bit ? maxNBitValue<47> : maxNBitValue< } // namespace MemoryConstants namespace BlitterConstants { -static constexpr uint64_t maxBlitWidth = 0x7FFF; +static constexpr uint64_t maxBlitWidth = 0x7FC0; // 0x7FFF aligned to cacheline size static constexpr uint64_t maxBlitHeight = 0x7FFF; -static constexpr uint64_t max2dBlitSize = maxBlitWidth * maxBlitHeight; } // namespace BlitterConstants diff --git a/unit_tests/command_stream/command_stream_receiver_hw_tests.cpp b/unit_tests/command_stream/command_stream_receiver_hw_tests.cpp index 480236a7c4..e2e2a4f82b 100644 --- a/unit_tests/command_stream/command_stream_receiver_hw_tests.cpp +++ b/unit_tests/command_stream/command_stream_receiver_hw_tests.cpp @@ -279,10 +279,11 @@ struct BcsTests : public CommandStreamReceiverHwTest { }; HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredCommands) { - uint64_t alignedBltSize = (3 * BlitterConstants::max2dBlitSize) + 1; - uint64_t notAlignedBltSize = (3 * BlitterConstants::max2dBlitSize); - uint32_t alignedNumberOfBlts = 4; - uint32_t notAlignedNumberOfBlts = 3; + constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; + uint64_t notAlignedBltSize = (3 * max2DBlitSize) + 1; + uint64_t alignedBltSize = (3 * max2DBlitSize); + uint32_t alignedNumberOfBlts = 3; + uint32_t notAlignedNumberOfBlts = 4; size_t expectedSize = sizeof(typename FamilyType::MI_FLUSH_DW) + sizeof(typename FamilyType::MI_BATCH_BUFFER_END); @@ -298,11 +299,13 @@ HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredComman HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredCommands) { using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; + constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; + auto &csr = pDevice->getUltCommandStreamReceiver(); static_cast(csr.getMemoryManager())->turnOnFakingBigAllocations(); uint32_t bltLeftover = 17; - uint64_t bltSize = (2 * BlitterConstants::max2dBlitSize) + bltLeftover; + uint64_t bltSize = (2 * max2DBlitSize) + bltLeftover; uint32_t numberOfBlts = 3; cl_int retVal = CL_SUCCESS; @@ -333,13 +336,16 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC EXPECT_EQ(0u, bltCmd->getDestinationY1CoordinateTop()); EXPECT_EQ(0u, bltCmd->getSourceX1CoordinateLeft()); EXPECT_EQ(0u, bltCmd->getSourceY1CoordinateTop()); + uint32_t expectedWidth = static_cast(BlitterConstants::maxBlitWidth); + uint32_t expectedHeight = static_cast(BlitterConstants::maxBlitHeight); if (i == (numberOfBlts - 1)) { - EXPECT_EQ(bltLeftover, bltCmd->getDestinationX2CoordinateRight()); - EXPECT_EQ(1u, bltCmd->getDestinationY2CoordinateBottom()); - } else { - EXPECT_EQ(static_cast(BlitterConstants::maxBlitWidth), bltCmd->getDestinationX2CoordinateRight()); - EXPECT_EQ(static_cast(BlitterConstants::maxBlitWidth), bltCmd->getDestinationY2CoordinateBottom()); + expectedWidth = bltLeftover; + expectedHeight = 1; } + EXPECT_EQ(expectedWidth, bltCmd->getDestinationX2CoordinateRight()); + EXPECT_EQ(expectedHeight, bltCmd->getDestinationY2CoordinateBottom()); + EXPECT_EQ(expectedWidth, bltCmd->getDestinationPitch()); + EXPECT_EQ(expectedWidth, bltCmd->getSourcePitch()); } auto miFlushCmd = genCmdCast(*(cmdIterator++)); diff --git a/unit_tests/os_interface/windows/registry_reader_tests.h b/unit_tests/os_interface/windows/registry_reader_tests.h index fb8d9c12dc..84e10311e3 100644 --- a/unit_tests/os_interface/windows/registry_reader_tests.h +++ b/unit_tests/os_interface/windows/registry_reader_tests.h @@ -5,10 +5,9 @@ * */ -using namespace NEO; - #include "runtime/os_interface/windows/registry_reader.h" +namespace NEO { class TestedRegistryReader : public RegistryReader { public: TestedRegistryReader(bool userScope) : RegistryReader(userScope){}; @@ -21,3 +20,4 @@ class TestedRegistryReader : public RegistryReader { return registryReadRootKey.c_str(); } }; +} // namespace NEO