iMX53 IPU圖解之IDMAC

下面開始IPU模塊框圖,我們將引入部分Sansung S5PV210部分圖形處理單元框圖,調整視角與iMX53進行比較,因爲他們都是ARM架構都將肩負同樣的使命(圖形處理並輸出)。


IPU系統模塊框圖

從上圖我們可以得出iMX53 IPU由以下模塊構成:

CSI - Camera Sensor Interface

DI - Display Interface

DC - Display Controller

DP - Display Processor

IC - Image Converter

VDIC - Video De Interlacer

IRT - Image Rotator

IDMAC - Image DMA Controlle

DMFC - Display Multi FIFO Controller

CM - Control Module

除此之外我們還應該注意他們之間的連線,因爲它反映了IPU內部數據總線的連接關係。後面我們即將深入研究的DMA傳輸都需要物理連接着支撐。

下面將開始內部總線研究。


該圖看起來比較讓人頭疼,但他至少揭示了DAM需要使用的兩個重點單元CMIDMAC。因此可以基於該線索對框圖調整後如下圖:


數據要進行DMA傳輸全部需要IDMAC進行控制。CM(Control Module)看看他的大名,總指揮就是他了。

再來一個Sansung描述的IPU對數據處理的框圖。


該圖讓IPU的工作看起來更明確了。

內部控制核心IDMACCM分析:
在分析IDMAC之前我們需要先看看IDMAC數據傳輸需要遵循的規則。

1.數組存放規則。


經典數據存儲圖

根據DMA搬運原理,AXI總線每次傳輸64bit,需要對像素點數據進行存放,因爲後面的大部分數據處理都以像素點爲單位。數據存放與數據處理息息相關,代碼反映爲像素點格式,存儲區域大小。放大到窗口內存區域。

typedef struct framebuffer_device_t {

..........

/* dimensions of the framebuffer in pixels */

const uint32_t width;

const uint32_t height;


/* frambuffer stride in pixels */

const int stride;


/* framebuffer pixel format */

const int format;

…………

};

再看IDMAC框圖


該模塊由大量小單元組成,但要做的事爲:記錄通道信息,訪問優先級配置等等。還需要分析IDMAC讀寫控制不同的數據控制點。

IBIW & IBIR - Internal bus interface for write and read

IPU內部總線向IDMAC橋接,可以簡單看成多路複用控制模塊。

FCW & FCR - Format converter write and read

從框圖反映爲64位總線向128位總線過渡,其實他的核心工作爲數據的壓縮存放,與壓縮數據進入IPU處理前的數據還原。下圖爲IPU內部支持的數據格式:


但數據位於RAM中的存儲方式可並非如此,看看上方的經典數據存放圖可知。

當然要想實現數據的壓縮與恢復我們還需要CPMEMLUT的支持。

BCW-buffer controller for write& BCR-buffer controller for read

BUFW- buffering write&BUFR- buffering read

讀寫端都具有4 x 64 bytes buffers因爲RGBAYUVA都有4種顏色分量構成BCW控制BUFWBCR控制BUFR

AXIW - AXI Write and AXIR - AXI Read

AXIW/AXIR控制對AXI總線的讀寫。IPU手冊解釋爲:實時通道控制。因爲IPUAXI發出的請求有實時總線請求與非實時總線請求,並且BCR/BCW會對他們進行控制,可用讀取通道數爲8,寫入通道數爲6.因此防止全部非實時通道造成的通道阻塞。因此需要限制IPU同時最高使用的通道數目。

CC_W & CC_R - Channel Control Write and Read

其實CC_W/CC_R纔是最重要的IDMAC控制單元,

• It arbitrates the channels according to the priority.

• Controls the address arithmetic unit.

• Functions as a memory interface to the CPMEM. It reads the parameters from the CPMEM, prepares the controls accordingly and writes back updated parameters to the CPMEM.

• The read unit provides the parameters to the IBIR unit

• The write unit provides the parameters to the AXIW unit

AAU_W & AAU_R- Address Arithmetic Unit for Write and Read

DMA訪問地址計算單元,地址計算公式如下:

ADDR = EBA +XB + SX* BPP + (YB + SY) *(SL + 1)


ATC - Alpha Transparency Controller


通道關聯


CPMEM - Channel Parameter Memory

每個通道由160bit參數配置區控制。


The parameters and the way they are organized are different for each mode. The Pixel Format Select (PFS) value of the CPMEM words are used by the IPU to determine if the words should be interpreted as interleaved or non-interleaved format.

Locking the arbitration and reordering the AXI bursts(提高DMA效率機制)

每次讀取更多的數據 。


總結:

IDMACDMA數據流處理核心單元,IPU完成的內存數據到物理設備輸出,通過硬件加速提高顯示效率與對總線帶寬的佔用。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章