Skip to content

Commit a6c6a22

Browse files
pingluxintel-mediadev
authored andcommitted
Revert "[Media Common] [MCPY] [PDVT-SH] Set ColorDepth per GMM bpp value and adjust corresponding destination right"
This reverts commit f96eb02.
1 parent 524f793 commit a6c6a22

File tree

1 file changed

+37
-38
lines changed

1 file changed

+37
-38
lines changed

media_softlet/agnostic/common/shared/mediacopy/media_blt_copy_next.cpp

+37-38
Original file line numberDiff line numberDiff line change
@@ -766,28 +766,22 @@ MOS_STATUS BltStateNext::SetupBltCopyParam(
766766
pMhwBltParams->dwColorDepth = GetBlkCopyColorDepth(outputSurface->pGmmResInfo->GetResourceFormat(), BitsPerPixel);
767767
pMhwBltParams->dwDstRight = std::min(inputWidth, outputWidth);
768768
pMhwBltParams->dwDstBottom = std::min(inputHeight, outputHeight);
769-
if (ResDetails.Format == Format_YUY2 || ResDetails.Format == Format_Y210 || ResDetails.Format == Format_Y216)
770-
{
771-
// packed YUV, dst right should be half of width
772-
pMhwBltParams->dwDstRight /= 2;
773-
}
769+
774770
// The 2nd and 3nd layer.
775771
if (planeNum == TWO_PLANES || planeNum == THREE_PLANES)
776772
{
777-
int bytePerTexelScaling = GetBytesPerTexelScaling(ResDetails.Format);
773+
int bytePerTexelScaling = GetBytesPerTexelScaling(ResDetails.Format);
774+
778775
if (MCPY_PLANE_U == planeIndex || MCPY_PLANE_V == planeIndex)
779776
{
780-
// bpp of interleved chroma plane is double of luma plane bpp
781-
pMhwBltParams->dwColorDepth = GetBlkCopyColorDepth(outputSurface->pGmmResInfo->GetResourceFormat(), BitsPerPixel * bytePerTexelScaling);
782-
pMhwBltParams->dwDstRight = pMhwBltParams->dwDstRight / bytePerTexelScaling;
783-
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / bytePerTexelScaling;
784-
if (ResDetails.Format == Format_I420 || ResDetails.Format == Format_YV12)
785-
{
786-
pMhwBltParams->dwDstPitch = pMhwBltParams->dwDstPitch / 2;
787-
pMhwBltParams->dwSrcPitch = pMhwBltParams->dwSrcPitch / 2;
788-
pMhwBltParams->dwDstRight = pMhwBltParams->dwDstRight / 2;
789-
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / 2;
790-
}
777+
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / bytePerTexelScaling;
778+
if (ResDetails.Format == Format_I420 || ResDetails.Format == Format_YV12)
779+
{
780+
pMhwBltParams->dwDstPitch = pMhwBltParams->dwDstPitch / 2;
781+
pMhwBltParams->dwSrcPitch = pMhwBltParams->dwSrcPitch / 2;
782+
pMhwBltParams->dwDstRight = pMhwBltParams->dwDstRight / 2;
783+
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / 2;
784+
}
791785
}
792786
}
793787
pMhwBltParams->pSrcOsResource = inputSurface;
@@ -941,32 +935,37 @@ uint32_t BltStateNext::GetBlkCopyColorDepth(
941935
GMM_RESOURCE_FORMAT dstFormat,
942936
uint32_t BitsPerPixel)
943937
{
938+
if (dstFormat == GMM_FORMAT_YUY2_2x1 || dstFormat == GMM_FORMAT_Y216_TYPE || dstFormat == GMM_FORMAT_Y210)
939+
{// GMM_FORMAT_YUY2_2x1 32bpe 2x1 pixel blocks instead of 16bpp 1x1 block
940+
// GMM_FORMAT_Y216_TYPE/Y210 64bpe pixel blocks instead of 32bpp block.
941+
BitsPerPixel = BitsPerPixel / 2;
942+
}
944943
switch (BitsPerPixel)
945944
{
946-
case 16:
947-
switch (dstFormat)
948-
{
949-
case GMM_FORMAT_B5G5R5A1_UNORM:
950-
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
951-
default:
952-
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_16BITCOLOR;
953-
}
954-
case 32:
955-
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
956-
case 64:
957-
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_64BITCOLOR;
958-
case 96:
959-
MCPY_ASSERTMESSAGE("96 BitPerPixel support limimated as Linear format %d", dstFormat);
960-
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_96BITCOLOR_ONLYLINEARCASEISSUPPORTED;
961-
case 128:
962-
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_128BITCOLOR;
963-
case 8:
964-
default:
965-
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_8BITCOLOR;
945+
case 16:
946+
switch (dstFormat)
947+
{
948+
case GMM_FORMAT_B5G5R5A1_UNORM:
949+
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
950+
default:
951+
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_16BITCOLOR;
952+
}
953+
case 32:
954+
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
955+
case 64:
956+
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_64BITCOLOR;
957+
case 96:
958+
MCPY_ASSERTMESSAGE("96 BitPerPixel support limimated as Linear format %d", dstFormat);
959+
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_96BITCOLOR_ONLYLINEARCASEISSUPPORTED;
960+
case 128:
961+
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_128BITCOLOR;
962+
case 8:
963+
default:
964+
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_8BITCOLOR;
966965
}
967966
}
968967

969-
int BltStateNext::GetBytesPerTexelScaling(MOS_FORMAT format)
968+
int BltStateNext::GetBytesPerTexelScaling(MOS_FORMAT format)
970969
{
971970
int dstBytesPerTexel = 1;
972971
switch (format)

0 commit comments

Comments
 (0)