mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add missing ULT for va sharing functions
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
54042a191e
commit
ffe8c75291
@ -124,7 +124,7 @@ class VASharingFunctionsMock : public VASharingFunctions {
|
||||
return queryImageFormatsReturnStatus;
|
||||
}
|
||||
if (numFormats) {
|
||||
*numFormats = 4;
|
||||
*numFormats = 5;
|
||||
}
|
||||
|
||||
if (formatList) {
|
||||
@ -143,12 +143,16 @@ class VASharingFunctionsMock : public VASharingFunctions {
|
||||
formatList[3].fourcc = VA_FOURCC_RGBP;
|
||||
formatList[3].bits_per_pixel = 8;
|
||||
formatList[3].byte_order = VA_LSB_FIRST;
|
||||
|
||||
formatList[4].fourcc = VA_FOURCC_YUY2;
|
||||
formatList[4].bits_per_pixel = 16;
|
||||
formatList[4].byte_order = VA_LSB_FIRST;
|
||||
}
|
||||
return VA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
int maxNumImageFormats(VADisplay vaDisplay) override {
|
||||
return 4;
|
||||
return 5;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1110,6 +1110,7 @@ TEST_F(ApiVaSharingTests, givenSupportedImageTypeWhenGettingSupportedVAApiFormat
|
||||
supportedFormats.push_back(std::make_unique<VAImageFormat>(VAImageFormat{VA_FOURCC_NV12, VA_LSB_FIRST, 0, 0, 0, 0, 0, 0}));
|
||||
supportedFormats.push_back(std::make_unique<VAImageFormat>(VAImageFormat{VA_FOURCC_P010, VA_LSB_FIRST, 0, 0, 0, 0, 0, 0}));
|
||||
supportedFormats.push_back(std::make_unique<VAImageFormat>(VAImageFormat{VA_FOURCC_P016, VA_LSB_FIRST, 0, 0, 0, 0, 0, 0}));
|
||||
supportedFormats.push_back(std::make_unique<VAImageFormat>(VAImageFormat{VA_FOURCC_YUY2, VA_LSB_FIRST, 0, 0, 0, 0, 0, 0}));
|
||||
|
||||
for (auto flag : flags) {
|
||||
|
||||
@ -1125,7 +1126,7 @@ TEST_F(ApiVaSharingTests, givenSupportedImageTypeWhenGettingSupportedVAApiFormat
|
||||
&numImageFormats);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(3u, numImageFormats);
|
||||
EXPECT_EQ(4u, numImageFormats);
|
||||
int i = 0;
|
||||
for (auto &format : supportedFormats) {
|
||||
EXPECT_EQ(format->fourcc, vaApiFormats[i++].fourcc);
|
||||
@ -1151,7 +1152,7 @@ TEST_F(ApiVaSharingTests, givenZeroNumEntriesWhenGettingSupportedVAApiFormatsThe
|
||||
&numImageFormats);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, result);
|
||||
EXPECT_EQ(3u, numImageFormats);
|
||||
EXPECT_EQ(4u, numImageFormats);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1477,6 +1478,30 @@ TEST_F(VaSharingTests, givenPlaneArgumentLessThan2WithProperFormatsAndSupportedF
|
||||
EXPECT_EQ(static_cast<uint32_t>(VA_FOURCC_YUY2), vaApiFormats[4].fourcc);
|
||||
}
|
||||
|
||||
TEST_F(VaSharingTests, givenPlaneArgumentLessThan2WithPackedFormatsAndSupportedFormatsVectorsThenAllPackedFormatsAreReturned) {
|
||||
VASharingFunctionsMock sharingFunctions;
|
||||
EXPECT_EQ(sharingFunctions.supported2PlaneFormats.size(), 0u);
|
||||
EXPECT_EQ(sharingFunctions.supported3PlaneFormats.size(), 0u);
|
||||
EXPECT_EQ(sharingFunctions.supportedPackedFormats.size(), 0u);
|
||||
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
cl_mem_object_type imageType = CL_MEM_OBJECT_IMAGE2D;
|
||||
cl_uint numImageFormats = 5;
|
||||
VAImageFormat vaApiFormats[5] = {};
|
||||
|
||||
sharingFunctions.supportedPackedFormats.push_back(VAImageFormat{VA_FOURCC_YUY2, VA_LSB_FIRST, 0, 0, 0, 0, 0, 0});
|
||||
|
||||
sharingFunctions.getSupportedFormats(
|
||||
flags,
|
||||
imageType,
|
||||
0,
|
||||
5,
|
||||
vaApiFormats,
|
||||
&numImageFormats);
|
||||
|
||||
EXPECT_EQ(static_cast<uint32_t>(VA_FOURCC_YUY2), vaApiFormats[0].fourcc);
|
||||
}
|
||||
|
||||
TEST_F(VaSharingTests, givenPlaneArgumentLessThan2WithProperFormatsAndOnly3PlaneSupportedFormatsVectorThen3PlaneFormatIsReturned) {
|
||||
VASharingFunctionsMock sharingFunctions;
|
||||
EXPECT_EQ(sharingFunctions.supported2PlaneFormats.size(), 0u);
|
||||
|
Reference in New Issue
Block a user