MBOOL ISP_MGR_CFA_T:: apply(EIspProfile_T eIspProfile) { addressErrorCheck("Before ISP_MGR_CFA_T::apply()"); TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), eTuningMgrFunc_Cfa); // TOP ==> don't care TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P2, CFA_EN, 1); ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_CFA(MTRUE); // Register setting TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); addressErrorCheck("After ISP_MGR_CFA_T::apply()"); dumpRegInfo("CFA"); return MTRUE; }
MBOOL ISP_MGR_G2C_SHADE_T:: apply(EIspProfile_T eIspProfile) { addressErrorCheck("Before ISP_MGR_G2C_SHADE_T::apply()"); TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), eTuningMgrFunc_G2c_Shade); TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); addressErrorCheck("After ISP_MGR_G2C_SHADE_T::apply()"); dumpRegInfo("G2C_SHADE"); return MTRUE; }
MBOOL ISP_MGR_RPG_T:: apply(EIspProfile_T eIspProfile) { addressErrorCheck("Before ISP_MGR_RPG_T::apply()"); MY_LOG_IF(IsDebugEnabled(), "%s(): isEnable() = %d\n", __FUNCTION__, isEnable()); if (m_eSensorTG == ESensorTG_1) { TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), eTuningMgrFunc_Rpg); // TOP TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P1, RPG_EN, isEnable()); ISP_MGR_CTL_EN_P1_T::getInstance(m_eSensorDev).setEnable_RPG(isEnable()); // Register setting TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); } else { TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), eTuningMgrFunc_Rpg_d); // TOP TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P1_D, RPG_D_EN, isEnable()); ISP_MGR_CTL_EN_P1_D_T::getInstance(m_eSensorDev).setEnable_RPG(isEnable()); // Register setting TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); } addressErrorCheck("After ISP_MGR_RPG_T::apply()"); dumpRegInfo("RPG"); return MTRUE; }
MBOOL ISP_MGR_MFB_T:: apply(EIspProfile_T eIspProfile) { addressErrorCheck("Before ISP_MGR_MFB_T::apply()"); TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), eTuningMgrFunc_Mfb_TuneCon); // TOP //TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P2, MFB_EN, isEnable()); TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); addressErrorCheck("After ISP_MGR_MFB_T::apply()"); dumpRegInfo("MFB"); return MTRUE; }
MBOOL ISP_MGR_G2C_T:: apply(EIspProfile_T eIspProfile) { addressErrorCheck("Before ISP_MGR_G2C_T::apply()"); if (!isEnable()) { // Reset to unit matrix reinterpret_cast<ISP_CAM_G2C_CONV_0A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0A))->G2C_CNV_00 = 512; reinterpret_cast<ISP_CAM_G2C_CONV_0A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0A))->G2C_CNV_01 = 0; reinterpret_cast<ISP_CAM_G2C_CONV_0B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0B))->G2C_CNV_02 = 0; reinterpret_cast<ISP_CAM_G2C_CONV_0B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0B))->G2C_Y_OFST = 0; reinterpret_cast<ISP_CAM_G2C_CONV_1A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1A))->G2C_CNV_10 = 0; reinterpret_cast<ISP_CAM_G2C_CONV_1A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1A))->G2C_CNV_11 = 512; reinterpret_cast<ISP_CAM_G2C_CONV_1B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1B))->G2C_CNV_12 = 0; reinterpret_cast<ISP_CAM_G2C_CONV_1B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1B))->G2C_U_OFST = 0; reinterpret_cast<ISP_CAM_G2C_CONV_2A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2A))->G2C_CNV_20 = 0; reinterpret_cast<ISP_CAM_G2C_CONV_2A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2A))->G2C_CNV_21 = 0; reinterpret_cast<ISP_CAM_G2C_CONV_2B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2B))->G2C_CNV_22 = 512; reinterpret_cast<ISP_CAM_G2C_CONV_2B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2B))->G2C_V_OFST = 0; } ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_G2C(isEnable()); TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), eTuningMgrFunc_G2c_Conv); // TOP TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P2, G2C_EN, isEnable()); TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); addressErrorCheck("After ISP_MGR_G2C_T::apply()"); dumpRegInfo("G2C"); return MTRUE; }
MBOOL ISP_MGR_LCE_T::apply(EIspProfile_T eIspProfile) { addressErrorCheck("Before ISP_MGR_LCE_T::apply()"); char value[PROPERTY_VALUE_MAX] = {'\0'}; property_get("debug.vhdr.dump", value, "0"); g_lceDebug = atoi(value); ESoftwareScenario eSwScn = static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]); #if (LCE_DEBUG) MY_LOG("dev(%d),TG(%d),ispProf(%d),eSwScn(%u),m_bEnable(%u)",m_eSensorDev,m_eSensorTG,eIspProfile,eSwScn,m_bEnable); #else MY_LOG_IF(g_lceDebug, "dev(%d),TG(%d),ispProf(%d),eSwScn(%u),m_bEnable(%u)",m_eSensorDev,m_eSensorTG,eIspProfile,eSwScn,m_bEnable); #endif //====== Update LCE Tuning Engien ====== TuningMgr::getInstance().updateEngine(eSwScn, eTuningMgrFunc_Lce); //====== Register Setting ====== //> TOP TUNING_MGR_WRITE_ENABLE_BITS(eSwScn, CAM_CTL_EN_P2, LCE_EN, m_bEnable); //> prepar register value //CAM_LCE_SLM_SIZE MUINT32 lcmSlmSize = 0; lcmSlmSize = lcmSlmSize | (mLcsOutHeight << 8) | mLcsOutWidth; m_rIspRegInfo[ERegInfo_CAM_LCE_SLM_SIZE].val = lcmSlmSize; //> LCE tuning #if 0 m_rIspRegInfo[ERegInfo_CAM_LCE_QUA].val = mLceQuaReg[8]; m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_1].val = mLceDgc1Reg[8]; m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_2].val = mLceDgc2Reg[8]; #else #if LCE_ADJUST_METHOD updateLceIdx(); m_rIspRegInfo[ERegInfo_CAM_LCE_QUA].val = mLceQuaReg[mLcsIdx]; m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_1].val = mLceDgc1Reg[mLcsIdx]; m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_2].val = mLceDgc2Reg[mLcsIdx]; #else m_rIspRegInfo[ERegInfo_CAM_LCE_QUA].val = mLceQuaReg[mLcsFinalIdx]; m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_1].val = mLceDgc1Reg[mLcsFinalIdx]; m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_2].val = mLceDgc2Reg[mLcsFinalIdx]; #endif #endif #if (LCE_DEBUG) MY_LOG("(mLcsOutWidth/mLcsOutHeight)=(%u,%u),CAM_LCE_SLM_SIZE(0x%08x)",mLcsOutWidth,mLcsOutHeight,m_rIspRegInfo[ERegInfo_CAM_LCE_SLM_SIZE].val); MY_LOG("CAM_LCE_QUA(0x%08x)",m_rIspRegInfo[ERegInfo_CAM_LCE_QUA].val); MY_LOG("CAM_LCE_DGC_1(0x%08x)",m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_1].val); MY_LOG("CAM_LCE_DGC_2(0x%08x)",m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_2].val); MY_LOG("mLcsFinalIdx(%u),mLcsIdx(%u)",mLcsFinalIdx,mLcsIdx); #else MY_LOG_IF(g_lceDebug, "(LcsOutW/LcsOutH)=(%u,%u),CAM_LCE_SLM_SIZE(0x%08x)",mLcsOutWidth,mLcsOutHeight,m_rIspRegInfo[ERegInfo_CAM_LCE_SLM_SIZE].val); MY_LOG_IF(g_lceDebug, "CAM_LCE_QUA(0x%08x)",m_rIspRegInfo[ERegInfo_CAM_LCE_QUA].val); MY_LOG_IF(g_lceDebug, "CAM_LCE_DGC_1(0x%08x)",m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_1].val); MY_LOG_IF(g_lceDebug, "CAM_LCE_DGC_2(0x%08x)",m_rIspRegInfo[ERegInfo_CAM_LCE_DGC_2].val); MY_LOG_IF(g_lceDebug, "mLcsFinalIdx(%u),mLcsIdx(%u)",mLcsFinalIdx,mLcsIdx); #endif //> Write to TuningMgr TuningMgr::getInstance().tuningMgrWriteRegs(eSwScn, static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); addressErrorCheck("After ISP_MGR_LCE_T::apply()"); dumpRegInfo("LCE"); return MTRUE; }
MBOOL ISP_MGR_LSC_T:: apply(EIspProfile_T eIspProfile) { addressErrorCheck("Before ISP_MGR_LSC_T::apply()"); MBOOL fgOnOff = m_fgOnOff; MUINT32 u4XNum, u4YNum, u4Wd, u4Ht; MUINT32 LSCI_XSIZE, LSCI_YSIZE, LSCI_STRIDE; u4XNum = reinterpret_cast<ISP_CAM_LSC_CTL2_T*>(REG_INFO_VALUE_PTR(CAM_LSC_CTL2))->LSC_SDBLK_XNUM; u4YNum = reinterpret_cast<ISP_CAM_LSC_CTL3_T*>(REG_INFO_VALUE_PTR(CAM_LSC_CTL3))->LSC_SDBLK_YNUM; u4Wd = reinterpret_cast<ISP_CAM_LSC_CTL2_T*>(REG_INFO_VALUE_PTR(CAM_LSC_CTL2))->LSC_SDBLK_WIDTH; u4Ht = reinterpret_cast<ISP_CAM_LSC_CTL3_T*>(REG_INFO_VALUE_PTR(CAM_LSC_CTL3))->LSC_SDBLK_HEIGHT; LSCI_XSIZE = (u4XNum+1)*4*128/8 - 1; LSCI_YSIZE = u4YNum; LSCI_STRIDE = (LSCI_XSIZE+1); REG_INFO_VALUE(CAM_LSCI_OFST_ADDR) = 0; REG_INFO_VALUE(CAM_LSCI_XSIZE) = LSCI_XSIZE; REG_INFO_VALUE(CAM_LSCI_YSIZE) = LSCI_YSIZE; REG_INFO_VALUE(CAM_LSCI_STRIDE) = LSCI_STRIDE; REG_INFO_VALUE(CAM_LSC_CTL1) = 0x30000000; // REG_INFO_VALUE(CAM_LSC_GAIN_TH) = 0x03F00000; ESoftwareScenario eSwScn = static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]); // TOP if (m_eSensorTG == ESensorTG_1) { TuningMgr::getInstance().updateEngine(eSwScn, eTuningMgrFunc_Lsc); //TUNING_MGR_WRITE_REG(eSwScn, CAM_LSCI_OFST_ADDR, LSCI_OFFSET); //TUNING_MGR_WRITE_REG(eSwScn, CAM_LSCI_XSIZE, LSCI_XSIZE); //TUNING_MGR_WRITE_REG(eSwScn, CAM_LSCI_YSIZE, LSCI_YSIZE); //TUNING_MGR_WRITE_ENABLE_BITS(eSwScn, CAM_LSCI_STRIDE, STRIDE, LSCI_STRIDE); TUNING_MGR_WRITE_ENABLE_BITS(eSwScn, CAM_CTL_EN_P1, LSC_EN, fgOnOff); TUNING_MGR_WRITE_ENABLE_BITS(eSwScn, CAM_CTL_EN_P1_DMA, LSCI_EN, fgOnOff); ISP_MGR_CTL_EN_P1_T::getInstance(m_eSensorDev).setEnable_LSC(fgOnOff); } else { TuningMgr::getInstance().updateEngine(eSwScn, eTuningMgrFunc_Lsc_d); //TUNING_MGR_WRITE_REG(eSwScn, CAM_LSCI_D_OFST_ADDR, LSCI_OFFSET); //TUNING_MGR_WRITE_REG(eSwScn, CAM_LSCI_D_XSIZE, LSCI_XSIZE); //TUNING_MGR_WRITE_REG(eSwScn, CAM_LSCI_D_YSIZE, LSCI_YSIZE); //TUNING_MGR_WRITE_ENABLE_BITS(eSwScn, CAM_LSCI_D_STRIDE, STRIDE, LSCI_STRIDE); TUNING_MGR_WRITE_ENABLE_BITS(eSwScn, CAM_CTL_EN_P1_D, LSC_D_EN, fgOnOff); TUNING_MGR_WRITE_ENABLE_BITS(eSwScn, CAM_CTL_EN_P1_DMA_D, LSCI_D_EN, fgOnOff); ISP_MGR_CTL_EN_P1_D_T::getInstance(m_eSensorDev).setEnable_LSC(fgOnOff); } // Register setting TuningMgr::getInstance().tuningMgrWriteRegs( eSwScn, static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), m_u4RegInfoNum); dumpRegInfo("LSC"); addressErrorCheck("After ISP_MGR_LSC_T::apply()"); return MTRUE; }