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

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

问题描述

我想知道是否可以获得没有Xorg及其DDX驱动程序的图形硬件加速,只有内核模块和其余的用户空间驱动程序。我问这个是因为我开始在一个嵌入式平台上开发(像是beagleboard或者更像是德州仪器的ARM芯片,集成了GPU),而且我将得到硬件加速,而不用图形服务器的开销(不是需要)。



如果是,如何?我在考虑OpenGL或OpengGLES实现,或者Qt嵌入 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



谢谢。

解决方案

答案将取决于您的用户应用程序。如果一切都是裸机,并且您的应用团队正在编写所有内容,那么 DirectFB API可以用作Fredrik的建议。如果您使用GTK的framebuffer版本,这可能特别有趣。



但是,如果您使用Qt,那么这不是最好的方法。 Qt5.0消除QWS( Qt embedded acceleration )。 Qt正在迁移到LightHouse ,现在称为 QPA 。如果您编写了一个使用您的图形加速功能的QPA 插件,那么您可以通过任何内容机制来显示,那么您将具有加速的Qt图形。还有兴趣可能是 Wayland architecture ; Wayland QPA 插件。在Qt4.8 +和Qt5.0 +中支持 QPA Skia 也是一个有趣的图形API,支持OpenGL后端; Skia由Android设备使用。



获取图形加速很简单。你想合成吗?你的记忆足迹是什么?您的开发者受众将针对 API 进行编程?您是否需要对象功能或仅绘制图元?具有所有小部件和动态效果的全面展示图形框架(Gtk,Qt)之间的区别在于SKIA , PegUI WindML 人们期待今天。编程到 OpenGL ES API可能看起来很好,乍看之下,但如果您的应用程序有任何复杂性您将需要更丰富的图形框架;主要是重复 Mats Petersson的评论。



编辑: Qt embedded acceleration link,


  1. CPU blitter - 最慢

  2. 硬件blitter - 例如directBB。快速记忆运动通常使用位操作,而不是机器字,如DMA。

  3. 2D矢量 - OpenVG,Stick图形绘图,带位操作。

  4. 3D绘图 - OpenGL(ES)具有多边形填充等。

这是您要执行的绘图类型。像Qt 和 Gtk 这样的框架,给一个API放置一个单选按钮,复选框,编辑框等在屏幕上。它还具有文字的风格和与键盘,鼠标和/或触摸屏和其他元素的交互。 框架使用绘图引擎将对象放在屏幕上。



图形加速只是将算法单独的CPU或专用硬件中的 Bresenham算法。如果您选择的框架不支持3D 对象,则框架不太可能需要OpenGL支持,而可能不会更好。



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



另外:没有X的DRI DRI



以下是 Wayland 图形堆栈一个博客Wayland




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).

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

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

Thank you.

解决方案

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.

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.

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.

Edit: From the Qt embedded acceleration link,

  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.

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.

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.

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.

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.

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

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

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