diff --git a/media_common/agnostic/common/hw/mhw_vebox.h b/media_common/agnostic/common/hw/mhw_vebox.h index b481ec8392..9c29ca5613 100644 --- a/media_common/agnostic/common/hw/mhw_vebox.h +++ b/media_common/agnostic/common/hw/mhw_vebox.h @@ -176,7 +176,11 @@ typedef struct _MHW_VEBOX_MODE uint32_t Hdr1DLutEnable : 1; uint32_t Fp16ModeEnable : 1; uint32_t Hdr1K1DLut : 1; - uint32_t : 7; // Reserved + uint32_t GamutExpansionPosition : 1; + uint32_t EotfPrecision : 1; + uint32_t BypassCcm : 1; + uint32_t BypassOetf : 1; + uint32_t : 3; // Reserved } MHW_VEBOX_MODE, *PMHW_VEBOX_MODE; typedef enum _MHW_VEBOX_ADDRESS_SHIFT @@ -210,14 +214,10 @@ typedef struct _MHW_VEBOX_3D_LUT typedef struct _MHW_VEBOX_FP16_INPUT { - uint32_t GamutExpansionPosition : 1; - uint32_t EotfPrecision : 1; - uint32_t BypassCcm : 1; - uint32_t BypassOetf : 1; uint32_t VeboxFp16InputEnable : 1; uint32_t RgbSwapForFp16Input : 1; uint32_t HdrGainFactor : 8; - uint32_t : 18; // Reserved + uint32_t : 22; // Reserved } MHW_VEBOX_FP16_INPUT, *PMHW_VEBOX_FP16_INPUT; //! diff --git a/media_softlet/agnostic/common/hw/mhw_vebox_impl.h b/media_softlet/agnostic/common/hw/mhw_vebox_impl.h index f4c11278b5..531d927d08 100644 --- a/media_softlet/agnostic/common/hw/mhw_vebox_impl.h +++ b/media_softlet/agnostic/common/hw/mhw_vebox_impl.h @@ -468,6 +468,12 @@ class Impl : public Itf, public mhw::Impl return MOS_STATUS_SUCCESS; } + MOS_STATUS SetAlphaFromStateSelect( + PMHW_VEBOX_IECP_PARAMS pVeboxIecpParams) override + { + return MOS_STATUS_SUCCESS; + } + MOS_STATUS SetVeboxLaceColorParams( MHW_LACE_COLOR_CORRECTION *pLaceColorParams) override { @@ -940,11 +946,6 @@ class Impl : public Itf, public mhw::Impl return MOS_STATUS_SUCCESS; } - MOS_STATUS AddEOTFState(void *&surface, PMHW_1DLUT_PARAMS p1DLutParams) override - { - return MOS_STATUS_SUCCESS; - } - MOS_STATUS AddFP16State(PMHW_FP16_PARAMS pFP16Params) override { return MOS_STATUS_SUCCESS; diff --git a/media_softlet/agnostic/common/hw/mhw_vebox_itf.h b/media_softlet/agnostic/common/hw/mhw_vebox_itf.h index db55f71de8..87ecea568f 100644 --- a/media_softlet/agnostic/common/hw/mhw_vebox_itf.h +++ b/media_softlet/agnostic/common/hw/mhw_vebox_itf.h @@ -80,6 +80,8 @@ class Itf virtual MOS_STATUS SetDisableHistogram(PMHW_VEBOX_IECP_PARAMS pVeboxIecpParams) = 0; + virtual MOS_STATUS SetAlphaFromStateSelect(PMHW_VEBOX_IECP_PARAMS pVeboxIecpParams) = 0; + virtual MOS_STATUS SetVeboxLaceColorParams(MHW_LACE_COLOR_CORRECTION *pLaceColorParams) = 0; virtual MOS_STATUS SetVeboxIecpAceState(PMHW_VEBOX_IECP_PARAMS pVeboxIecpParams) = 0; @@ -110,8 +112,6 @@ class Itf virtual MOS_STATUS Add1DLutState(void *&surface, PMHW_1DLUT_PARAMS p1DLutParams) = 0; - virtual MOS_STATUS AddEOTFState(void *&surface, PMHW_1DLUT_PARAMS p1DLutParams) = 0; - virtual MOS_STATUS AddFP16State(PMHW_FP16_PARAMS pFP16Params) = 0; _VEBOX_CMD_DEF(_MHW_CMD_ALL_DEF_FOR_ITF); diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp index 1de09ffab3..af3346b20f 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp @@ -223,9 +223,13 @@ MOS_STATUS VpVeboxCmdPacket::SetupVebox3DLutForHDR(mhw::vebox::VEBOX_STATE_PAR & pVeboxMode = &veboxStateCmdParams.VeboxMode; pLUT3D = &veboxStateCmdParams.LUT3D; p1DLutParams = &(pRenderData->GetIECPParams().s1DLutParams); + + VP_RENDER_CHK_NULL_RETURN(pVeboxMode); + VP_RENDER_CHK_NULL_RETURN(p1DLutParams); + VP_RENDER_CHK_NULL_RETURN(pLUT3D); + pLUT3D->ArbitrationPriorityControl = 0; pLUT3D->Lut3dEnable = true; - // Config 3DLut size to 65 for HDR10 usage. pLUT3D->Lut3dSize = 2; if (pRenderData->HDR3DLUT.uiLutSize == 33) @@ -249,6 +253,18 @@ MOS_STATUS VpVeboxCmdPacket::SetupVebox3DLutForHDR(mhw::vebox::VEBOX_STATE_PAR & veboxStateCmdParams.pVebox3DLookUpTables = &surf3DLut->osSurface->OsResource; + VP_RENDER_CHK_STATUS_RETURN(SetupHDRUnifiedForHDR(veboxStateCmdParams)); + + return MOS_STATUS_SUCCESS; +} + +MOS_STATUS VpVeboxCmdPacket::SetupHDRUnifiedForHDR(mhw::vebox::VEBOX_STATE_PAR &veboxStateCmdParams) +{ + PMHW_VEBOX_MODE pVeboxMode = nullptr; + + pVeboxMode = &veboxStateCmdParams.VeboxMode; + + pVeboxMode->Hdr1K1DLut = true; return MOS_STATUS_SUCCESS; } @@ -283,6 +299,7 @@ MOS_STATUS VpVeboxCmdPacket::SetupVeboxState(mhw::vebox::VEBOX_STATE_PAR& veboxS VP_FUNC_CALL(); PMHW_VEBOX_MODE pVeboxMode = nullptr; + PMHW_FP16_PARAMS fp16Params = nullptr; pVeboxMode = &veboxStateCmdParams.VeboxMode; VP_RENDER_CHK_NULL_RETURN(pVeboxMode); @@ -290,6 +307,9 @@ MOS_STATUS VpVeboxCmdPacket::SetupVeboxState(mhw::vebox::VEBOX_STATE_PAR& veboxS VpVeboxRenderData* pRenderData = GetLastExecRenderData(); VP_RENDER_CHK_NULL_RETURN(pRenderData); + fp16Params = &(pRenderData->GetIECPParams().fp16Params); + VP_RENDER_CHK_NULL_RETURN(fp16Params); + MOS_ZeroMemory(&veboxStateCmdParams, sizeof(veboxStateCmdParams)); // Always enable the global iecp to align with the legacy path. @@ -338,6 +358,11 @@ MOS_STATUS VpVeboxCmdPacket::SetupVeboxState(mhw::vebox::VEBOX_STATE_PAR& veboxS VP_RENDER_CHK_STATUS_RETURN(SetupHDRLuts(veboxStateCmdParams)); VP_RENDER_CHK_STATUS_RETURN(SetupDNTableForHVS(veboxStateCmdParams)); + if (fp16Params->isActive == 1) + { + VP_RENDER_CHK_STATUS_RETURN(SetupVeboxFP16State(veboxStateCmdParams)); + } + veboxStateCmdParams.bCmBuffer = false; MHW_VEBOX_IECP_PARAMS& veboxIecpParams = pRenderData->GetIECPParams(); diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.h b/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.h index d34229a957..4ecdd38faf 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.h +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.h @@ -1126,6 +1126,14 @@ class VpVeboxCmdPacket : virtual public VpVeboxCmdPacketBase virtual MOS_STATUS Add1DLutState(PVP_SURFACE &surface, PMHW_1DLUT_PARAMS p1DLutParams); virtual MOS_STATUS SetupVebox3DLutForHDR( mhw::vebox::VEBOX_STATE_PAR &veboxStateCmdParams); + virtual MOS_STATUS SetupVeboxFP16State(mhw::vebox::VEBOX_STATE_PAR &veboxStateCmdParams) + { + return MOS_STATUS_SUCCESS; + } + + virtual MOS_STATUS SetupHDRUnifiedForHDR( + mhw::vebox::VEBOX_STATE_PAR &veboxStateCmdParams); + virtual MOS_STATUS SetupVeboxExternal3DLutforHDR( mhw::vebox::VEBOX_STATE_PAR &veboxStateCmdParams);