////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2016-2019 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file camxifenode.cpp
/// @brief IFE Node class implementation
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "camxcslifedefs.h"
/// @todo (CAMX-1295) - Need to figure out the proper way to deal with TPG/SensorEmulation + RealDevice/Presil
#include "camxcsljumptable.h"
#include "camxcslresourcedefs.h"
#include "camxthreadmanager.h"
#include "camxhal3module.h"
#include "camxhwcontext.h"
#include "camxtrace.h"
#include "camxvendortags.h"
#include "camxnode.h"
#include "camxpipeline.h"
#include "camxpropertyblob.h"
#include "parametertuningtypes.h"
#include "camxifeabf34.h"
#include "camxifeawbbgstats14.h"
#include "camxifebfstats23.h"
#include "camxifebfstats24.h"
#include "camxifebhiststats14.h"
#include "camxifebls12.h"
#include "camxifebpcbcc50.h"
#include "camxifecamif.h"
#include "camxifecamiflite.h"
#include "camxifecc12.h"
#include "camxifecrop10.h"
#include "camxifecsstats14.h"
#include "camxifecst12.h"
#include "camxifedemosaic36.h"
#include "camxifedemosaic37.h"
#include "camxifedemux13.h"
#include "camxifeds410.h"
#include "camxifedualpd10.h"
#include "camxifegamma16.h"
#include "camxifegtm10.h"
#include "camxifehdr20.h"
#include "camxifehdr23.h"
#include "camxifehdrbestats15.h"
#include "camxifehdrbhiststats13.h"
#include "camxifehvx.h"
#include "camxifeihiststats12.h"
#include "camxifelinearization33.h"
#include "camxifelsc34.h"
#include "camxifemnds16.h"
#include "camxifepdpc11.h"
#include "camxifepedestal13.h"
#include "camxifeprecrop10.h"
#include "camxifer2pd10.h"
#include "camxiferoundclamp11.h"
#include "camxifersstats14.h"
#include "camxispstatsmodule.h"
#include "camxifetintlessbgstats15.h"
#include "camxifewb12.h"
#include "camximagesensormoduledata.h"
#include "camxiqinterface.h"
#include "camxispiqmodule.h"
#include "camxtitan17xcontext.h"
#include "camxtitan17xdefs.h"
#include "chipinforeaderdefs.h"
#include "stripeIFE.h"
#include "camxifenode.h"
#include "camxswtmc11.h"
#define STRIPE_FIELD_PRINT(field) \
CAMX_LOG_ERROR(CamxLogGroupISP, "dualIFE %s = %d", #field, (field))
#define STRIPE_FIELD_PRINT_LL(field) \
CAMX_LOG_ERROR(CamxLogGroupISP, "dualIFE %s = %lld", #field, (field))
#define PRINT_CROP_1D(_in) \
do \
{ \
STRIPE_FIELD_PRINT(_in.enable); \
STRIPE_FIELD_PRINT(_in.inDim); \
STRIPE_FIELD_PRINT(_in.firstOut); \
STRIPE_FIELD_PRINT(_in.lastOut); \
} while (0, 0)
#define PRINT_MNDS_V16(_in) \
do \
{ \
STRIPE_FIELD_PRINT(_in.en); \
STRIPE_FIELD_PRINT(_in.input_l); \
STRIPE_FIELD_PRINT(_in.output_l); \
STRIPE_FIELD_PRINT(_in.pixel_offset); \
STRIPE_FIELD_PRINT(_in.cnt_init); \
STRIPE_FIELD_PRINT(_in.interp_reso); \
STRIPE_FIELD_PRINT(_in.rounding_option_v); \
STRIPE_FIELD_PRINT(_in.rounding_option_h); \
STRIPE_FIELD_PRINT(_in.right_pad_en); \
STRIPE_FIELD_PRINT(_in.input_processed_length); \
STRIPE_FIELD_PRINT(_in.phase_init); \
STRIPE_FIELD_PRINT(_in.phase_step); \
} while (0, 0)
#define PRINT_WE_STRIPE(_in) \
do \
{ \
STRIPE_FIELD_PRINT(_in.enable1); \
STRIPE_FIELD_PRINT(_in.hInit1); \
STRIPE_FIELD_PRINT(_in.stripeWidth1); \
STRIPE_FIELD_PRINT(_in.enable2); \
STRIPE_FIELD_PRINT(_in.hInit2); \
STRIPE_FIELD_PRINT(_in.stripeWidth2); \
} while (0, 0)
CAMX_NAMESPACE_BEGIN
// TPG defaults, need to derive the value based on the dimension and FPS
static const UINT TPGPIXELCLOCK = 400000000;
static const FLOAT TPGFPS = 30.0f;
// The third column (installed) indicates if the module is available/enabled on a particular chipset e.g. bit 0 corresponds to
// SDM845/SDM710 etc. while bit 1 corresponds to SDM855. Setting the value of 0x0 disables the module.
//
// For example:
//
// ISPHwTitanInvalid (0b00) : No installation
// ISPHwTitan170 (0b01) : Enable and applicable SDM845/SDM710 only
// ISPHwTitan175 (0b10) : Enable and applicable SDM855 (SM8150)/SM7150 only
// (ISPHwTitan170 | ISPHwTitan175) (0b11) : Enable and applicable both SDM845/SDM710 and SDM855 (SM8150)
// ISPHwTitan150 (0b100) : Enable and applicable SDM640(SM6150) only.
// (ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150) (0b111): Enable and applicable for SDM845/SDM710/SDM640/SDM855
IFEIQModuleInfo IFEIQModuleItems[] =
{
{ISPIQModuleType::SWTMC, IFEPipelinePath::CommonPath,
(ISPHwTitan175 | ISPHwTitan150), SWTMC11::CreateIFE},
{ISPIQModuleType::IFECAMIF, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFECAMIF::Create},
{ISPIQModuleType::IFECAMIFLite, IFEPipelinePath::CommonPath,
ISPHwTitan175, IFECAMIFLite::Create},
/// @todo (CAMX-1133) Will enable when it is verified on hardware
{ISPIQModuleType::IFEPedestalCorrection, IFEPipelinePath::CommonPath,
ISPHwTitanInvalid, IFEPedestal13::Create},
{ISPIQModuleType::IFELinearization, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFELinearization33::Create},
{ISPIQModuleType::IFEBLS, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFEBLS12::Create },
{ISPIQModuleType::IFEPDPC, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFEPDPC11::Create},
{ISPIQModuleType::IFEDUALPD, IFEPipelinePath::CommonPath,
ISPHwTitan175, IFEDUALPD10::Create},
{ISPIQModuleType::IFEDemux, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFEDemux13::Create},
/// @todo (CAMX-1133) Will enable when it is verified on hardware
{ISPIQModuleType::IFEHDR, IFEPipelinePath::CommonPath,
ISPHwTitan170, IFEHDR20::Create},
{ISPIQModuleType::IFEHDR, IFEPipelinePath::CommonPath,
ISPHwTitan175, IFEHDR22::Create},
{ISPIQModuleType::IFEHDR, IFEPipelinePath::CommonPath,
ISPHwTitan150, IFEHDR23::Create},
{ISPIQModuleType::IFEBPCBCC, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFEBPCBCC50::Create},
{ISPIQModuleType::IFEABF, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFEABF34::Create},
{ISPIQModuleType::IFELSC, IFEPipelinePath::CommonPath,
(ISPHwTitan170 | ISPHwTitan175 | ISPHwTitan150), IFELSC34