00001 00008 /* 00009 * ============================================================================ 00010 * 00011 * Copyright (c) 2008-2012, Texas Instruments Incorporated 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions 00015 * are met: 00016 * 00017 * * Redistributions of source code must retain the above copyright 00018 * notice, this list of conditions and the following disclaimer. 00019 * 00020 * * Redistributions in binary form must reproduce the above copyright 00021 * notice, this list of conditions and the following disclaimer in the 00022 * documentation and/or other materials provided with the distribution. 00023 * 00024 * * Neither the name of Texas Instruments Incorporated nor the names of 00025 * its contributors may be used to endorse or promote products derived 00026 * from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00029 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00030 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00031 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00032 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00033 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00034 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00035 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00036 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00037 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00038 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * Contact information for paper mail: 00040 * Texas Instruments 00041 * Post Office Box 655303 00042 * Dallas, Texas 75265 00043 * Contact information: 00044 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? 00045 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact 00046 * ============================================================================ 00047 * 00048 */ 00049 00050 00051 #ifndef FRAMEQBUFMGR_SHMEM_H 00052 #define FRAMEQBUFMGR_SHMEM_H 00053 00054 #include <ti/ipc/GateMP.h> 00055 #include <ti/syslink/FrameQBufMgr.h> 00056 00057 00058 #if defined (__cplusplus) 00059 extern "C" { 00060 #endif 00061 00062 /* ============================================================================= 00063 * Macros & defines 00064 * ============================================================================= 00065 */ 00066 #define FrameQBufMgr_ShMem_BUFINTERFACE_SHAREDMEM FrameQBufMgr_BUFINTERFACE_SHAREDMEM 00067 #define FrameQBufMgr_ShMem_BUFINTERFACE_TILERMEM FrameQBufMgr_BUFINTERFACE_TILERMEM 00068 #define FrameQBufMgr_ShMem_HDRINTERFACE_SHAREDMEM FrameQBufMgr_HDRINTERFACE_SHAREDMEM 00069 #define FrameQBufMgr_ShMem_FrameBufParams FrameQBufMgr_FrameBufParams 00070 00071 00072 /* TODO - are different _internal_ vs _external types necessary? */ 00073 typedef FrameQBufMgr_Config FrameQBufMgr_ShMem_Config ; 00074 /* ============================================================================= 00075 * Structures & Enums 00076 * ============================================================================= 00077 */ 00078 00082 typedef struct FrameQBufMgr_ShMem_Params_tag { 00083 FrameQBufMgr_CreateParams commonCreateParams; 00086 GateMP_Handle gate; 00099 GateMP_LocalProtect localProtect; 00105 GateMP_RemoteProtect remoteProtect; 00110 Ptr sharedAddr; 00121 UInt32 sharedAddrSize; 00132 UInt32 regionId; 00140 UInt32 headerInterfaceType; 00146 UInt32 bufInterfaceType; 00153 Ptr sharedAddrHdrBuf; 00165 UInt32 sharedAddrHdrBufSize; 00171 UInt32 hdrBuf_regionId; 00179 Ptr sharedAddrFrmBuf; 00184 UInt32 sharedAddrFrmBufSize; 00189 UInt32 frmBuf_regionId; 00197 UInt32 numFreeFramePools; 00202 UInt32 numFreeFramesInPool[FrameQBufMgr_MAX_POOLS]; 00205 UInt32 numFreeHeaderBufsInPool[FrameQBufMgr_MAX_POOLS]; 00208 UInt32 frameHeaderBufSize[FrameQBufMgr_MAX_POOLS]; 00211 UInt32 numFrameBufsInFrame[FrameQBufMgr_MAX_POOLS]; 00215 FrameQBufMgr_ShMem_FrameBufParams *frameBufParams[FrameQBufMgr_MAX_POOLS]; 00218 UInt32 cpuAccessFlags; 00225 UInt32 numNotifyEntries; 00229 } FrameQBufMgr_ShMem_Params; 00230 00235 typedef struct FrameQBufMgr_ShMem_OpenParams_tag { 00236 FrameQBufMgr_CommonOpenParams commonOpenParams; 00238 }FrameQBufMgr_ShMem_OpenParams; 00239 00240 /* ============================================================================= 00241 * APIs 00242 * ============================================================================= 00243 */ 00244 00245 /* Initialize the FrameQBufMgr module, there would be some default values for 00246 * the parameters, but if any change is required, change the cfg before calling 00247 * this API. 00248 */ 00249 Int32 00250 FrameQBufMgr_ShMem_setup (FrameQBufMgr_ShMem_Config * cfg); 00251 00252 00253 /* Function to destroy(finalize) the FrameQBufMgr module.*/ 00254 Int32 00255 FrameQBufMgr_ShMem_destroy (Void); 00256 00266 void 00267 FrameQBufMgr_ShMem_Params_init(FrameQBufMgr_ShMem_Params * params); 00268 00285 UInt32 00286 FrameQBufMgr_ShMem_sharedMemReq (const FrameQBufMgr_ShMem_Params * params, 00287 UInt32 * hdrBufChunkSize, 00288 UInt32 * frmBufChunkSize); 00289 00290 Int32 FrameQBufMgr_ShMem_getConfig(FrameQBufMgr_ShMem_Config *cfg); 00291 00292 00293 00294 #if defined (__cplusplus) 00295 } 00296 #endif /* defined (__cplusplus) */ 00297 00298 00299 #endif /* HEAPBUF_H_0x4CD5 */ 00300