mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
fix: do not allow blit for depth image on arl
Related-To: NEO-14344 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
749ca4f1fb
commit
85ed1a15e4
@@ -28,6 +28,7 @@
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/utilities/api_intercept.h"
|
||||
#include "shared/source/utilities/staging_buffer_manager.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
@@ -269,7 +270,6 @@ CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelec
|
||||
if (!blitEnqueueAllowed(args)) {
|
||||
return getGpgpuCommandStreamReceiver();
|
||||
}
|
||||
|
||||
bool preferBcs = true;
|
||||
aub_stream::EngineType preferredBcsEngineType = aub_stream::EngineType::NUM_ENGINES;
|
||||
switch (args.direction) {
|
||||
@@ -1142,11 +1142,15 @@ bool CommandQueue::blitEnqueueAllowed(const CsrSelectionArgs &args) const {
|
||||
bool CommandQueue::blitEnqueueImageAllowed(const size_t *origin, const size_t *region, const Image &image) const {
|
||||
const auto &hwInfo = device->getHardwareInfo();
|
||||
auto &productHelper = device->getProductHelper();
|
||||
auto releaseHelper = device->getDevice().getReleaseHelper();
|
||||
auto blitEnqueueImageAllowed = productHelper.isBlitterForImagesSupported();
|
||||
|
||||
if (debugManager.flags.EnableBlitterForEnqueueImageOperations.get() != -1) {
|
||||
blitEnqueueImageAllowed = debugManager.flags.EnableBlitterForEnqueueImageOperations.get();
|
||||
}
|
||||
if (releaseHelper) {
|
||||
blitEnqueueImageAllowed &= !(Image::isDepthFormat(image.getImageFormat()) && !releaseHelper->isBlitImageAllowedForDepthFormat());
|
||||
}
|
||||
|
||||
blitEnqueueImageAllowed &= !isMipMapped(image.getImageDesc());
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ struct ClBlitProperties {
|
||||
auto rootDeviceIndex = commandStreamReceiver.getRootDeviceIndex();
|
||||
auto clearColorAllocation = commandStreamReceiver.getClearColorAllocation();
|
||||
BlitProperties blitProperties{};
|
||||
|
||||
if (BlitterConstants::BlitDirection::bufferToBuffer == blitDirection ||
|
||||
BlitterConstants::BlitDirection::imageToImage == blitDirection) {
|
||||
auto dstOffset = builtinOpParams.dstOffset.x;
|
||||
@@ -51,7 +50,6 @@ struct ClBlitProperties {
|
||||
builtinOpParams.size,
|
||||
builtinOpParams.srcRowPitch, builtinOpParams.srcSlicePitch,
|
||||
builtinOpParams.dstRowPitch, builtinOpParams.dstSlicePitch, clearColorAllocation);
|
||||
|
||||
if (BlitterConstants::BlitDirection::imageToImage == blitDirection) {
|
||||
blitProperties.blitDirection = blitDirection;
|
||||
setBlitPropertiesForImage(blitProperties, builtinOpParams);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/mocks/mock_os_context.h"
|
||||
#include "shared/test/common/mocks/mock_release_helper.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||
|
||||
@@ -2147,6 +2148,68 @@ TEST(CommandQueue, givenImageWithDifferentImageTypesWhenCallingBlitEnqueueImageA
|
||||
}
|
||||
}
|
||||
|
||||
TEST(CommandQueue, givenImageWithDepthTypeWhenDepthNotAllowedForBlitThenBlitEnqueueForImageNotAllowed) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.EnableBlitterForEnqueueImageOperations.set(1);
|
||||
MockContext context{};
|
||||
MockCommandQueue queue(&context, context.getDevice(0), 0, false);
|
||||
auto releaseHelper = std::unique_ptr<MockReleaseHelper>(new MockReleaseHelper());
|
||||
releaseHelper->isBlitImageAllowedForDepthFormatResult = false;
|
||||
context.getDevice(0)->getDevice().getRootDeviceEnvironmentRef().releaseHelper.reset(releaseHelper.release());
|
||||
size_t correctRegion[3] = {10u, 10u, 0};
|
||||
size_t correctOrigin[3] = {1u, 1u, 0};
|
||||
MockImageBase image;
|
||||
image.imageFormat = {CL_DEPTH, CL_UNSIGNED_INT8};
|
||||
|
||||
EXPECT_FALSE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
|
||||
}
|
||||
|
||||
TEST(CommandQueue, givenImageWithNotDepthTypeWhenDepthNotAllowedForBlitThenBlitEnqueueForImageIsAllowed) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.EnableBlitterForEnqueueImageOperations.set(1);
|
||||
MockContext context{};
|
||||
MockCommandQueue queue(&context, context.getDevice(0), 0, false);
|
||||
auto releaseHelper = std::unique_ptr<MockReleaseHelper>(new MockReleaseHelper());
|
||||
releaseHelper->isBlitImageAllowedForDepthFormatResult = false;
|
||||
context.getDevice(0)->getDevice().getRootDeviceEnvironmentRef().releaseHelper.reset(releaseHelper.release());
|
||||
size_t correctRegion[3] = {10u, 10u, 0};
|
||||
size_t correctOrigin[3] = {1u, 1u, 0};
|
||||
MockImageBase image;
|
||||
image.imageFormat = {CL_R, CL_UNSIGNED_INT8};
|
||||
|
||||
EXPECT_TRUE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
|
||||
}
|
||||
|
||||
TEST(CommandQueue, givenImageWithDepthTypeWhenDepthAllowedForBlitThenBlitEnqueueForImageIsAllowed) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.EnableBlitterForEnqueueImageOperations.set(1);
|
||||
MockContext context{};
|
||||
MockCommandQueue queue(&context, context.getDevice(0), 0, false);
|
||||
auto releaseHelper = std::unique_ptr<MockReleaseHelper>(new MockReleaseHelper());
|
||||
releaseHelper->isBlitImageAllowedForDepthFormatResult = true;
|
||||
context.getDevice(0)->getDevice().getRootDeviceEnvironmentRef().releaseHelper.reset(releaseHelper.release());
|
||||
size_t correctRegion[3] = {10u, 10u, 0};
|
||||
size_t correctOrigin[3] = {1u, 1u, 0};
|
||||
MockImageBase image;
|
||||
image.imageFormat = {CL_DEPTH, CL_UNSIGNED_INT8};
|
||||
|
||||
EXPECT_TRUE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
|
||||
}
|
||||
|
||||
TEST(CommandQueue, givenImageWithDepthTypeWhenReleaseHelperNotAvailableThenBlitEnqueueForImageIsAllowed) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.EnableBlitterForEnqueueImageOperations.set(1);
|
||||
MockContext context{};
|
||||
MockCommandQueue queue(&context, context.getDevice(0), 0, false);
|
||||
context.getDevice(0)->getDevice().getRootDeviceEnvironmentRef().releaseHelper.reset();
|
||||
size_t correctRegion[3] = {10u, 10u, 0};
|
||||
size_t correctOrigin[3] = {1u, 1u, 0};
|
||||
MockImageBase image;
|
||||
image.imageFormat = {CL_DEPTH, CL_UNSIGNED_INT8};
|
||||
|
||||
EXPECT_TRUE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
|
||||
}
|
||||
|
||||
TEST(CommandQueue, given64KBTileWith3DImageTypeWhenCallingBlitEnqueueImageAllowedThenCorrectResultIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
MockContext context{};
|
||||
|
||||
@@ -65,6 +65,7 @@ class ReleaseHelper {
|
||||
virtual bool isNumRtStacksPerDssFixedValue() const = 0;
|
||||
virtual bool getFtrXe2Compression() const = 0;
|
||||
virtual uint32_t computeSlmValues(uint32_t slmSize, bool isHeapless) const = 0;
|
||||
virtual bool isBlitImageAllowedForDepthFormat() const = 0;
|
||||
|
||||
protected:
|
||||
ReleaseHelper(HardwareIpVersion hardwareIpVersion) : hardwareIpVersion(hardwareIpVersion) {}
|
||||
@@ -109,6 +110,7 @@ class ReleaseHelperHw : public ReleaseHelper {
|
||||
bool isNumRtStacksPerDssFixedValue() const override;
|
||||
bool getFtrXe2Compression() const override;
|
||||
uint32_t computeSlmValues(uint32_t slmSize, bool isHeapless) const override;
|
||||
bool isBlitImageAllowedForDepthFormat() const override;
|
||||
|
||||
protected:
|
||||
ReleaseHelperHw(HardwareIpVersion hardwareIpVersion) : ReleaseHelper(hardwareIpVersion) {}
|
||||
|
||||
@@ -44,6 +44,11 @@ bool ReleaseHelperHw<release>::getFtrXe2Compression() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ReleaseHelperHw<release>::isBlitImageAllowedForDepthFormat() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
const SizeToPreferredSlmValueArray &ReleaseHelperHw<release>::getSizeToPreferredSlmValue(bool isHeapless) const {
|
||||
using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
||||
|
||||
@@ -171,5 +171,9 @@ template <ReleaseType releaseType>
|
||||
uint32_t ReleaseHelperHw<releaseType>::computeSlmValues(uint32_t slmSize, bool isHeapless) const {
|
||||
return 0u;
|
||||
}
|
||||
template <ReleaseType releaseType>
|
||||
bool ReleaseHelperHw<releaseType>::isBlitImageAllowedForDepthFormat() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -39,6 +39,7 @@ class MockReleaseHelper : public ReleaseHelper {
|
||||
ADDMETHOD_CONST_NOBASE(isLocalOnlyAllowed, bool, {}, ());
|
||||
ADDMETHOD_CONST_NOBASE(isDummyBlitWaRequired, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isNumRtStacksPerDssFixedValue, bool, true, ());
|
||||
ADDMETHOD_CONST_NOBASE(isBlitImageAllowedForDepthFormat, bool, true, ());
|
||||
ADDMETHOD_CONST_NOBASE(getFtrXe2Compression, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(isDirectSubmissionLightSupported, bool, false, ());
|
||||
ADDMETHOD_CONST_NOBASE(computeSlmValues, uint32_t, {}, (uint32_t slmSize, bool isHeapless));
|
||||
|
||||
@@ -73,6 +73,10 @@ TEST_F(ReleaseHelper1255Tests, whenIsDummyBlitWaRequiredCalledThenFalseReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1255Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1255Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -73,6 +73,10 @@ TEST_F(ReleaseHelper1256Tests, whenIsDummyBlitWaRequiredCalledThenFalseReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1256Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1256Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -73,6 +73,10 @@ TEST_F(ReleaseHelper1257Tests, whenIsDummyBlitWaRequiredCalledThenFalseReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1257Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1257Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -62,6 +62,10 @@ TEST_F(ReleaseHelper1260Tests, whenIsDummyBlitWaRequiredCalledThenTrueReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1260Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1260Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -61,6 +61,10 @@ TEST_F(ReleaseHelper1261Tests, whenIsDummyBlitWaRequiredCalledThenTrueReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1261Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1261Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -75,6 +75,10 @@ TEST_F(ReleaseHelper1270Tests, whenIsDummyBlitWaRequiredCalledThenTrueReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1270Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1270Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -75,6 +75,10 @@ TEST_F(ReleaseHelper1271Tests, whenIsDummyBlitWaRequiredCalledThenTrueReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1271Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1271Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -101,3 +101,11 @@ TEST_F(ReleaseHelper1274Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorr
|
||||
EXPECT_EQ(13u, preferredSlmValueArray[5].valueToProgram);
|
||||
}
|
||||
}
|
||||
TEST_F(ReleaseHelper1274Tests, whenIsBlitImageAllowedForDepthFormatCalledThenFalseReturned) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
releaseHelper = ReleaseHelper::create(ipVersion);
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
EXPECT_FALSE(releaseHelper->isBlitImageAllowedForDepthFormat());
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,10 @@ TEST_F(ReleaseHelper2001Tests, whenIsDummyBlitWaRequiredCalledThenFalseReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2001Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2001Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -74,6 +74,10 @@ TEST_F(ReleaseHelper2004Tests, whenIsDummyBlitWaRequiredCalledThenFalseReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2004Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2004Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -76,6 +76,10 @@ TEST_F(ReleaseHelper3000Tests, whenIsDummyBlitWaRequiredCalledThenFalseReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper3000Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper3000Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -76,6 +76,10 @@ TEST_F(ReleaseHelper3001Tests, whenIsDummyBlitWaRequiredCalledThenFalseReturned)
|
||||
whenIsDummyBlitWaRequiredCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper3001Tests, whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned) {
|
||||
whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper3001Tests, whenGettingPreferredSlmSizeThenAllEntriesHaveCorrectValues) {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
|
||||
@@ -170,3 +170,12 @@ void ReleaseHelperTestsBase::whenIsDummyBlitWaRequiredCalledThenFalseReturned()
|
||||
EXPECT_FALSE(releaseHelper->isDummyBlitWaRequired());
|
||||
}
|
||||
}
|
||||
|
||||
void ReleaseHelperTestsBase::whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned() {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
releaseHelper = ReleaseHelper::create(ipVersion);
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
EXPECT_TRUE(releaseHelper->isBlitImageAllowedForDepthFormat());
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ struct ReleaseHelperTestsBase : public ::testing::Test {
|
||||
void whenGettingSupportedNumGrfsThenValuesUpTo256Returned();
|
||||
void whenGettingNumThreadsPerEuThenCorrectValueIsReturnedBasedOnDebugKey();
|
||||
void whenGettingThreadsPerEuConfigsThenCorrectValueIsReturnedBasedOnNumThreadPerEu();
|
||||
void whenIsBlitImageAllowedForDepthFormatCalledThenTrueReturned();
|
||||
virtual std::vector<uint32_t> getRevisions() = 0;
|
||||
|
||||
std::unique_ptr<ReleaseHelper> releaseHelper;
|
||||
|
||||
Reference in New Issue
Block a user