6.3.4. 测试指南

6.3.4.1. 测试环境

6.3.4.1.1. 硬件

  • 开发板,或者D211的FPGA板

  • 可转接LVDS的子板

  • LVDS屏幕,7寸TFT屏幕,驱动芯片EK79001+EK73215

6.3.4.1.2. 软件

  • PC端的串口终端软件,用于PC和开发板进行串口通信

  • 显示模块的测试demo:test_dmabuf

6.3.4.1.3. 软件配置

6.3.4.1.3.1. 配置 LVDS屏幕

测试中需要用到LVDS屏幕,以驱动芯片EK79001+EK73215为例,在 luban 的根目录下通过make kernel-menuconfig,按如下选择:

Linux
    Device Drivers
        Graphics support
            Frame buffer Devices
                <*> Artinchip Framebuffer support
                    [*]   Artinchip display lvds support
                        <*> Artinchip Framebuffer support
                            Artinchip Panel Drivers (Artinchip general LVDS panel)  --->

在board.dts中,修改 LVDS 相关配置。

  • panel

panel_lvds {
    compatible = "artinchip,aic-general-lvds-panel";
    enable-gpios = <&gpio_a 4 GPIO_ACTIVE_HIGH>;
    data-mapping = "vesa-24";
    data-channel = "single-link0";
    status = "okay";

    port {
        panel_lvds_in: endpoint {
            remote-endpoint = <&lvds0_out>;
        };
    };

    display-timings {
        native-mode = <&timing1>;
        timing1: 1024x600 {
            clock-frequency = <60000000>;
            hactive = <1024>;
            vactive = <600>;
            hback-porch = <140>;
            hfront-porch = <160>;
            hsync-len = <20>;
            vback-porch = <20>;
            vfront-porch = <12>;
            vsync-len = <3>;
            de-active = <1>;
            pixelclk-active = <1>;
        };
    };
};

6.3.4.1.3.2. display engine

&de0 {
    status = "okay";

    port@0 {
        reg = <0>;
        de0_in: endpoint {
            remote-endpoint = <&fb0_out>;
        };
    };

    port@1 {
        reg = <1>;
        de0_out: endpoint {
            remote-endpoint = <&lvds0_in>;
        };
    };
};

6.3.4.1.3.3. lvds display interface

&lvds0 {
    pinctrl-names = "default";
    pinctrl-0 = <&lvds0_pins>;
    status = "okay";

    port@0 {
        reg = <0>;
        lvds0_in: endpoint {
            remote-endpoint = <&de0_out>;
        };
    };

    port@1 {
        reg = <1>;
        lvds0_out: endpoint {
            remote-endpoint = <&panel_lvds_in>;
        };
    };
};

6.3.4.1.3.4. test_dmabuf 配置

在luban根目录,运行make menuconfig,按如下选择:

Artinchip packages
    Sample code
        [*] test-dma-buf

6.3.4.2. test_dmabuf 测试

test_dmabuf的主要功能是测试显示引擎UI图层和Videv图层blend,在Video图层播放一个视频帧文件

在打开test_dmabuf的编译后,板子上的test_dmabuf位于 /usr/local/bin/,无需进入该目录,直接运行test_dmabuf即可:

[aic@] # test_dmabuf -u
Usage: test_dmabuf [options]:
     -w, --width    need an integer argument
     -h, --height   need an integer argument
     -f, --format   video format, yuv420p etc
     -i, --input    need a file name
     -u, --usage

Example: test_dmabuf -w 480 -h 320 -f yuv420p -i my.yuv

[aic@] # test_dmabuf -w 480 -h 320 -f yuv420p -i my.yuv  - 播放一个yuv420格式的文件