Skip to content

Commit

Permalink
[VP] fix correption caused by 3d compression control surface not clea…
Browse files Browse the repository at this point in the history
…ned when target format be argb16

fix correption caused by 3d compression control surface not cleaned when target format be argb16.
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Jan 5, 2025
1 parent 7d929f6 commit ab7072f
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,23 @@ bool SfcRenderXe_Xpm_Base::IsCscNeeded(SFC_CSC_PARAMS &cscParams)
}
return cscParams.bCSCEnabled || IsInputChannelSwapNeeded(cscParams.inputFormat);
}

MOS_STATUS SfcRenderXe_Xpm_Base::SetMmcParams(PMOS_SURFACE renderTarget, bool isFormatMmcSupported, bool isMmcEnabled)
{
if (((renderTarget->Format == Format_A16R16G16B16) ||
(renderTarget->Format == Format_A16B16G16R16)) &&
renderTarget->CompressionMode == MOS_MMC_RC)
{
m_renderDataLegacy.sfcStateParams->bMMCEnable = true;
m_renderDataLegacy.sfcStateParams->MMCMode = MOS_MMC_RC;
VP_RENDER_NORMALMESSAGE("renderTarget->Format % d, m_renderData.sfcStateParams->MMCMode % d", renderTarget->Format, m_renderData.sfcStateParams->MMCMode);
return MOS_STATUS_SUCCESS;
}

if (!isFormatMmcSupported && renderTarget->bIsCompressed && renderTarget->CompressionMode == MOS_MMC_RC)
{
VP_RENDER_ASSERTMESSAGE("CCS not cleaned due to fix function not supported the Format when compression on.");
}

return SfcRenderM12::SetMmcParams(renderTarget, isFormatMmcSupported, isMmcEnabled);
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class SfcRenderXe_Xpm_Base : public SfcRenderM12

virtual bool IsOutputChannelSwapNeeded(MOS_FORMAT outputFormat) override;
virtual bool IsCscNeeded(SFC_CSC_PARAMS &cscParams) override;
virtual MOS_STATUS SetMmcParams(PMOS_SURFACE renderTarget, bool isFormatMmcSupported, bool isMmcEnabled) override;

VP_SURFACE *m_tempFieldSurface = nullptr;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,15 +813,15 @@ MOS_STATUS SfcRenderBaseLegacy::SetRotMirParams(PSFC_ROT_MIR_PARAMS rotMirParams
return MOS_STATUS_SUCCESS;
}

MOS_STATUS SfcRenderBaseLegacy::SetMmcParams(PMOS_SURFACE renderTarget, bool isFormalMmcSupported, bool isMmcEnabled)
MOS_STATUS SfcRenderBaseLegacy::SetMmcParams(PMOS_SURFACE renderTarget, bool isFormatMmcSupported, bool isMmcEnabled)
{
VP_FUNC_CALL();

VP_PUBLIC_CHK_NULL_RETURN(renderTarget);
VP_PUBLIC_CHK_NULL_RETURN(m_renderDataLegacy.sfcStateParams);

if (renderTarget->CompressionMode &&
isFormalMmcSupported &&
isFormatMmcSupported &&
renderTarget->TileType == MOS_TILE_Y &&
isMmcEnabled)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class SfcRenderBaseLegacy : public SfcRenderBase
//! \details Set mmc parameters
//! \param [in] renderTarget
//! render target surface
//! \param [in] isFormalMmcSupported
//! \param [in] isFormatMmcSupported
//! Is format supported by mmc
//! \param [in] isMmcEnabled
//! Is mmc enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,3 +685,23 @@ MOS_STATUS SfcRenderXe_Lpm_Plus_Base::AddSfcState(
return MOS_STATUS_SUCCESS;
}

MOS_STATUS SfcRenderXe_Lpm_Plus_Base::SetMmcParams(PMOS_SURFACE renderTarget, bool isFormatMmcSupported, bool isMmcEnabled)
{
if (((renderTarget->Format == Format_A16R16G16B16) ||
(renderTarget->Format == Format_A16B16G16R16)) &&
renderTarget->CompressionMode == MOS_MMC_RC)
{
m_renderData.sfcStateParams->bMMCEnable = true;
m_renderData.sfcStateParams->MMCMode = MOS_MMC_RC;
VP_RENDER_NORMALMESSAGE("renderTarget->Format % d, m_renderData.sfcStateParams->MMCMode % d", renderTarget->Format, m_renderData.sfcStateParams->MMCMode);
return MOS_STATUS_SUCCESS;
}

if (!isFormatMmcSupported && renderTarget->bIsCompressed && renderTarget->CompressionMode == MOS_MMC_RC)
{
VP_RENDER_ASSERTMESSAGE("CCS not cleaned due to fix function not supported the Format when compression on.");
}

return SfcRenderBase::SetMmcParams(renderTarget, isFormatMmcSupported, isMmcEnabled);
}

Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class SfcRenderXe_Lpm_Plus_Base : public SfcRenderBase
PMOS_COMMAND_BUFFER pCmdBuffer,
mhw::sfc::SFC_STATE_PAR *pSfcState,
PMHW_SFC_OUT_SURFACE_PARAMS pOutSurface);
virtual MOS_STATUS SetMmcParams(PMOS_SURFACE renderTarget, bool isFormatMmcSupported, bool isMmcEnabled) override;

VP_SURFACE *m_tempFieldSurface = nullptr;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,15 +928,15 @@ MOS_STATUS SfcRenderBase::SetRotMirParams(PSFC_ROT_MIR_PARAMS rotMirParams)
return MOS_STATUS_SUCCESS;
}

MOS_STATUS SfcRenderBase::SetMmcParams(PMOS_SURFACE renderTarget, bool isFormalMmcSupported, bool isMmcEnabled)
MOS_STATUS SfcRenderBase::SetMmcParams(PMOS_SURFACE renderTarget, bool isFormatMmcSupported, bool isMmcEnabled)
{
VP_FUNC_CALL();

VP_PUBLIC_CHK_NULL_RETURN(renderTarget);
VP_PUBLIC_CHK_NULL_RETURN(m_renderData.sfcStateParams);

if (renderTarget->CompressionMode &&
isFormalMmcSupported &&
isFormatMmcSupported &&
renderTarget->TileType == MOS_TILE_Y &&
isMmcEnabled)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class SfcRenderBase
//! \details Set mmc parameters
//! \param [in] renderTarget
//! render target surface
//! \param [in] isFormalMmcSupported
//! \param [in] isFormatMmcSupported
//! Is format supported by mmc
//! \param [in] isMmcEnabled
//! Is mmc enabled
Expand Down

0 comments on commit ab7072f

Please sign in to comment.