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
測試結果如下:
參考鏈接: