没有 X 的硬件加速 [英] Hardware acceleration without X

查看:45
本文介绍了没有 X 的硬件加速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能在没有 Xorg 及其 DDX 驱动程序的情况下获得图形硬件加速,只有内核模块和用户空间驱动程序的其余部分.我问这个是因为我开始在嵌入式平台上进行开发(比如 beagleboard 或更粗略的带有集成 GPU 的 Texas Instruments ARM 芯片),并且我将获得硬件加速而无需图形服务器的开销(这不是需要).

I was wondering if it would be possible to get graphical hardware acceleration without Xorg and its DDX driver, only with kernel module and the rest of userspace driver. I'm asking this because I'm starting to develop on an embedded platform (something like beagleboard or more roughly a Texas instruments ARM chip with integrated GPU), and I would get hardware acceleration without the overhead of a graphical server (that is not needed).

如果是,如何?我在考虑 OpenGL 或 OpengGLES 实现,或 Qt 嵌入式 http://harmattan-dev.nokia.com/docs/library/html/qt4/qt-embeddedlinux-accel.html

If yes, how? I was thinking about OpenGL or OpengGLES implementations, or Qt embedded http://harmattan-dev.nokia.com/docs/library/html/qt4/qt-embeddedlinux-accel.html

而且 TI 提供了大量文档,但我仍然不清楚http://processors.wiki.ti.com/index.php/Sitara_Linux_Software_Developer%E2%80%99s_Guide

And TI provides a large documentation, but still is not clear to me http://processors.wiki.ti.com/index.php/Sitara_Linux_Software_Developer%E2%80%99s_Guide

谢谢.

推荐答案

答案 将取决于您的用户应用程序.如果一切都是裸机并且您的应用程序团队正在编写一切,DirectFBAPI 可以按照 Fredrik 的建议使用.如果您使用 GTK 的帧缓冲版本,这可能会特别有趣.

The answer will depend on your user application. If everything is bare metal and your application team is writing everything, the DirectFB API can be used as Fredrik suggest. This might be especially interesting if you use the framebuffer version of GTK.

但是,如果您正在使用 Qt,那么这不是最好的前进方式.Qt5.0 取消了 QWS(Qt 嵌入式加速).Qt 正在迁移到 LightHouse,现在称为 QPA.如果您编写了一个QPA 插件,该插件通过您公开的任何内核机制使用您的图形加速,那么您就拥有了加速 Qt 图形.同样感兴趣的可能是 Wayland 架构WaylandQPA 插件.Qt4.8+ 和 Qt5.0+ 支持 QPA.Skia 也是一个有趣的图形 API,支持 OpenGL 后端;Android 设备使用 Skia.

However, if you are using Qt, then this is not the best way forward. Qt5.0 does away with QWS (Qt embedded acceleration). Qt is migrating to LightHouse, now known as QPA. If you write a QPA plug-in that uses your graphics acceleration by whatever kernel mechanism you expose, then you have accelerated Qt graphics. Also of interest might be the Wayland architecture; there are QPA plug-ins for Wayland. Support exists for QPA in Qt4.8+ and Qt5.0+. Skia is also an interesting graphics API with support for an OpenGL backend; Skia is used by Android devices.

获得图形加速很容易.你想合成吗?你的内存足迹是多少?谁是您的开发者受众,他们将为 API 编程?您需要对象功能还是只需要绘制图元?SKIAPegUIWindML 和完整的图形框架(Gtk、Qt)之间有很大的不同,它们具有所有的小部件和动态效果人们期待今天.对 OpenGL ES API 编程乍一看似乎没问题,但如果您的应用程序有任何复杂性您将需要一个更丰富的图形框架;主要是重复Mats Petersson 的评论.

Getting graphics acceleration is easy. Do you want compositing? What is your memory foot print? Who is your developer audience that will program to the API? Do you need object functionality or just drawing primitives? There is a big difference between SKIA, PegUI, WindML and full blown graphics frameworks (Gtk, Qt) with all the widget and dynamics effects that people expect today. Programming to the OpenGL ES API might seem fine at first glance, but if your application has any complexity you will need a richer graphics framework; Mostly re-iterating Mats Petersson's comment.

来自Qt内嵌加速链接,

  1. CPU blitter - 最慢
  2. 硬件 blitter - 例如,directFB.与机器字(如 DMA)相反,通常使用位操作进行快速内存移动.
  3. 2D 矢量 - OpenVG、简笔画、位操作.
  4. 3D 绘图 - OpenGL(ES) 具有多边形填充等.
  1. CPU blitter - slowest
  2. Hardware blitter - Eg, directFB. Fast memory movement usually with bit ops as opposed to machine words, like DMA.
  3. 2D vector - OpenVG, Stick figure drawing, with bit manipulation.
  4. 3D drawing - OpenGL(ES) has polygon fills, etc.

这是您希望执行的绘图类型.像 QtGtk 这样的框架,提供了一个 API,可以在屏幕上放置单选按钮、复选框、编辑框等.它还具有文本样式以及与键盘、鼠标和/或触摸屏和其他元素的交互.框架使用绘图引擎将对象放在屏幕上.

This is the type of drawing you wish to perform. A framework like Qt and Gtk, give an API to put a radio button, checkbox, editbox, etc on the screen. It also has styling of the text and interaction with a keyboard, mouse and/or touch screen and other elements. A framework uses the drawing engine to put the objects on the screen.

图形加速只是将 Bresenham 算法 之类的算法放在单独的 CPU 中或专用硬件.如果您选择的框架不支持 3D 对象,则这些框架不太可能需要 OpenGL 支持,并且可能的性能也不会更好.

Graphics acceleration is just putting algorithms like a Bresenham algorithm in a separate CPU or dedicated hardware. If the framework you chose doesn't support 3D objects, the frameworks is unlikely to need OpenGL support and may not perform any better.

最后一块拼图是窗口管理器.许多嵌入式设备不需要这个.然而,许多手机正在使用合成alpha值来创建透明窗口并允许同时看到多个应用程序.这也可能会影响您的图形 API.

The final piece of the puzzle is a window manager. Many embedded devices do not need this. However, many handset are using compositing and alpha values to create transparent windows and allow multiple apps to be seen at the same time. This may also influence your graphics API.

此外:没有 X 的 DRI 给出了一些令人信服的理由,说明这可能不是一个好的要做的事;对于单个用户任务,甚至不需要 DRI.

Additionally: DRI without X gives some compelling reasons why this might not be a good thing to do; for the case of a single user task, the DRI is not even needed.

以下是 Wayland 图形堆栈的示意图 Wayland 博客.

The following is a diagram of a Wayland graphics stack a blog on Wayland.

这篇关于没有 X 的硬件加速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆