Skip to content

Commit a9fe74c

Browse files
Don't use BCS for NV12 images
Signed-off-by: Kamil Kopryk <[email protected]> Related-To: NEO-4692
1 parent 6ea3f57 commit a9fe74c

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

opencl/source/command_queue/command_queue.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ bool CommandQueue::blitEnqueueImageAllowed(const size_t *origin, const size_t *r
756756

757757
blitEnqueuImageAllowed &= (origin[0] + region[0] <= BlitterConstants::maxBlitWidth) && (origin[1] + region[1] <= BlitterConstants::maxBlitHeight);
758758
blitEnqueuImageAllowed &= !isMipMapped(image.getImageDesc());
759+
blitEnqueuImageAllowed &= !IsNV12Image(&image.getImageFormat());
760+
759761
return blitEnqueuImageAllowed;
760762
}
761763

opencl/test/unit_test/command_queue/command_queue_tests.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,23 @@ TEST(CommandQueue, givenMipMappedImageWhenCallingBlitEnqueueImageAllowedThenCorr
13531353
EXPECT_FALSE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
13541354
}
13551355

1356+
TEST(CommandQueue, givenNV12ImageWhenCallingBlitEnqueueImageAllowedThenCorrectResultIsReturned) {
1357+
DebugManagerStateRestore restorer;
1358+
DebugManager.flags.EnableBlitterForReadWriteImage.set(1);
1359+
MockContext context{};
1360+
MockCommandQueue queue(&context, context.getDevice(0), 0);
1361+
1362+
size_t correctRegion[3] = {10u, 10u, 0};
1363+
size_t correctOrigin[3] = {1u, 1u, 0};
1364+
MockImageBase image;
1365+
1366+
image.imageFormat.image_channel_order = CL_NV12_INTEL;
1367+
EXPECT_FALSE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
1368+
1369+
image.imageFormat.image_channel_order = CL_RGBA;
1370+
EXPECT_TRUE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
1371+
}
1372+
13561373
TEST(CommandQueue, givenSupportForOperationWhenValidatingSupportThenReturnSuccess) {
13571374
MockCommandQueue queue{};
13581375

opencl/test/unit_test/mocks/mock_image.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace NEO {
1717

1818
struct MockImageBase : public Image {
1919
using Image::imageDesc;
20+
using Image::imageFormat;
2021
MockGraphicsAllocation *graphicsAllocation = nullptr;
2122

2223
MockImageBase() : Image(

0 commit comments

Comments
 (0)