Skip to content

Commit 944319b

Browse files
Correct media compression format for blitter operations on planar images
Set most significant bit for chroma planes. Move common logic to helper function. Signed-off-by: Filip Hazubski <[email protected]>
1 parent 9959896 commit 944319b

13 files changed

+139
-17
lines changed

opencl/source/helpers/cl_blit_properties.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ struct ClBlitProperties {
185185
auto &copySize = blitProperties.copySize;
186186
auto &bytesPerPixel = blitProperties.bytesPerPixel;
187187
auto &blitDirection = blitProperties.blitDirection;
188+
auto &plane = isSource ? blitProperties.srcPlane : blitProperties.dstPlane;
188189

189190
image->getSurfaceOffsets(surfaceOffsets);
190191
gpuAddress += surfaceOffsets.offset;
@@ -194,6 +195,7 @@ struct ClBlitProperties {
194195
bytesPerPixel = image->getSurfaceFormatInfo().surfaceFormat.ImageElementSizeInBytes;
195196
rowPitch = imageDesc.image_row_pitch;
196197
slicePitch = imageDesc.image_slice_pitch;
198+
plane = image->getPlane();
197199

198200
if (imageDesc.image_type == CL_MEM_OBJECT_IMAGE1D_BUFFER) {
199201
if (blitDirection == BlitterConstants::BlitDirection::HostPtrToImage) {

opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,31 @@ HWTEST_F(BcsTestsImages, givenImageWithSurfaceOffsetWhenAdjustBlitPropertiesForI
15341534
EXPECT_EQ(blitProperties.dstGpuAddress, expectedGpuAddress);
15351535
}
15361536

1537+
HWTEST_F(BcsTestsImages, givenImageWithPlaneSetWhenAdjustBlitPropertiesForImageIsCalledThenPlaneIsCorrect) {
1538+
cl_image_desc imgDesc = Image1dDefaults::imageDesc;
1539+
std::unique_ptr<Image> image(Image2dArrayHelper<>::create(context.get(), &imgDesc));
1540+
1541+
BlitProperties blitProperties{};
1542+
1543+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_NO_PLANE, blitProperties.dstPlane);
1544+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_NO_PLANE, blitProperties.srcPlane);
1545+
1546+
ClBlitProperties::adjustBlitPropertiesForImage(image.get(), blitProperties, rowPitch, slicePitch, false);
1547+
ClBlitProperties::adjustBlitPropertiesForImage(image.get(), blitProperties, rowPitch, slicePitch, true);
1548+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_NO_PLANE, blitProperties.dstPlane);
1549+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_NO_PLANE, blitProperties.srcPlane);
1550+
1551+
image->setPlane(GMM_YUV_PLANE_ENUM::GMM_PLANE_Y);
1552+
ClBlitProperties::adjustBlitPropertiesForImage(image.get(), blitProperties, rowPitch, slicePitch, false);
1553+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_PLANE_Y, blitProperties.dstPlane);
1554+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_NO_PLANE, blitProperties.srcPlane);
1555+
1556+
image->setPlane(GMM_YUV_PLANE_ENUM::GMM_PLANE_U);
1557+
ClBlitProperties::adjustBlitPropertiesForImage(image.get(), blitProperties, rowPitch, slicePitch, true);
1558+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_PLANE_Y, blitProperties.dstPlane);
1559+
EXPECT_EQ(GMM_YUV_PLANE_ENUM::GMM_PLANE_U, blitProperties.srcPlane);
1560+
}
1561+
15371562
HWTEST_F(BcsTests, givenHostPtrToImageWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
15381563
constexpr size_t hostAllocationSize = MemoryConstants::pageSize;
15391564
auto hostAllocationPtr = allocateAlignedMemory(hostAllocationSize, MemoryConstants::pageSize);

shared/source/command_container/command_encoder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ struct EncodeWA {
309309
static void setAdditionalPipeControlFlagsForNonPipelineStateCommand(PipeControlArgs &args);
310310

311311
static void addPipeControlBeforeStateBaseAddress(LinearStream &commandStream, const HardwareInfo &hwInfo, bool isRcs);
312+
313+
static void adjustCompressionFormatForPlanarImage(uint32_t &compressionFormat, GMM_YUV_PLANE_ENUM plane);
312314
};
313315

314316
template <typename GfxFamily>

shared/source/command_container/command_encoder_bdw_and_later.inl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,10 @@ inline void EncodeWA<GfxFamily>::addPipeControlBeforeStateBaseAddress(LinearStre
438438
NEO::EncodeWA<GfxFamily>::addPipeControlPriorToNonPipelinedStateCommand(commandStream, args, hwInfo, isRcs);
439439
}
440440

441+
template <typename GfxFamily>
442+
inline void EncodeWA<GfxFamily>::adjustCompressionFormatForPlanarImage(uint32_t &compressionFormat, GMM_YUV_PLANE_ENUM plane) {
443+
}
444+
441445
template <typename GfxFamily>
442446
inline void EncodeSurfaceState<GfxFamily>::encodeExtraBufferParams(EncodeSurfaceStateArgs &args) {
443447
auto surfaceState = reinterpret_cast<R_SURFACE_STATE *>(args.outMemory);

shared/source/command_container/command_encoder_xehp_and_later.inl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,15 @@ inline void EncodeWA<Family>::addPipeControlPriorToNonPipelinedStateCommand(Line
694694
MemorySynchronizationCommands<Family>::addPipeControl(commandStream, args);
695695
}
696696

697+
template <typename Family>
698+
void EncodeWA<Family>::adjustCompressionFormatForPlanarImage(uint32_t &compressionFormat, GMM_YUV_PLANE_ENUM plane) {
699+
if (plane == GMM_PLANE_Y) {
700+
compressionFormat &= 0xf;
701+
} else if ((plane == GMM_PLANE_U) || (plane == GMM_PLANE_V)) {
702+
compressionFormat |= 0x10;
703+
}
704+
}
705+
697706
template <typename Family>
698707
inline void EncodeStoreMemory<Family>::programStoreDataImm(MI_STORE_DATA_IMM *cmdBuffer,
699708
uint64_t gpuAddress,

shared/source/command_container/image_surface_state/compression_params_xehp_and_later.inl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ void EncodeSurfaceState<Family>::appendImageCompressionParams(R_SURFACE_STATE *s
1616
const auto ccsMode = R_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E;
1717
const auto mcsLceMode = R_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_MCS_LCE;
1818
if ((ccsMode == surfaceState->getAuxiliarySurfaceMode() || mcsLceMode == surfaceState->getAuxiliarySurfaceMode() || surfaceState->getMemoryCompressionEnable())) {
19-
uint8_t compressionFormat;
19+
uint32_t compressionFormat;
2020
auto gmmResourceInfo = allocation->getDefaultGmm()->gmmResourceInfo.get();
2121
if (gmmResourceInfo->getResourceFlags()->Info.MediaCompressed) {
2222
compressionFormat = gmmHelper->getClientContext()->getMediaSurfaceStateCompressionFormat(gmmResourceInfo->getResourceFormat());
23-
if (plane == GMM_PLANE_Y) {
24-
compressionFormat &= 0xf;
25-
} else if ((plane == GMM_PLANE_U) || (plane == GMM_PLANE_V)) {
26-
compressionFormat |= 0x10;
27-
}
23+
EncodeWA<Family>::adjustCompressionFormatForPlanarImage(compressionFormat, plane);
2824
} else {
2925
compressionFormat = gmmHelper->getClientContext()->getSurfaceStateCompressionFormat(gmmResourceInfo->getResourceFormat());
3026
}

shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ void BlitCommandsHelper<Family>::appendColorDepth(const BlitProperties &blitProp
5858
}
5959

6060
template <>
61-
void BlitCommandsHelper<Family>::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails, const RootDeviceEnvironment &rootDeviceEnvironment) {
61+
void BlitCommandsHelper<Family>::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch,
62+
GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails,
63+
const RootDeviceEnvironment &rootDeviceEnvironment, GMM_YUV_PLANE_ENUM plane) {
6264
if (allocation.getDefaultGmm()) {
6365
auto gmmResourceInfo = allocation.getDefaultGmm()->gmmResourceInfo.get();
6466
if (!gmmResourceInfo->getResourceFlags()->Info.Linear) {
@@ -90,8 +92,10 @@ void BlitCommandsHelper<Family>::appendBlitCommandsForImages(const BlitPropertie
9092
uint32_t mipTailLod = 0;
9193
auto compressionDetails = 0u;
9294

93-
getBlitAllocationProperties(*srcAllocation, srcRowPitch, srcQPitch, tileType, mipTailLod, compressionDetails, rootDeviceEnvironment);
94-
getBlitAllocationProperties(*dstAllocation, dstRowPitch, dstQPitch, tileType, mipTailLod, compressionDetails, rootDeviceEnvironment);
95+
getBlitAllocationProperties(*srcAllocation, srcRowPitch, srcQPitch, tileType, mipTailLod, compressionDetails,
96+
rootDeviceEnvironment, blitProperties.srcPlane);
97+
getBlitAllocationProperties(*dstAllocation, dstRowPitch, dstQPitch, tileType, mipTailLod, compressionDetails,
98+
rootDeviceEnvironment, blitProperties.dstPlane);
9599

96100
blitCmd.setSourcePitch(srcRowPitch);
97101
blitCmd.setDestinationPitch(dstRowPitch);

shared/source/helpers/blit_commands_helper.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ struct BlitProperties {
8383
Vec3<size_t> dstSize = 0;
8484
Vec3<size_t> srcSize = 0;
8585
size_t bytesPerPixel = 1;
86+
GMM_YUV_PLANE_ENUM dstPlane = GMM_YUV_PLANE_ENUM::GMM_NO_PLANE;
87+
GMM_YUV_PLANE_ENUM srcPlane = GMM_YUV_PLANE_ENUM::GMM_NO_PLANE;
8688

8789
bool isImageOperation() const {
8890
return blitDirection == BlitterConstants::BlitDirection::HostPtrToImage ||
@@ -157,7 +159,9 @@ struct BlitCommandsHelper {
157159
static void appendTilingType(const GMM_TILE_TYPE srcTilingType, const GMM_TILE_TYPE dstTilingType, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd);
158160
static void appendSliceOffsets(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, uint32_t sliceIndex, const RootDeviceEnvironment &rootDeviceEnvironment, uint32_t srcSlicePitch, uint32_t dstSlicePitch);
159161
static void appendBaseAddressOffset(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, const uint32_t originalSliceIndex, const bool isSource);
160-
static void getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails, const RootDeviceEnvironment &rootDeviceEnvironment);
162+
static void getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, GMM_TILE_TYPE &tileType,
163+
uint32_t &mipTailLod, uint32_t &compressionDetails, const RootDeviceEnvironment &rootDeviceEnvironment,
164+
GMM_YUV_PLANE_ENUM plane);
161165
static void dispatchDebugPauseCommands(LinearStream &commandStream, uint64_t debugPauseStateGPUAddress, DebugPauseState confirmationTrigger,
162166
DebugPauseState waitCondition, const HardwareInfo &hwInfo);
163167
static size_t getSizeForDebugPauseCommands();

shared/source/helpers/blit_commands_helper_bdw_and_later.inl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ void BlitCommandsHelper<GfxFamily>::appendSliceOffsets(const BlitProperties &bli
7474
}
7575

7676
template <typename GfxFamily>
77-
void BlitCommandsHelper<GfxFamily>::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails, const RootDeviceEnvironment &rootDeviceEnvironment) {
77+
void BlitCommandsHelper<GfxFamily>::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch,
78+
GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails,
79+
const RootDeviceEnvironment &rootDeviceEnvironment, GMM_YUV_PLANE_ENUM plane) {
7880
}
7981

8082
template <typename GfxFamily>

shared/source/helpers/blit_commands_helper_xehp_and_later.inl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ void BlitCommandsHelper<GfxFamily>::appendColorDepth(const BlitProperties &blitP
266266
}
267267

268268
template <typename GfxFamily>
269-
void BlitCommandsHelper<GfxFamily>::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails, const RootDeviceEnvironment &rootDeviceEnvironment) {
269+
void BlitCommandsHelper<GfxFamily>::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch,
270+
GMM_TILE_TYPE &tileType, uint32_t &mipTailLod, uint32_t &compressionDetails,
271+
const RootDeviceEnvironment &rootDeviceEnvironment, GMM_YUV_PLANE_ENUM plane) {
270272
if (allocation.getDefaultGmm()) {
271273
auto gmmResourceInfo = allocation.getDefaultGmm()->gmmResourceInfo.get();
272274
mipTailLod = gmmResourceInfo->getMipTailStartLodSurfaceState();
@@ -285,6 +287,7 @@ void BlitCommandsHelper<GfxFamily>::getBlitAllocationProperties(const GraphicsAl
285287
auto gmmClientContext = rootDeviceEnvironment.getGmmClientContext();
286288
if (resInfo.MediaCompressed) {
287289
compressionDetails = gmmClientContext->getMediaSurfaceStateCompressionFormat(gmmResourceInfo->getResourceFormat());
290+
EncodeWA<GfxFamily>::adjustCompressionFormatForPlanarImage(compressionDetails, plane);
288291
} else if (resInfo.RenderCompressed) {
289292
compressionDetails = gmmClientContext->getSurfaceStateCompressionFormat(gmmResourceInfo->getResourceFormat());
290293
}
@@ -306,8 +309,10 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForImages(const BlitProper
306309
auto srcCompressionFormat = blitCmd.getSourceCompressionFormat();
307310
auto dstCompressionFormat = blitCmd.getDestinationCompressionFormat();
308311

309-
getBlitAllocationProperties(*srcAllocation, srcRowPitch, srcQPitch, srcTileType, srcMipTailLod, srcCompressionFormat, rootDeviceEnvironment);
310-
getBlitAllocationProperties(*dstAllocation, dstRowPitch, dstQPitch, dstTileType, dstMipTailLod, dstCompressionFormat, rootDeviceEnvironment);
312+
getBlitAllocationProperties(*srcAllocation, srcRowPitch, srcQPitch, srcTileType, srcMipTailLod, srcCompressionFormat,
313+
rootDeviceEnvironment, blitProperties.srcPlane);
314+
getBlitAllocationProperties(*dstAllocation, dstRowPitch, dstQPitch, dstTileType, dstMipTailLod, dstCompressionFormat,
315+
rootDeviceEnvironment, blitProperties.dstPlane);
311316

312317
srcSlicePitch = std::max(srcSlicePitch, srcRowPitch * srcQPitch);
313318
dstSlicePitch = std::max(dstSlicePitch, dstRowPitch * dstQPitch);

shared/test/common/helpers/blit_commands_helper_tests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ HWTEST2_F(BlitTests, givenGen9AndGetBlitAllocationPropertiesThenCorrectValuesAre
529529
auto expectedMipTailLod = mipTailLod;
530530
auto compressionDetails = 0u;
531531

532-
NEO::BlitCommandsHelper<FamilyType>::getBlitAllocationProperties(alloc, pitch, qPitch, tileType, mipTailLod, compressionDetails, pDevice->getRootDeviceEnvironment());
532+
NEO::BlitCommandsHelper<FamilyType>::getBlitAllocationProperties(alloc, pitch, qPitch, tileType, mipTailLod, compressionDetails,
533+
pDevice->getRootDeviceEnvironment(), GMM_YUV_PLANE_ENUM::GMM_NO_PLANE);
533534

534535
EXPECT_EQ(expectedPitch, pitch);
535536
EXPECT_EQ(expectedQPitch, qPitch);

shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "shared/test/common/helpers/blit_commands_helper_tests.inl"
1212
#include "shared/test/common/helpers/debug_manager_state_restore.h"
1313
#include "shared/test/common/mocks/mock_gmm.h"
14+
#include "shared/test/common/mocks/mock_gmm_client_context.h"
1415
#include "shared/test/common/mocks/ult_device_factory.h"
1516

1617
#include "gtest/gtest.h"
@@ -606,7 +607,8 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenGetBlitAllocationPropertiesIsCalledThenCo
606607
uint32_t mipTailLod = 0;
607608
uint32_t compressionFormat = 0;
608609
auto rowPitch = static_cast<uint32_t>(properties.srcRowPitch);
609-
BlitCommandsHelper<FamilyType>::getBlitAllocationProperties(*properties.srcAllocation, rowPitch, qPitch, tileType, mipTailLod, compressionFormat, pDevice->getRootDeviceEnvironment());
610+
BlitCommandsHelper<FamilyType>::getBlitAllocationProperties(*properties.srcAllocation, rowPitch, qPitch, tileType, mipTailLod,
611+
compressionFormat, pDevice->getRootDeviceEnvironment(), GMM_YUV_PLANE_ENUM::GMM_NO_PLANE);
610612

611613
if (compressionExpected) {
612614
EXPECT_GT(compressionFormat, 0u);
@@ -616,6 +618,60 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenGetBlitAllocationPropertiesIsCalledThenCo
616618
}
617619
}
618620

621+
HWTEST2_F(BlitTests, givenPlaneWhenGetBlitAllocationPropertiesIsCalledThenCompressionFormatIsProperlyAdjusted, CompressionParamsSupportedMatcher) {
622+
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
623+
624+
struct {
625+
uint8_t returnedCompressionFormat;
626+
uint8_t expectedCompressionFormat;
627+
GMM_YUV_PLANE_ENUM plane;
628+
} testInputs[] = {
629+
// regular image
630+
{0x0, 0x0, GMM_NO_PLANE},
631+
{0xF, 0xF, GMM_NO_PLANE},
632+
{0x10, 0x10, GMM_NO_PLANE},
633+
{0x1F, 0x1F, GMM_NO_PLANE},
634+
// luma plane
635+
{0x0, 0x0, GMM_PLANE_Y},
636+
{0xF, 0xF, GMM_PLANE_Y},
637+
{0x10, 0x0, GMM_PLANE_Y},
638+
{0x1F, 0xF, GMM_PLANE_Y},
639+
// chroma plane
640+
{0x0, 0x10, GMM_PLANE_U},
641+
{0x0, 0x10, GMM_PLANE_V},
642+
{0xF, 0x1F, GMM_PLANE_U},
643+
{0xF, 0x1F, GMM_PLANE_V},
644+
{0x10, 0x10, GMM_PLANE_U},
645+
{0x10, 0x10, GMM_PLANE_V},
646+
{0x1F, 0x1F, GMM_PLANE_U},
647+
{0x1F, 0x1F, GMM_PLANE_V},
648+
};
649+
650+
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmClientContext());
651+
auto &resInfo = static_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get())->getResourceFlags()->Info;
652+
resInfo.MediaCompressed = true;
653+
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
654+
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
655+
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
656+
auto gmmClientContext = static_cast<MockGmmClientContext *>(pDevice->getGmmHelper()->getClientContext());
657+
mockAllocationSrc.setGmm(gmm.get(), 0);
658+
BlitProperties properties = {};
659+
properties.srcAllocation = &mockAllocationSrc;
660+
uint32_t qPitch = static_cast<uint32_t>(properties.copySize.y);
661+
GMM_TILE_TYPE tileType = GMM_NOT_TILED;
662+
uint32_t mipTailLod = 0;
663+
uint32_t compressionFormat = 0;
664+
auto rowPitch = static_cast<uint32_t>(properties.srcRowPitch);
665+
666+
for (auto &testInput : testInputs) {
667+
gmmClientContext->compressionFormatToReturn = testInput.returnedCompressionFormat;
668+
BlitCommandsHelper<FamilyType>::getBlitAllocationProperties(*properties.srcAllocation, rowPitch, qPitch, tileType, mipTailLod,
669+
compressionFormat, pDevice->getRootDeviceEnvironment(), testInput.plane);
670+
671+
EXPECT_EQ(testInput.expectedCompressionFormat, compressionFormat);
672+
}
673+
}
674+
619675
HWTEST2_F(BlitTests, givenA0orA1SteppingAndCpuLocalMemoryAccessWhenCallingAppendExtraMemoryPropertiesThenTargetMemoryIsSet, IsXeHpCore) {
620676
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
621677
DebugManagerStateRestore dbgRestore;

shared/test/unit_test/encoders/test_command_encoder.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,16 @@ HWTEST_F(CommandEncoderTest, givenPlatformSupportingMiMemFenceWhenEncodingThenPr
170170
EXPECT_EQ(0u, size);
171171
EXPECT_EQ(0u, cmdStream.getUsed());
172172
}
173-
}
173+
}
174+
175+
HWTEST2_F(CommandEncoderTest, whenAdjustCompressionFormatForPlanarImageThenNothingHappens, IsAtMostGen12lp) {
176+
for (auto plane : {GMM_NO_PLANE, GMM_PLANE_Y, GMM_PLANE_U, GMM_PLANE_V}) {
177+
uint32_t compressionFormat = 0u;
178+
EncodeWA<FamilyType>::adjustCompressionFormatForPlanarImage(compressionFormat, plane);
179+
EXPECT_EQ(0u, compressionFormat);
180+
181+
compressionFormat = 0xFFu;
182+
EncodeWA<FamilyType>::adjustCompressionFormatForPlanarImage(compressionFormat, plane);
183+
EXPECT_EQ(0xFFu, compressionFormat);
184+
}
185+
}

0 commit comments

Comments
 (0)