6.3.4. 测试指南

6.3.4.1. 测试环境

6.3.4.1.1. 硬件

  • 开发板

  • 可转接LVDS的子板

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

6.3.4.1.2. 软件

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

  • 显示模块的测试demo:dma_buf_test

6.3.4.1.3. 软件配置

6.3.4.1.3.1. 配置 LVDS屏幕

测试中需要用到LVDS屏幕,以驱动芯片EK79001+EK73215为例,参考快速入门 - 编译概述 - Kernel配置,按如下选择:

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

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

  • panel

panel_lvds {
    compatible = "zx,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. dma_buf_test 配置

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

zx (openwrt)
    sample-code
        [*] test-dma-buf

6.3.4.2. dma_buf_test 测试

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

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

[aic@] # dma_buf_test -u
Usage: dma_buf_test [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: dma_buf_test -w 480 -h 320 -f yuv420p -i my.yuv

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