Пример #1
0
MBOOL
ISP_MGR_G2C_T::
apply(EIspProfile_T eIspProfile)
{
    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);

    dumpRegInfo("G2C");

    return MTRUE;
}
Пример #2
0
MBOOL
ISP_MGR_G2C_T::
apply(EIspProfile_T eIspProfile, isp_reg_t* pReg)
{
    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());

    // TOP 
    ISP_WRITE_ENABLE_BITS(pReg, CAM_CTL_EN_P2, G2C_EN, isEnable());
    
    writeRegs(static_cast<RegInfo_T*>(m_pRegInfo), m_u4RegInfoNum, pReg);

    dumpRegInfo("G2C");

    return MTRUE;
}
Пример #3
0
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;
}