00001 /** 00002 * @file FrameQBufMgr_ShMem.h 00003 * 00004 * @brief Header file for FrameQBufMgr ShMem. 00005 * 00006 * 00007 * @ver 02.00.00.68_beta1 00008 * 00009 * ============================================================================ 00010 * 00011 * Copyright (c) 2008-2009, 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 #ifndef FRAMEQBUFMGR_SHMEM_H 00051 #define FRAMEQBUFMGR_SHMEM_H 00052 00053 #include <ti/ipc/GateMP.h> 00054 #include <ti/syslink/FrameQBufMgr.h> 00055 00056 00057 #if defined (__cplusplus) 00058 extern "C" { 00059 #endif 00060 00061 /* ============================================================================= 00062 * Macros & defines 00063 * ============================================================================= 00064 */ 00065 #define FrameQBufMgr_ShMem_BUFINTERFACE_SHAREDMEM FrameQBufMgr_BUFINTERFACE_SHAREDMEM 00066 #define FrameQBufMgr_ShMem_BUFINTERFACE_TILERMEM FrameQBufMgr_BUFINTERFACE_TILERMEM 00067 #define FrameQBufMgr_ShMem_HDRINTERFACE_SHAREDMEM FrameQBufMgr_HDRINTERFACE_SHAREDMEM 00068 #define FrameQBufMgr_ShMem_FrameBufParams FrameQBufMgr_FrameBufParams 00069 /* ============================================================================= 00070 * Structures & Enums 00071 * ============================================================================= 00072 */ 00073 00074 /*! 00075 * @brief Structure defining parameters for the FrameQ module. 00076 */ 00077 typedef struct FrameQBufMgr_ShMem_Params_tag { 00078 FrameQBufMgr_CreateParams commonCreateParams; 00079 /*!< Common create parameters .Same for all the implementations*/ 00080 00081 GateMP_Handle gate; 00082 /*!< 00083 * gate used for critical region management of the shared memory. 00084 * 00085 * If it is null, FrameQBufMgr decides the gate based on the following 00086 * 1. If module's usedefaultgate is set to FALSE, It creates a gate 00087 * internally based on the localProtect and remoteProtect flags 00088 * provided in this params. 00089 * 2. If module's usedefaultgate is set to TRUE, it uses the module' 00090 * s gloabl gate for the instance. if module's global gate does not 00091 * exist FrameQBufMgr uses the GateMP's default gate for the instance. 00092 */ 00093 00094 GateMP_LocalProtect localProtect; 00095 /*!< 00096 * Local protection level for the module instance. 00097 * 00098 */ 00099 00100 GateMP_RemoteProtect remoteProtect; 00101 /*!< 00102 * Default multiprocessor protection for the module instances. 00103 * 00104 */ 00105 Ptr sharedAddr; 00106 /*!< 00107 * Virtual Address of the shared memory.Must be mapped 00108 * on other processors if instance needs to be accessible 00109 * from other processors. 00110 * 00111 * The creator must supply the shared memory that 00112 * this will use for maintain shared state information. 00113 * Required parameter. 00114 */ 00115 00116 UInt32 sharedAddrSize; 00117 /*!< 00118 * ======== sharedAddrSize ======== 00119 * Size of shareAddr 00120 * 00121 * Can use the FrameQBufMgr_ShMem_sharedMemReq call to determine the 00122 * required size. 00123 * 00124 * Required parameter. 00125 */ 00126 00127 UInt32 regionId; 00128 /*!< 00129 * Shared region ID 00130 * 00131 * The ID corresponding to the shared region in which this shared instance 00132 * is to be placed. 00133 */ 00134 00135 UInt32 headerInterfaceType; 00136 /*!< 00137 * Type of the interface used for frame headers. 00138 * 00139 * Required parameter. 00140 */ 00141 UInt32 bufInterfaceType; 00142 /*!< 00143 * Type of the interface used for frame buffers. 00144 * 00145 * Required parameter. 00146 */ 00147 00148 Ptr sharedAddrHdrBuf; 00149 /*!< 00150 * Virtual Address of the shared memory for frame header buffers.Must be 00151 * mapped on other processors if the buffers managed by this instance needs 00152 * to be accessible from other processors. 00153 * 00154 * The creator can supply the shared memory that this will use for 00155 * maintaining the data buffers. Applications can create instances without 00156 * passing this address.In this case applications need to add buffers to 00157 * the instance at runtime. 00158 */ 00159 00160 UInt32 sharedAddrHdrBufSize; 00161 /*!< 00162 * Size of sharedAddrHdrBuf 00163 * 00164 */ 00165 00166 UInt32 hdrBuf_regionId; 00167 /*! 00168 * Shared region ID for Header buffers. 00169 * 00170 * The ID corresponding to the shared region in From which Header buffers 00171 * will be allocated if sharedAddrHdrBuf is not provided. 00172 */ 00173 00174 Ptr sharedAddrFrmBuf; 00175 /*!< 00176 * Virtual shared Region Address of chunk for frame buffers. 00177 */ 00178 00179 UInt32 sharedAddrFrmBufSize; 00180 /*!< 00181 * sharedAddrHdrBufSize Size of the sharedAddrFrmBuf. 00182 */ 00183 00184 UInt32 frmBuf_regionId; 00185 /*! 00186 * Shared region ID for Frame buffers. 00187 * 00188 * The ID corresponding to the shared region in From which Frame buffers 00189 * will be allocated if sharedAddrFrmBuf is not provided. 00190 */ 00191 00192 UInt32 numFreeFramePools; 00193 /*!< 00194 * Number of buffer pools. 00195 */ 00196 00197 UInt32 numFreeFramesInPool[FrameQBufMgr_MAX_POOLS]; 00198 /*!< Number of free frames in each pool*/ 00199 00200 UInt32 numFreeHeaderBufsInPool[FrameQBufMgr_MAX_POOLS]; 00201 /*!< Number of free header buffers in each pool*/ 00202 00203 UInt32 frameHeaderBufSize[FrameQBufMgr_MAX_POOLS]; 00204 /*!< Array of frame header buffer sizes for all the pools*/ 00205 00206 UInt32 numFrameBufsInFrame[FrameQBufMgr_MAX_POOLS]; 00207 /*!< Number of frame buffers in a frame. For each pool, Apps can specify 00208 * the number of buffers in frames 00209 */ 00210 FrameQBufMgr_ShMem_FrameBufParams *frameBufParams[FrameQBufMgr_MAX_POOLS]; 00211 /*!< frame buffer size of framebuffers in pool*/ 00212 00213 UInt32 cpuAccessFlags; 00214 /*!< 00215 * cpuAccessFlags flags denoting whether frame buffers are accessed through 00216 * CPU or not. All the conrol structure and header buffers cache flags will 00217 * be derived internally based on shared region settings. 00218 */ 00219 00220 UInt32 numNotifyEntries; 00221 /*! 00222 * How many clients that do reister callback function with the instance. 00223 */ 00224 } FrameQBufMgr_ShMem_Params; 00225 00226 /*! 00227 * @brief Structure defining open parameters for the FrameQ instance on ShMem 00228 * (shared memory interface). 00229 */ 00230 typedef struct FrameQBufMgr_ShMem_OpenParams_tag { 00231 FrameQBufMgr_CommonOpenParams commonOpenParams; 00232 /*!< open params common to all the implementations*/ 00233 }FrameQBufMgr_ShMem_OpenParams; 00234 00235 /* ============================================================================= 00236 * APIs 00237 * ============================================================================= 00238 */ 00239 /*! 00240 * @brief Function to initiallze the params with the default params. 00241 * 00242 * 00243 * @param params pointer to FrameQBufMgr_ShMem_Params. 00244 * 00245 * 00246 * @sa FrameQBufMgr_create 00247 */ 00248 void 00249 FrameQBufMgr_ShMem_Params_init(FrameQBufMgr_ShMem_Params * params); 00250 00251 /*! 00252 * @brief Function to find out the shared memory requirements. 00253 * 00254 * This function returns size of the shared memory required for the 00255 * instance based on the params provided. 00256 * 00257 * @param params pointer to FrameQ_ShMem_Params. 00258 * @param hdrBufChunkSize out paramter.Itives the size of the memory 00259 * required for frame headers. 00260 * @param frmBufChunkSize out paramter Itives the size of the memory 00261 * required for frame buffers. 00262 * 00263 * @retval size shared memory reqired for the instance 00264 * 00265 * @sa FrameQBufMgr_ShMem_Params_init(), FrameQBufMgr_create() 00266 */ 00267 UInt32 00268 FrameQBufMgr_ShMem_sharedMemReq (const FrameQBufMgr_ShMem_Params * params, 00269 UInt32 * hdrBufChunkSize, 00270 UInt32 * frmBufChunkSize); 00271 00272 #if defined (__cplusplus) 00273 } 00274 #endif /* defined (__cplusplus) */ 00275 00276 00277 #endif /* HEAPBUF_H_0x4CD5 */ 00278
1.4.4