linux DRM/KMS 测试工具 modetest、kmscude、igt-gpu-tools (二)

kmscube
 
kmscube is a little demonstration program for how to drive bare metal graphics without a compositor like X11, wayland or similar, using DRM/KMS (kernel mode setting), GBM (graphics buffer manager) and EGL for rendering content using OpenGL or OpenGL ES.
 
是由mesa3d提供和维护,这是一个基于 KMS/GBM/EGL/OPENGL ES2.0 测试用例。
kmscude不依赖X11、wayland等窗口系统的简单图像测试程序。
GBM、EGL和OpenGL ES产生图形数据,再经由DRM/KMS显示。
GBM、EGL和OpenGL ES由mesa3D提供相关的库,DRM/KMS通过libdrm库进行访问。
所以kmscude同时包含OpenGL、EGL、GBM和DRM/KMS的基本用法。
 

 
代码下载和编译:
 
编译:
meson . build && ninja -C build
编译成功后,build路径下会生成可执行文件:
 
ls build/
build.ninja             kernel.trace   kmscube-l.profile   kmscube.profile  ‘kmscube@exe’/   meson-logs/      oprofile_data/  ‘texturator@exe’/
compile_commands.json   kmscube*       kmscube.1.trace     kmscube.trace     meson-info/     meson-private/   texturator*
 

 
测试实例:
 
进入到build命令,通过如下命令查看kmscude的帮助信息:
 
./kmscube –help
./kmscube: unrecognized option ‘–help’
Usage: ./kmscube [-ADfMmSsVv]
 
 
options:
    -A, –atomic             use atomic modesetting and fencing
    -c, –count              run for the specified number of frames
    -D, –device=DEVICE      use the given device
    -f, –format=FOURCC      framebuffer format
    -M, –mode=MODE          specify mode, one of:
        smooth    –  smooth shaded cube (default)
        rgba      –  rgba textured cube
        nv12-2img –  yuv textured (color conversion in shader)
        nv12-1img –  yuv textured (single nv12 texture)
    -m, –modifier=MODIFIER  hardcode the selected modifier
    -p, –perfcntr=LIST      sample specified performance counters using
                             the AMD_performance_monitor extension (comma
                             separated list, shadertoy mode only)
    -S, –shadertoy=FILE     use specified shadertoy shader
    -s, –samples=N          use MSAA
    -V, –video=FILE         video textured cube (comma separated list)
    -v, –vmode=VMODE        specify the video mode in the format
                             <mode>[-<vrefresh>]
 
基本用法:
 
sudo ./kmscube -A -D /dev/dri/card0 -M smooth
 
    说明:
    -A:DRM/KMS使用atomic模式
    -D:指定设备节点,DRM/KMS和GPU是同一个设备节点
    -M:指定OpenGL的绘图模式,可选的值包括:smooth、rgba、nv12-2img、nv12-1img
 
测试结果如下:
 

 

 

 
参考链接: