From 707eae7e422355af6e0a750f9bf8a374b81e27c5 Mon Sep 17 00:00:00 2001 From: Gu_Lihao Date: Mon, 13 Nov 2023 13:47:08 +0800 Subject: [PATCH] [VP] Re-enable 3DLut interpolation mode for VE * [VP] Re-enable 3DLut interpolation mode for VE Enable 3DLut interpolation mode for new plaform --- media_common/agnostic/common/hw/mhw_vebox.h | 22 ++++++++++++++----- .../agnostic/common/vp/hal/vp_common_defs.h | 12 ++++++++++ .../utils/hal_ddi_share/vp_user_setting.cpp | 7 ++++++ .../vp/hal/utils/vp_user_feature_control.cpp | 16 ++++++++++++++ .../vp/hal/utils/vp_user_feature_control.h | 6 +++++ .../agnostic/common/vp/hal/utils/vp_utils.h | 1 + 6 files changed, 59 insertions(+), 5 deletions(-) diff --git a/media_common/agnostic/common/hw/mhw_vebox.h b/media_common/agnostic/common/hw/mhw_vebox.h index 67941fd162d..d7efd5f1c79 100644 --- a/media_common/agnostic/common/hw/mhw_vebox.h +++ b/media_common/agnostic/common/hw/mhw_vebox.h @@ -204,7 +204,8 @@ typedef struct _MHW_VEBOX_3D_LUT uint32_t Lut3dEnable : 1; uint32_t Lut3dSize : 2; uint32_t ChannelMappingSwapForLut3D : 1; - uint32_t : 26; // Reserved + uint32_t InterpolationMethod : 1; + uint32_t : 25; // Reserved } MHW_VEBOX_3D_LUT, *PMHW_VEBOX_3D_LUT; //! @@ -468,6 +469,16 @@ typedef enum _MHW_WB_MODE MHW_WB_COUNT } MHW_WB_MODE; +//! +//! Structure MHW_3DLUT_INTERPOLATION +//! \brief 3DLut interpolation method +//! +typedef enum _MHW_3DLUT_INTERPOLATION +{ + MHW_3DLUT_INTERPOLATION_TRILINEAR = 0, //!< 3DLUT Trilinear interpolation method. + MHW_3DLUT_INTERPOLATION_TETRAHEDRAL = 1 //!< 3DLUT Tetrahedral interpolation method. +} MHW_3DLUT_INTERPOLATION; + //! //! Structure MHW_WHITE_BALANCE_PARAMS //! \brief White Balance Parameters @@ -595,10 +606,11 @@ typedef struct _MHW_CAPPIPE_PARAMS //! typedef struct _MHW_3DLUT_PARAMS { - uint32_t bActive; //!< Active or not - uint32_t LUTSize; //!< Size (one dimensions) of the LUT - uint32_t LUTLength; //!< Length of the LUT, in unit of bit - uint8_t *pLUT; //!< Pointer to the LUT value + uint32_t bActive; //!< Active or not + uint32_t LUTSize; //!< Size (one dimensions) of the LUT + uint32_t LUTLength; //!< Length of the LUT, in unit of bit + uint8_t *pLUT; //!< Pointer to the LUT value + MHW_3DLUT_INTERPOLATION InterpolationMethod; //!< Vebox 3DLut interpolation method } MHW_3DLUT_PARAMS, *PMHW_3DLUT_PARAMS; //! diff --git a/media_common/agnostic/common/vp/hal/vp_common_defs.h b/media_common/agnostic/common/vp/hal/vp_common_defs.h index 1699c6aadb2..55e772d177d 100644 --- a/media_common/agnostic/common/vp/hal/vp_common_defs.h +++ b/media_common/agnostic/common/vp/hal/vp_common_defs.h @@ -515,6 +515,16 @@ typedef enum _VPHAL_COLORPACK } VPHAL_COLORPACK, *PVPHAL_COLORPACK; +//! +//! \brief VEBOX 3DLut interpolation mode +//! +typedef enum _VPHAL_3DLUT_INTERPOLATION +{ + VPHAL_3DLUT_INTERPOLATION_DEFAULT = 0, //!< Default 3DLUT interpolation method. + VPHAL_3DLUT_INTERPOLATION_TRILINEAR = 1, //!< 3DLUT trilinear interpolation method. + VPHAL_3DLUT_INTERPOLATION_TETRAHEDRAL = 2 //!< 3DLUT tetrahedral interpolation method. +} VPHAL_3DLUT_INTERPOLATION; + //! //! \brief Output Pipe Mode enum //! \details The output pipe that writes the RenderTarget surface @@ -890,6 +900,8 @@ typedef struct _VPHAL_3DLUT_PARAMS uint32_t ChannelMapping = 0; // Channel Mapping for the 3DLUT input to 3DLUT output. uint16_t BitDepthPerChannel = 0; // Bit Depth Per Channel(4 channels for 3DLUT). uint16_t ByteCountPerEntry = 0; // Byte Count Per Entry including reserved bytes. + + VPHAL_3DLUT_INTERPOLATION InterpolationMethod = VPHAL_3DLUT_INTERPOLATION_DEFAULT; // VEBox 3DLut interpolation mode } VPHAL_3DLUT_PARAMS, *PVPHAL_3DLUT_PARAMS; //! diff --git a/media_softlet/agnostic/common/vp/hal/utils/hal_ddi_share/vp_user_setting.cpp b/media_softlet/agnostic/common/vp/hal/utils/hal_ddi_share/vp_user_setting.cpp index 5149bd31aab..d561771ac74 100644 --- a/media_softlet/agnostic/common/vp/hal/utils/hal_ddi_share/vp_user_setting.cpp +++ b/media_softlet/agnostic/common/vp/hal/utils/hal_ddi_share/vp_user_setting.cpp @@ -205,6 +205,13 @@ MOS_STATUS VpUserSetting::InitVpUserSetting(MediaUserSettingSharedPtr userSettin 0, true); + DeclareUserSettingKeyForDebug( + userSettingPtr, + __VPHAL_FORCE_3DLUT_INTERPOLATION, + MediaUserSetting::Group::Sequence, + 0, + true); + DeclareUserSettingKeyForDebug( //Enable 1K 1DLUT userSettingPtr, __VPHAL_ENABLE_1K_1DLUT, diff --git a/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.cpp b/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.cpp index 1818611cb7f..ee87ed6b357 100644 --- a/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.cpp +++ b/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.cpp @@ -324,6 +324,22 @@ MOS_STATUS VpUserFeatureControl::CreateUserSettingForDebug() #endif #if (_DEBUG || _RELEASE_INTERNAL) + uint32_t force3DLutInterpolation = 0; + eRegKeyReadStatus = ReadUserSettingForDebug( + m_userSettingPtr, + force3DLutInterpolation, + __VPHAL_FORCE_3DLUT_INTERPOLATION, + MediaUserSetting::Group::Sequence); + if (MOS_SUCCEEDED(eRegKeyReadStatus)) + { + m_ctrlValDefault.force3DLutInterpolation = force3DLutInterpolation; + } + else + { + // Default value + m_ctrlValDefault.force3DLutInterpolation = 0; + } + //SFC NV12/P010 Linear Output. uint32_t enabledSFCNv12P010LinearOutput = 0; eRegKeyReadStatus = ReadUserSettingForDebug( diff --git a/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.h b/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.h index bedc11cba72..b1328047bac 100644 --- a/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.h +++ b/media_softlet/agnostic/common/vp/hal/utils/vp_user_feature_control.h @@ -55,6 +55,7 @@ class VpUserFeatureControl #if (_DEBUG || _RELEASE_INTERNAL) bool forceDecompressedOutput = false; + uint32_t force3DLutInterpolation = 0; uint32_t enabledSFCNv12P010LinearOutput = 0; uint32_t enabledSFCRGBPRGB24Output = 0; bool enableIFNCC = false; @@ -76,6 +77,11 @@ class VpUserFeatureControl return m_ctrlVal.forceDecompressedOutput; } + uint32_t Force3DLutInterpolation() + { + return m_ctrlVal.force3DLutInterpolation; + } + uint32_t EnabledSFCNv12P010LinearOutput() { return m_ctrlVal.enabledSFCNv12P010LinearOutput; diff --git a/media_softlet/agnostic/common/vp/hal/utils/vp_utils.h b/media_softlet/agnostic/common/vp/hal/utils/vp_utils.h index 20c66fecbbd..893e48a8539 100644 --- a/media_softlet/agnostic/common/vp/hal/utils/vp_utils.h +++ b/media_softlet/agnostic/common/vp/hal/utils/vp_utils.h @@ -300,6 +300,7 @@ class Trace #define __VPHAL_RNDR_SCOREBOARD_CONTROL "SCOREBOARD Control" #define __VPHAL_RNDR_CMFC_CONTROL "CMFC Control" #define __VPHAL_ENABLE_1K_1DLUT "Enable 1K 1DLUT" +#define __VPHAL_FORCE_3DLUT_INTERPOLATION "VPHAL Force 3DLUT Interpolation" #define __VPHAL_VEBOX_HDR_MODE "VeboxHDRMode" #define __VPHAL_HDR_ENABLE_QUALITY_TUNING "VPHAL HDR Enable Quality Tuning" #define __VPHAL_HDR_ENABLE_KERNEL_DUMP "VPHAL HDR Enable Kernel Dump"