6.1.2. 参数配置

6.1.2.1. 内核配置

GE驱动依赖dma-buf、CMA,需要提前打开。

6.1.2.1.1. 打开 CMA

参考快速入门 - 编译概述 - Kernel配置,进入kernel的功能配置,按如下选择:

Linux
    Memory Management options
         [*] Contiguous Memory Allocator

CMA区域的大小配置,如下配置为 16MB,可以根据具体需求来配置size大小

Linux
    Library routines
        [*] DMA Contiguous Memory Allocator
        (16)  Size in Mega Bytes

6.1.2.1.2. 打开 dma-buf

参考快速入门 - 编译概述 - Kernel配置,进入kernel的功能配置,按如下选择:

Linux
    Device Drivers
        DMABUF options
            [*] Explicit Synchronization Framework
            [*]   Sync File Validation Framework
            [*] userspace dmabuf misc driver
            [*] DMA-BUF Userland Memory Heaps
                [*]   DMA-BUF CMA Heap

6.1.2.1.3. 打开 GE

参考快速入门 - 编译概述 - Kernel配置,进入kernel的功能配置,按如下选择:

Linux
    Device Drivers  --->
        Graphics support  --->
            ZX Graphics  --->
                <*> ZX 2D Graphics Engine
                    select 2D Graphics Engine Mode
                        ( ) CMD queue mode
                        (X) normal mode

可以选择CMD queue mode或者normal mode,只可以二选一, 其中CMD queue mode为命令队列模式,normal mode为非命令队列模式

6.1.2.2. DTS 参数配置

ge: ge@18b00000 {
    #address-cells = <1>;
    #size-cells = <0>;
    compatible = "zx,aic-ge-v1.0";
    reg = <0x0 0x18b00000 0x0 0x1000>;
    interrupts-extended = <&plic0 60 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&cmu CLK_GE>;
    clock-names = "ge";
    resets = <&rst RESET_GE>;
    reset-names = "ge";
};