2024年11月05日 第10讲 DRQ与CAM SYNC 第1部分 极客笔记
本讲是Camera KMD ISP子系统专题的第10讲,我们讲解Camera KMD ISP子系统DRQ与CAM SYNC第一部分。
更多资源:
资源 | 描述 |
---|---|
在线课程 | 极客笔记在线课程 |
知识星球 | 星球名称:深入浅出Android Camera 星球ID: 17296815 |
极客笔记圈 |
利用多线程并行处理Pipeline中并行的node,加快处理速度
ChiContext::Initialize()
{
ThreadManager::Create(&m_pThreadManager, "SoloThreadManager", numThreads);
//线程池handler会传递给session, pipeline, node, drq, metapool等进行共同使用
}
Session::Initialize()
{
m_pDeferredRequestQueue = DeferredRequestQueue::Create(&pDeferredCreateData);
}
class DeferredRequestQueue : public IPropertyPoolObserver
{
Hashmap* m_pDependencyMap; ///< Hashmap to store pending dependencies
ThreadManager* m_pThreadManager; ///< 指向一个线程池
Session* m_pSession; ///< pointer to Session to which this DRQ belongs
JobHandle m_hDeferredWorker; ///< 通过这个worker handle执行异步操作
LightweightDoublyLinkedList m_deferredNodes; ///< List of deferred nodes
LightweightDoublyLinkedList m_readyNodes; ///< List of ready nodes
MetadataPool* m_pMainPools[MaxPipelinesPerSession]; ///< 保存了每个pipeline的result metadata pool
}
每个Node需要填写自己处理一个request需要的dependency(chifence, fence, metadata/property),只有所有的dependency都满足后,DRQ才会调度线程池去安排node处理request
struct DependencyUnit
{
PropertyDependency propertyDependency;
bufferDependency;// input buffer fence
chiFenceDependency;// non buffer fence
}
struct DependencyKey
{
UINT64 requestId; ///< Request ID
UINT64 pipelineId; ///< pipeline id for the data
UINT32 dataId; ///< Property/Metadata/Data identifier
VOID* pFence; ///< Fence pointer
VOID* pChiFence; ///< Chi Fence pointer
};
DependencyKey mapKey = {request, pDependency->pipelineIds[i], pDependency->properties[i], NULL, NULL};
DependencyKey mapKey = {0, 0, PropertyIDInvalid, pDependency->phFences[i], NULL};
DependencyKey mapKey = {0, 0, PropertyIDInvalid, NULL, pDependency->pChiFences[i]};
HashMap结构
本文链接:http://so.lmcjl.com/news/17044/