From 3f46155e47325103b5cbf23222f9538c8fd43357 Mon Sep 17 00:00:00 2001 From: WenshengZhang Date: Tue, 6 Aug 2024 19:02:23 +0800 Subject: [PATCH] [VP] refine code for DdiMedia_CreateImage and DdiMedia_PutImage refine code for DdiMedia_CreateImage and DdiMedia_PutImage. --- media_driver/linux/common/ddi/media_libva.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp index 7131f053992..e5df7bea54c 100755 --- a/media_driver/linux/common/ddi/media_libva.cpp +++ b/media_driver/linux/common/ddi/media_libva.cpp @@ -4696,13 +4696,7 @@ VAStatus DdiMedia_CreateImage( vaimg->offsets[1] = offsetU; if (height % 2 == 1) { - uint32_t upperSize = pitch * MOS_ALIGN_CEIL(height, 2) / 2; - uint32_t lowerSize = pitch * height / 2; - uint32_t remainSize = size - offsetU; - if (remainSize >= lowerSize && remainSize < upperSize) - { - vaimg->data_size = offsetU + pitch * MOS_ALIGN_CEIL(height, 2) / 2; - } + vaimg->data_size += pitch; } break; case VA_FOURCC_YV12: @@ -5621,7 +5615,7 @@ VAStatus DdiMedia_PutImage( } //Copy data from image to temp surferce - MOS_STATUS eStatus = MOS_SecureMemcpy(tempSurfData, vaimg->data_size, imageData, vaimg->data_size); + MOS_STATUS eStatus = MOS_SecureMemcpy(tempSurfData, tempMediaSurface->data_size, imageData, vaimg->data_size); if (eStatus != MOS_STATUS_SUCCESS) { DDI_ASSERTMESSAGE("Failed to copy image to surface buffer.");