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的基本用法。
代码下载和编译:
下载地址:https://gitlab.freedesktop.org/mesa/kmscube
编译:
./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>]