Skip to content

Commit

Permalink
[VP] add WA ID for linear output issue
Browse files Browse the repository at this point in the history
add WA ID for linear output issue.
  • Loading branch information
Alex1Zhang authored and intel-mediadev committed Sep 9, 2024
1 parent e7e989d commit 57d4101
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,9 @@ MOS_STATUS Policy::GetScalingExecutionCaps(SwFilter *feature, bool isHdrEnabled,
scalingParams->output.dwPitch != 128 &&
scalingParams->output.dwPitch != 256 &&
(scalingParams->output.dwPitch % 1024) !=0 &&
!(scalingParams->formatOutput == Format_RGBP ||
scalingParams->formatOutput == Format_BGRP ||
scalingParams->formatOutput == Format_R8G8B8) &&
scalingParams->output.tileMode == MOS_TILE_LINEAR_GMM)
{
scalingEngine->enableSFCLinearOutputByTileConvert = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2136,9 +2136,33 @@ MOS_STATUS VpVeboxCmdPacket::RenderVeboxCmd(

return eStatus;
}
// Meida copy has the same logic, when Format_R10G10B10A2/Format_B10G10R10A2, the output is AYUV, and in this WA there is corruption for these two format.
MOS_FORMAT VpVeboxCmdPacket::AdjustFormatForTileConvert(MOS_FORMAT format)
{
if (format == Format_R10G10B10A2 ||
format == Format_B10G10R10A2 ||
format == Format_Y410 ||
format == Format_Y210)
{
// RGB10 not supported without IECP. Re-map RGB10/RGB10 as AYUV
// Y410/Y210 has HW issue. Remap to AYUV.
return Format_AYUV;
}
else if (format == Format_A8)
{
return Format_P8;
}
else
{
return format;
}
}

MOS_STATUS VpVeboxCmdPacket::AddTileConvertStates(MOS_COMMAND_BUFFER *CmdBuffer, MHW_VEBOX_SURFACE_STATE_CMD_PARAMS &MhwVeboxSurfaceStateCmdParams)
{
auto &flushDwParams = m_miItf->MHW_GETPAR_F(MI_FLUSH_DW)();
flushDwParams = {};
VP_RENDER_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_FLUSH_DW)(CmdBuffer));
// Prepare Vebox_Surface_State, surface input/and output are the same but the compressed status.
VP_RENDER_CHK_STATUS_RETURN(InitVeboxSurfaceStateCmdParamsForTileConvert(&MhwVeboxSurfaceStateCmdParams, m_renderTarget->osSurface, m_originalOutput->osSurface));

Expand All @@ -2155,9 +2179,7 @@ MOS_STATUS VpVeboxCmdPacket::AddTileConvertStates(MOS_COMMAND_BUFFER *CmdBuffer,
// Send CMD: Vebox_Tiling_Convert
//---------------------------------
VP_RENDER_CHK_STATUS_RETURN(m_veboxItf->AddVeboxTilingConvert(CmdBuffer, &MhwVeboxSurfaceStateCmdParams.SurfInput, &MhwVeboxSurfaceStateCmdParams.SurfOutput));

auto &flushDwParams = m_miItf->MHW_GETPAR_F(MI_FLUSH_DW)();
flushDwParams = {};
flushDwParams = {};
VP_RENDER_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_FLUSH_DW)(CmdBuffer));
return MOS_STATUS_SUCCESS;
}
Expand Down Expand Up @@ -2186,7 +2208,7 @@ MOS_STATUS VpVeboxCmdPacket::InitVeboxSurfaceStateCmdParamsForTileConvert(
MOS_MIN(inputSurface->dwHeight, ((outputSurface != nullptr) ? outputSurface->dwHeight : inputSurface->dwHeight));
mhwVeboxSurfaceStateCmdParams->SurfInput.dwWidth = mhwVeboxSurfaceStateCmdParams->SurfOutput.dwWidth =
MOS_MIN(inputSurface->dwWidth, ((outputSurface != nullptr) ? outputSurface->dwWidth : inputSurface->dwWidth));
mhwVeboxSurfaceStateCmdParams->SurfInput.Format = mhwVeboxSurfaceStateCmdParams->SurfOutput.Format = inputSurface->Format;
mhwVeboxSurfaceStateCmdParams->SurfInput.Format = mhwVeboxSurfaceStateCmdParams->SurfOutput.Format = AdjustFormatForTileConvert(inputSurface->Format);

MOS_SURFACE inputDetails, outputDetails;
MOS_ZeroMemory(&inputDetails, sizeof(inputDetails));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ class VpVeboxCmdPacket : virtual public VpVeboxCmdPacketBase
MOS_COMMAND_BUFFER *CmdBuffer,
MHW_VEBOX_SURFACE_STATE_CMD_PARAMS &MhwVeboxSurfaceStateCmdParams);

MOS_FORMAT AdjustFormatForTileConvert(MOS_FORMAT format);
// TGNE
uint32_t dwGlobalNoiseLevel_Temporal = 0; //!< Global Temporal Noise Level for Y
uint32_t dwGlobalNoiseLevelU_Temporal = 0; //!< Global Temporal Noise Level for U
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void VpFeatureReport::SetConfigValues(
PrimaryCompressible %d, \
PrimaryCompressMode %d, \
CompositionMode %d, \
sfcLinearOutputByTileConvert",
sfcLinearOutputByTileConvert %d",
m_features.outputPipeMode,
m_features.hdrMode,
m_features.veFeatureInUse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,9 @@ MOS_STATUS VpUserFeatureControl::CreateUserSettingForDebug()
else
#endif
{
auto *waTable = m_osInterface->pfnGetWaTable(m_osInterface);
// Default value
m_ctrlValDefault.enableSFCLinearOutputByTileConvert = false;
m_ctrlValDefault.enableSFCLinearOutputByTileConvert = MEDIA_IS_WA(waTable, Wa_15016458807);
}
VP_PUBLIC_NORMALMESSAGE("enableSFCLinearOutputByTileConvert value is set as %d.", m_ctrlValDefault.enableSFCLinearOutputByTileConvert);

Expand Down
2 changes: 2 additions & 0 deletions media_softlet/linux/common/os/mos_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3820,6 +3820,7 @@ MOS_FORMAT MosInterface::GmmFmtToMosFmt(
{GMM_FORMAT_R16G16B16A16_UNORM_TYPE, Format_A16B16G16R16},
{GMM_FORMAT_R16G16B16A16_FLOAT_TYPE, Format_A16B16G16R16F},
{GMM_FORMAT_R10G10B10A2_UNORM_TYPE, Format_R10G10B10A2},
{GMM_FORMAT_B10G10R10A2_UNORM_TYPE, Format_B10G10R10A2},
{GMM_FORMAT_MFX_JPEG_YUV422H_TYPE, Format_422H},
{GMM_FORMAT_MFX_JPEG_YUV411_TYPE, Format_411P},
{GMM_FORMAT_MFX_JPEG_YUV422V_TYPE, Format_422V},
Expand Down Expand Up @@ -3902,6 +3903,7 @@ GMM_RESOURCE_FORMAT MosInterface::MosFmtToGmmFmt(MOS_FORMAT format)
{Format_Y210, GMM_FORMAT_Y210_TYPE},
{Format_Y410, GMM_FORMAT_Y410_TYPE},
{Format_R10G10B10A2, GMM_FORMAT_R10G10B10A2_UNORM_TYPE},
{Format_B10G10R10A2, GMM_FORMAT_B10G10R10A2_UNORM_TYPE},
{Format_A16B16G16R16F, GMM_FORMAT_R16G16B16A16_FLOAT},
{Format_R32G32B32A32F, GMM_FORMAT_R32G32B32A32_FLOAT}
};
Expand Down
2 changes: 2 additions & 0 deletions media_softlet/linux/xe2_hpm/ddi/media_sku_wa_bmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ static bool InitBmgMediaWaExt(struct GfxDeviceInfo *devInfo,

MEDIA_WR_WA(waTable, Wa_15013906446, 1);

MEDIA_WR_WA(waTable, Wa_15016458807, 1);

return true;
}

Expand Down

0 comments on commit 57d4101

Please sign in to comment.