Linux显示:基于Framebuffer的图形框架和测试工具

Linux显示:基于Framebuffer的图形框架和测试工具 JQ 2025-04-11 11:36:02 99

Linux Framebuffer子系统是传统的内核显示框架。有很多基于Frambuffer的用户空间形式框架,以及针对Framebuffer的测试工具。

1. Linux Framebuffer

Linux FrameBuffer相关的开源资源《fosdem_2020_nicolas_caramelli_linux_framebuffer.pdf》。

2. 基于FrameBuffer的图形框架

2.1 Mesa 3D

OpenGL(Open Graphics Library)是用于渲染2D、3D矢量图形的跨语言、跨平台的应用程序编程接口(API)。

OpenGL ES (OpenGL for Embedded Systems) 是 OpenGL 三维图形 API 的子集,针对手机、PDA和游戏主机等嵌入式设备而设计。

OpenVG(Open Vector Graphics),OpenVG™ 是针对诸如Flash和SVG的矢量图形算法库提供底层硬件加速界面的免授权费、跨平台应用程序接口API。

EGL是OpenGL ES和底层Native平台视窗系统之间的接口。更多参考《EGL Overview - The Khronos Group Inc》。

Mesa 3D是OpenGL的一个开源本的实现,支持3D硬件加速。Mesa实现了多种图形API,包括OpenGL ES、OpenCLK、OpenMAX、EGL等。Mesa 3D能够完全借助CPU和Linux Framebuffer(GLFBDEV(OpenGL Extension to the Linux Framebuffer)和EGL )实现OpenGL和OpenGL EL渲染。

2.2 DirectFB

DirectFB是基于fbdev的一系列图形API接口。

DirectFB - eLinux.org

2.3 QT LinuxFB插件

QT显示插件(LinuxFB)及其依赖的驱动(DRM/framebuffer)记录

3 基于FrameBuffer的测试工具

3.1 fb-test-app

3.1.1 fb-test

通过fbtest可以指定framebuffer显示r/g/b/white/patter。

fb-test 1.1.0 (rosetta)
Usage: fb-test -f fbnum -r -g -b -w -p pattern
Where -f fbnum   = framebuffer device number
      -r         = fill framebuffer with red
      -g         = fill framebuffer with green
      -b         = fill framebuffer with blue
      -w         = fill framebuffer with white
      -p pattern = fill framebuffer with pattern number
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

例如fb-test -f 0 -p 0:

3.1.2 fb-test-rect

在framebuffer上随机画不同大小和颜色矩形。

3.2 fbdump

将当前framebuffer快照以ppm格式导出到文件中。

fbdump  -fb /dev/fb0 > fb0.ppm
  • 1

3.3 fbgrab

fbgrab也是获取framebuffer快照并保存成文件,不过是保存成png文件,同时配置选项相对于fbdump也更多。

Possible options:
        -b n    force use of n bits/pixel, required when reading from file
        -C n    grab from console n, for slower framebuffers
        -c n    grab from console n
        -d dev  use framebuffer device dev instead of default
        -f file  read from file instead of framebuffer
        -h n    set height to n pixels, required when reading from file
                can be used to force height when reading from framebuffer
        -i      turns on interlacing in PNG
        -s n    sleep n seconds before making screenshot
        -v      verbose, print debug information.
        -w n    set width to n pixels, required when reading from file
                can be used to force width when reading from framebuffer
        -z n    PNG compression level: 0 (fast) .. 9 (best)
        -?      print this usage information
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

例如:fbgrab -d /dev/fb0 fb.png。

3.4 fbset

fbset是一个显示或者设置framebuffer设备的工具。

Usage: fbset [options] [mode]

Valid options:
  General options:
    -h, --help         : display this usage information
    --test             : don't change, just test whether the mode is valid
    -s, --show         : display video mode settings
    -i, --info         : display all frame buffer information
    -v, --verbose      : verbose mode
    -V, --version      : print version information
    -x, --xfree86      : XFree86 compatibility mode
    -a, --all          : change all virtual consoles on this device
  Frame buffer special device nodes:
    -fb <device>       : processed frame buffer device
                         (default is /dev/fb0)
  Video mode database:
    -db <file>         : video mode database file
                         (default is /etc/fb.modes)
  Display geometry:
    -xres <value>      : horizontal resolution (in pixels)
    -yres <value>      : vertical resolution (in pixels)
    -vxres <value>     : virtual horizontal resolution (in pixels)
    -vyres <value>     : virtual vertical resolution (in pixels)
    -depth <value>     : display depth (in bits per pixel)
    -nonstd <value>    : select nonstandard video mode
    -g, --geometry ... : set all geometry parameters at once
    -match             : set virtual vertical resolution by virtual resolution
  Display timings:
    -pixclock <value>  : pixel clock (in picoseconds)
    -left <value>      : left margin (in pixels)
    -right <value>     : right margin (in pixels)
    -upper <value>     : upper margin (in pixel lines)
    -lower <value>     : lower margin (in pixel lines)
    -hslen <value>     : horizontal sync length (in pixels)
    -vslen <value>     : vertical sync length (in pixel lines)
    -t, --timings ...  : set all timing parameters at once
  Display flags:
    -accel <value>     : hardware text acceleration enable (false or true)
    -hsync <value>     : horizontal sync polarity (low or high)
    -vsync <value>     : vertical sync polarity (low or high)
    -csync <value>     : composite sync polarity (low or high)
    -gsync <value>     : synch on green (false or true)
    -extsync <value>   : external sync enable (false or true)
    -bcast <value>     : broadcast enable (false or true)
    -laced <value>     : interlace enable (false or true)
    -double <value>    : doublescan enable (false or true)
    -rgba <r,g,b,a>    : recommended length of color entries
    -grayscale <value> : grayscale enable (false or true)
  Display positioning:
    -move <direction>  : move the visible part (left, right, up or down)
    -step <value>      : step increment (in pixels or pixel lines)
                         (default is 8 horizontal, 2 vertical)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
<

3.5 fbterm

fbterm:一个基于framebuffer的终端模拟器。

3.6 fbv

fbv:一个基于framebuffer的显示gif/jpeg/png/bmp文件的工具。

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
JQ
红包 点赞 收藏 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
JQ
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区