Skip to content

Commit

Permalink
Revert "[Media Common] [MCPY] [PDVT-SH] Set ColorDepth per GMM bpp va…
Browse files Browse the repository at this point in the history
…lue and adjust corresponding destination right"

This reverts commit f96eb02.
  • Loading branch information
pinglux authored and intel-mediadev committed Mar 3, 2025
1 parent 524f793 commit a6c6a22
Showing 1 changed file with 37 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -766,28 +766,22 @@ MOS_STATUS BltStateNext::SetupBltCopyParam(
pMhwBltParams->dwColorDepth = GetBlkCopyColorDepth(outputSurface->pGmmResInfo->GetResourceFormat(), BitsPerPixel);
pMhwBltParams->dwDstRight = std::min(inputWidth, outputWidth);
pMhwBltParams->dwDstBottom = std::min(inputHeight, outputHeight);
if (ResDetails.Format == Format_YUY2 || ResDetails.Format == Format_Y210 || ResDetails.Format == Format_Y216)
{
// packed YUV, dst right should be half of width
pMhwBltParams->dwDstRight /= 2;
}

// The 2nd and 3nd layer.
if (planeNum == TWO_PLANES || planeNum == THREE_PLANES)
{
int bytePerTexelScaling = GetBytesPerTexelScaling(ResDetails.Format);
int bytePerTexelScaling = GetBytesPerTexelScaling(ResDetails.Format);

if (MCPY_PLANE_U == planeIndex || MCPY_PLANE_V == planeIndex)
{
// bpp of interleved chroma plane is double of luma plane bpp
pMhwBltParams->dwColorDepth = GetBlkCopyColorDepth(outputSurface->pGmmResInfo->GetResourceFormat(), BitsPerPixel * bytePerTexelScaling);
pMhwBltParams->dwDstRight = pMhwBltParams->dwDstRight / bytePerTexelScaling;
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / bytePerTexelScaling;
if (ResDetails.Format == Format_I420 || ResDetails.Format == Format_YV12)
{
pMhwBltParams->dwDstPitch = pMhwBltParams->dwDstPitch / 2;
pMhwBltParams->dwSrcPitch = pMhwBltParams->dwSrcPitch / 2;
pMhwBltParams->dwDstRight = pMhwBltParams->dwDstRight / 2;
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / 2;
}
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / bytePerTexelScaling;
if (ResDetails.Format == Format_I420 || ResDetails.Format == Format_YV12)
{
pMhwBltParams->dwDstPitch = pMhwBltParams->dwDstPitch / 2;
pMhwBltParams->dwSrcPitch = pMhwBltParams->dwSrcPitch / 2;
pMhwBltParams->dwDstRight = pMhwBltParams->dwDstRight / 2;
pMhwBltParams->dwDstBottom = pMhwBltParams->dwDstBottom / 2;
}
}
}
pMhwBltParams->pSrcOsResource = inputSurface;
Expand Down Expand Up @@ -941,32 +935,37 @@ uint32_t BltStateNext::GetBlkCopyColorDepth(
GMM_RESOURCE_FORMAT dstFormat,
uint32_t BitsPerPixel)
{
if (dstFormat == GMM_FORMAT_YUY2_2x1 || dstFormat == GMM_FORMAT_Y216_TYPE || dstFormat == GMM_FORMAT_Y210)
{// GMM_FORMAT_YUY2_2x1 32bpe 2x1 pixel blocks instead of 16bpp 1x1 block
// GMM_FORMAT_Y216_TYPE/Y210 64bpe pixel blocks instead of 32bpp block.
BitsPerPixel = BitsPerPixel / 2;
}
switch (BitsPerPixel)
{
case 16:
switch (dstFormat)
{
case GMM_FORMAT_B5G5R5A1_UNORM:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
default:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_16BITCOLOR;
}
case 32:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
case 64:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_64BITCOLOR;
case 96:
MCPY_ASSERTMESSAGE("96 BitPerPixel support limimated as Linear format %d", dstFormat);
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_96BITCOLOR_ONLYLINEARCASEISSUPPORTED;
case 128:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_128BITCOLOR;
case 8:
default:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_8BITCOLOR;
case 16:
switch (dstFormat)
{
case GMM_FORMAT_B5G5R5A1_UNORM:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
default:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_16BITCOLOR;
}
case 32:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_32BITCOLOR;
case 64:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_64BITCOLOR;
case 96:
MCPY_ASSERTMESSAGE("96 BitPerPixel support limimated as Linear format %d", dstFormat);
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_96BITCOLOR_ONLYLINEARCASEISSUPPORTED;
case 128:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_128BITCOLOR;
case 8:
default:
return mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::COLOR_DEPTH_8BITCOLOR;
}
}

int BltStateNext::GetBytesPerTexelScaling(MOS_FORMAT format)
int BltStateNext::GetBytesPerTexelScaling(MOS_FORMAT format)
{
int dstBytesPerTexel = 1;
switch (format)
Expand Down

0 comments on commit a6c6a22

Please sign in to comment.