123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- /******************************************************************************
- Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd.
- ******************************************************************************
- File Name : mpi_pciv.h
- Version : Initial Draft
- Author : Hisilicon Hi3511 MPP Team
- Created : 2009/06/23
- Last Modified :
- Description : mpi functions declaration
- Function List :
- History :
- 1.Date : 2009/06/23
- Author : z44949
- Modification: Create
- ******************************************************************************/
- #ifndef __MPI_PCIV_H__
- #define __MPI_PCIV_H__
- #include "hi_common.h"
- #include "hi_comm_video.h"
- #include "hi_comm_pciv.h"
- #ifdef __cplusplus
- #if __cplusplus
- extern "C"{
- #endif
- #endif /* __cplusplus */
- /*****************************************************************************
- Description : Create and initialize the pciv channel.
- Input : pcivChn ** The pciv channel id between [0, PCIV_MAX_CHN_NUM)
- pPcivAttr ** The attribute of pciv channel
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_Destroy
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Create(PCIV_CHN pcivChn,const PCIV_ATTR_S *pPcivAttr);
- /*****************************************************************************
- Description : Destroy the pciv channel
- Input : pcivChn ** The pciv channel id
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_Create
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Destroy(PCIV_CHN pcivChn);
- /*****************************************************************************
- Description : Set the attribute of pciv channel
- Input : pcivChn ** The pciv channel id
- pPcivAttr ** The attribute of pciv channel
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_GetAttr
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_SetAttr(PCIV_CHN pcivChn,const PCIV_ATTR_S *pPcivAttr);
- /*****************************************************************************
- Description : Get the attribute of pciv channel
- Input : pcivChn ** The pciv channel id
- Output : pPcivAttr ** The attribute of pciv channel
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_SetAttr
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_GetAttr(PCIV_CHN pcivChn, PCIV_ATTR_S *pPcivAttr);
- /*****************************************************************************
- Description : Start to send or receive video frame
- Input : pcivChn ** The pciv channel id
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_Stop
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Start(PCIV_CHN pcivChn);
- /*****************************************************************************
- Description : Stop send or receive video frame
- Input : pcivChn ** The pciv channel id
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_Start
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Stop(PCIV_CHN pcivChn);
- /*****************************************************************************
- Description : Create a series of dma task
- Input : pTask ** The task list to create
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : None
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_DmaTask(PCIV_DMA_TASK_S *pTask);
- /*****************************************************************************
- Description : Alloc 'u32BlkSize' bytes memory and give the physical address
- The memory used by PCI must be located within the PCI window,
- So you should call this function to alloc it.
- Input : u32BlkSize ** The size of each memory block
- u32BlkCnt ** The count of memory block
- Output : u64PhyAddr ** The physical address of the memory
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : None
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Malloc(HI_U32 u32BlkSize, HI_U32 u32BlkCnt, HI_U64 au64PhyAddr[]);
- /*****************************************************************************
- Description : free memory with the physical address
- Input : u32BlkCnt ** The count of memory block
- u64PhyAddr ** The physical address of the memory
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : None
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Free(HI_U32 u32BlkCnt,const HI_U64 au64PhyAddr[]);
- /*****************************************************************************
- Description : Alloc 'u32BlkSize' bytes memory and give the physical address for one pciv channel
- The memory used by PCI host, pciv slave cann't use this interface.
- Input : pcivChn **pciv channel
- u32BlkSize ** The size of each memory block
- u32BlkCnt ** The count of memory block
- Output : u64PhyAddr ** The physical address of the memory
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : None
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_MallocChnBuffer(PCIV_CHN pcivChn, HI_U32 u32BlkSize, HI_U32 u32BlkCnt, HI_U64 au64PhyAddr[]);
- /*****************************************************************************
- Description : free pciv channel memory with the physical address
- The memory used by PCI host, pciv slave cann't use this interface.
- Input : pcivChn ** pciv channel
- u32BlkCnt ** The count of memory block
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : None
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_FreeChnBuffer(PCIV_CHN pcivChn, HI_U32 u32BlkCnt);
- /*****************************************************************************
- Description : Get the board ID of this board
- Input : None
- Output : None
- Return Value : The board ID if success
- HI_FAILURE or HI_ERR_PCIV_SYS_NOTREADY if failure
- See Also : HI_MPI_PCIV_GetBaseWindow
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_GetLocalId(HI_VOID);
- /*****************************************************************************
- Description : Enum all the connected chip.Call this function as follow.
- {
- HI_S32 s32ChipID[PCIV_MAX_CHIPNUM], i, s32Ret;
- s32Ret = HI_MPI_PCIV_EnumChip(s32ChipID);
- HI_ASSERT(HI_SUCCESS == s32Ret);
- for(i=0; i<PCIV_MAX_CHIPNUM; i++)
- {
- if(s32ChipID[i] == -1) break;
- printf("The chip%d is connected\n", s32ChipID[i]);
- }
- printf("Total %d chips are connected\n", i);
- }
- Input : s32ChipID ** The chip id array
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_GetLocalId
- HI_MPI_PCIV_GetBaseWindow
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_EnumChip(HI_S32 as32ChipID[PCIV_MAX_CHIPNUM]);
- /*****************************************************************************
- Description : On the host, you can get all the slave borad's NP,PF and CFG window
- On the slave, you can only get the PF AHB Addres of itself.
- Input : s32ChipId ** The chip Id which you want to access
- Output : pBase ** On host pBase->u32NpWinBase,
- pBase->u32PfWinBase,
- pBase->u32CfgWinBase
- On Slave pBase->u32PfAHBAddr
- Return Value : HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_GetLocalId
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_GetBaseWindow(HI_S32 s32ChipId, PCIV_BASEWINDOW_S *pBase);
- /*****************************************************************************
- Description : Only on the slave chip, you need to create some VB Pool.
- Those pool will bee created on the PCI Window Zone.
- Input : pCfg.u32PoolCount ** The total number of pool want to create
- pCfg.u32BlkSize[] ** The size of each VB block
- pCfg.u32BlkCount[]** The number of each VB block
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_ERR_PCIV_SYS_NOTREADY
- HI_ERR_PCIV_NULL_PTR
- HI_ERR_PCIV_NOMEM
- HI_ERR_PCIV_BUSY
- HI_ERR_PCIV_NOT_SUPPORT
- HI_FAILURE
- See Also : HI_MPI_PCIV_GetLocalId
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_WinVbCreate(const PCIV_WINVBCFG_S *pCfg);
- /*****************************************************************************
- Description : Destroy the pools which's size is equal to the pCfg.u32BlkSize[]
- Input : pCfg.u32PoolCount ** The total number of pool want to destroy
- pCfg.u32BlkSize[] ** The size of each VB block
- pCfg.u32BlkCount[]** Don't care this parament
- Output : None
- Return Value : HI_SUCCESS if success.
- HI_ERR_PCIV_SYS_NOTREADY
- HI_ERR_PCIV_NOT_SUPPORT
- HI_FAILURE
- See Also : HI_MPI_PCIV_GetLocalId
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_WinVbDestroy(HI_VOID);
- /*****************************************************************************
- Description : Show the image in VO device from PCI
- Input : pcivChn ** The pciv channel id
- Output : None
- Return Value :
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Show(PCIV_CHN pcivChn);
- /*****************************************************************************
- Description : Hide the image in VO device from PCI
- Input : pcivChn ** The pciv channel id
- Output : None
- Return Value :
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_Hide(PCIV_CHN pcivChn);
- /*****************************************************************************
- Description : Get pre-processing parameter, e.g. filter coef.
- Input : pcivChn ** The pciv channel id
- Output : PCIV_PREPROC_CFG_S ** The pre-processing parameter of pciv channel
- Return Value :HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_SetPreProcCfg
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_GetPreProcCfg(PCIV_CHN pcivChn,PCIV_PREPROC_CFG_S *pstCfg);
- /*****************************************************************************
- Description : Set pre-processing parameter, e.g. filter coef.
- Input : pcivChn ** The pciv channel id
- PCIV_PREPROC_CFG_S ** The pre-processing parameter of pciv channel
- Output : NONE
- Return Value :HI_SUCCESS if success.
- HI_FAILURE if failure
- See Also : HI_MPI_PCIV_GetPreProcCfg
- *****************************************************************************/
- HI_S32 HI_MPI_PCIV_SetPreProcCfg(PCIV_CHN pcivChn,const PCIV_PREPROC_CFG_S *pstCfg);
- #ifdef __cplusplus
- #if __cplusplus
- }
- #endif
- #endif /* __cplusplus */
- #endif /* __MPI_VENC_H__ */
|