Difference between revisions of "Graphics"

From Rockchip open source Document
Jump to: navigation, search
(Created page with " This article will give a overview of how graphics are generated on a rockchip platform. === Graphics Hardware === ==== [http://rockchip.wikidot.com/vop VOP] ==== ==== [htt...")
 
 
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
  
This article will give a overview of how graphics are generated on a rockchip platform.
 
  
=== Graphics Hardware ===
 
  
==== [http://rockchip.wikidot.com/vop VOP] ====
+
= Graphics Introduce =
  
==== [http://rockchip.wikidot.com/gpu GPU] ====
+
This article will give an overview of how graphics are generated on a rockchip platform.
  
==== [http://rockchip.wikidot.com/rga RGA] ====
+
 
  
=== Graphics Software ===
+
 
  
If you are using Debian form rockchip, the default display system will be X11. Other display systems are available in [http://rockchip.wikidot.com/yocto-user-guide yocto sdk].
+
== Graphics with X11 ==
 
 
==== Graphics with X11 ====
 
  
 
Xserver is the display system used on regular desktop Linux platforms.
 
Xserver is the display system used on regular desktop Linux platforms.
  
Rockchip have a custom [http://rockchip.wikidot.com/xserver Xserver] which have enable [https://www.freedesktop.org/wiki/Software/Glamor/ glamor 2D acceleration].
+
Rockchip have a custom [[Xserver|Xserver]] which have enable [https://www.freedesktop.org/wiki/Software/Glamor/ glamor 2D acceleration].
  
 
Xserver usually have a good compatibility, but the performance may be little less and its size is more large than other display system.
 
Xserver usually have a good compatibility, but the performance may be little less and its size is more large than other display system.
Line 24: Line 20:
 
Gstreamer X11 sink have DRM 4k-Video render support(though hacky).
 
Gstreamer X11 sink have DRM 4k-Video render support(though hacky).
  
==== Graphics with Wayland ====
+
=== Structure ===
 +
 
 +
X11 structure in Linux OS
 +
 
 +
[[File:Xserver gpu.png|RTENOTITLE]]
 +
 
 +
=== DDX(armsoc) ===
 +
 
 +
source code: git clone git@github.com:markyzq/xf86-video-armsoc.git<br/> maliline: [git://anongit.freedesktop.org/xorg/driver/xf86-video-armsoc git://anongit.freedesktop.org/xorg/driver/xf86-video-armsoc]<br/> The DDX support:
 +
 
 +
#support common x11 display and Hwcursor
 +
#DRI2 (request by EGL X11 client)
 +
#umplock(support non-tearing on EGL x11 client)
 +
 
 +
'''''/etc/X11/xorg.conf'':''' Xserver will parse this config to find DDX and configure info
 +
<pre>Section "Device"
 +
Identifier  "Mali-Fbdev"
 +
Driver "armsoc"
 +
Option          "UMP_LOCK"  "true"
 +
EndSection
 +
Section "Screen"
 +
Identifier  "Default Screen"
 +
Device      "Mali-Fbdev"
 +
DefaultDepth 24
 +
EndSection</pre>
 +
 
 +
=== UMPLOCK ===
 +
 
 +
source code: wget [http://malideveloper.arm.com/downloads/drivers/DX910/r6p1-01rel0/DX910-SW-99002-r6p1-01rel0.tgz http://malideveloper.arm.com/downloads/drivers/DX910/r6p1-01rel0/DX910-SW-99002-r6p1-01rel0.tgz]<br/> Patch the umplock patch to kernel, then you can find the umplock device node:
 +
<pre>/dev/umplock</pre>
 +
 
 +
Don't forget enable DDX umplock option:
 +
<pre>Option          "UMP_LOCK"  "true"</pre>
 +
 
 +
The umplock only use for x11 graphic stack, no need for wayland, because mali&nbsp;<br/> already do the wayland sync on its driver.
 +
 
 +
&nbsp;
 +
 
 +
=== DDX(modesetting) ===
 +
 
 +
See [https://www.x.org/wiki/ModeSetting/ ModeSetting ]for detail introduce.
 +
 
 +
&nbsp;
 +
 
 +
=== X11 performance test ===
 +
 
 +
2D performace:
 +
<pre>x11perf</pre>
 +
 
 +
3D preformace:
 +
<pre>glmark2-es2</pre>
 +
 
 +
X11perf tools can easy get from x11-apps.<br/> glmark2-es2 can get from [https://github.com/glmark2/glmark2 https://github.com/glmark2/glmark2]<br/> The glmark2-es2 source code can also build for x11, drm(gbm) and wayland.
 +
 
 +
== Graphics with Wayland ==
  
 
Weston is the reference implementation of a Wayland compositor, and a<br/> useful compositor in its own right.
 
Weston is the reference implementation of a Wayland compositor, and a<br/> useful compositor in its own right.
  
Rockchip don't do much develop in wayland at current, but wetson are tested that can run in rk3288 and rk3399.
+
=== Structure ===
 +
 
 +
[[File:Wayland.png|RTENOTITLE]]
 +
 
 +
=== Weston ===
 +
 
 +
The Weston reference implementation of a Wayland compositor.
 +
 
 +
&nbsp; &nbsp; &nbsp;1. run wayland with drm and gpu renderer
 +
<pre style="margin-left: 40px;">export XDG_RUNTIME_DIR=/tmp
 +
weston --backend=drm-backend.so --idle-time=100 </pre>
 +
 
 +
&nbsp; &nbsp; &nbsp; 2. run wayland with drm and cpu renderer
 +
<pre style="margin-left: 40px;">weston --backend=drm-backend.so --idle-time=100 --use-pixman</pre>
 +
<blockquote>
 +
--idle-time: how many seconds the weston got to sleep, it's usefull to test wayland&nbsp;<br/> suspend and resume.<br/> --use-pixman: it's usefull to compare gpu or non-gpu performance and behavior.
 +
</blockquote>
 +
=== Wayland performance test ===
  
==== Graphics with None ====
+
3D preformance: &nbsp;''glmark2-es2-wayland''<br/> glmark2-es2 can get from [https://github.com/glmark2/glmark2 https://github.com/glmark2/glmark2]
 +
 
 +
<br/> OpenVG test: ''vg_api_tests''<br/> build from mali DDK, build with make bin/vg_api_tests
 +
 
 +
&nbsp;
 +
 
 +
 
 +
== Graphics with None ==
  
 
If you don't want to use X11 or wayland, there are some chooses for you.
 
If you don't want to use X11 or wayland, there are some chooses for you.
  
Interface:<br/> Libdrm and libmali-gbm can be used to draw UI without display systems.
+
Interface:<br/> libdrm and libmali-gbm can be used to draw UI without display systems.
 +
 
 +
Framework:<br/> [[Qt|QT]]&nbsp;can work without x11 or wayland. Qt5 applications could be run on top of EGL(libmali-gbm).
 +
 
 +
== MALI GPU driver ==
 +
 
 +
=== Structure ===
 +
 
 +
[[File:Mali gpu.png|RTENOTITLE]]
 +
 
 +
== Mali Build option ==
 +
 
 +
Build for X11:<br/> VARIANT=mali450-gles20-eb-linux-sse-vg-x11-dma_buf<br/> Build for Wayland:<br/> VARIANT=mali450-gles20-eb-vg-sse-linux-wayland-drm-dma_buf<br/> X11 stack only use gpu x11 backend,&nbsp;<br/> Wayland use two gpu backend, drm(gbm) and wayland
 +
<blockquote>
 +
-x11-: x11 backend<br/> -drm-: GBM backend<br/> -wayland: wayland backend<br/> -sse-: similar with neon, Accelerate memcpy on mali, speed up some api like&nbsp;<br/> glTexSubImage2D<br/> -vg-: openVG support, tested with vg_api_tests on wayland backend<br/> -dma_buf-: support dma_buf
 +
</blockquote>
 +
== LibDRM ==
 +
 
 +
=== Structure ===
 +
 
 +
[[File:DRM.png|RTENOTITLE]]
 +
 
 +
=== Source code ===
  
Framework:<br/> [http://rockchip.wikidot.com/yocto-user-guide-qt QT]&nbsp;can work without x11 or wayland, it run Qt5 applications on top of EGL(libmali-gbm).<br/> WIth qt eglfs, video player can reach 1080-60fps.
+
mainline source code: git clone [git://anongit.freedesktop.org/mesa/drm git://anongit.freedesktop.org/mesa/drm]<br/> LIBDRM is the cross-driver middleware which allows user-space applications (such&nbsp;<br/> as Mesa and 2D drivers) to communicate with the Kernel by the means of the DRI&nbsp;<br/> protocol.
  
= GPU Performance =
+
=== Mailing list ===
  
Test platform: rk3288
+
General developers discussions occur on the dri-devel@lists.freedesktop.org&nbsp;<br/> mailing list.<br/> Subscribe to the list at [http://lists.freedesktop.org/mailman/listinfo/dri-devel http://lists.freedesktop.org/mailman/listinfo/dri-devel].<br/> Archives are found at [http://lists.freedesktop.org/archives/dri-devel/ http://lists.freedesktop.org/archives/dri-devel/].
  
{|
+
= Kernel Driver porting =
|-
 
! backend
 
! off-screen
 
! on-screen
 
! DMA-Buf
 
|-
 
| X11
 
| &nbsp;
 
| &nbsp;
 
| support
 
|-
 
| Wayland
 
| &nbsp;
 
| &nbsp;
 
| support
 
|-
 
| gbm
 
| &nbsp;
 
| &nbsp;
 
| support
 
|-
 
| fbdev
 
| untested
 
| untested
 
| unsupport
 
|}
 
  
 
= Others =
 
= Others =

Latest revision as of 02:04, 12 October 2017


Graphics Introduce

This article will give an overview of how graphics are generated on a rockchip platform.

 

 

Graphics with X11

Xserver is the display system used on regular desktop Linux platforms.

Rockchip have a custom Xserver which have enable glamor 2D acceleration.

Xserver usually have a good compatibility, but the performance may be little less and its size is more large than other display system.

Gstreamer X11 sink have DRM 4k-Video render support(though hacky).

Structure

X11 structure in Linux OS

RTENOTITLE

DDX(armsoc)

source code: git clone git@github.com:markyzq/xf86-video-armsoc.git
maliline: git://anongit.freedesktop.org/xorg/driver/xf86-video-armsoc
The DDX support:

  1. support common x11 display and Hwcursor
  2. DRI2 (request by EGL X11 client)
  3. umplock(support non-tearing on EGL x11 client)

/etc/X11/xorg.conf: Xserver will parse this config to find DDX and configure info

Section "Device"
Identifier  "Mali-Fbdev"
Driver "armsoc"
Option           "UMP_LOCK"   "true"
EndSection
Section "Screen"
Identifier   "Default Screen"
Device       "Mali-Fbdev"
DefaultDepth 24
EndSection

UMPLOCK

source code: wget http://malideveloper.arm.com/downloads/drivers/DX910/r6p1-01rel0/DX910-SW-99002-r6p1-01rel0.tgz
Patch the umplock patch to kernel, then you can find the umplock device node:

/dev/umplock

Don't forget enable DDX umplock option:

Option           "UMP_LOCK"   "true"

The umplock only use for x11 graphic stack, no need for wayland, because mali 
already do the wayland sync on its driver.

 

DDX(modesetting)

See ModeSetting for detail introduce.

 

X11 performance test

2D performace:

x11perf

3D preformace:

glmark2-es2

X11perf tools can easy get from x11-apps.
glmark2-es2 can get from https://github.com/glmark2/glmark2
The glmark2-es2 source code can also build for x11, drm(gbm) and wayland.

Graphics with Wayland

Weston is the reference implementation of a Wayland compositor, and a
useful compositor in its own right.

Structure

RTENOTITLE

Weston

The Weston reference implementation of a Wayland compositor.

     1. run wayland with drm and gpu renderer

export XDG_RUNTIME_DIR=/tmp
weston --backend=drm-backend.so --idle-time=100 

      2. run wayland with drm and cpu renderer

weston --backend=drm-backend.so --idle-time=100 --use-pixman

--idle-time: how many seconds the weston got to sleep, it's usefull to test wayland 
suspend and resume.
--use-pixman: it's usefull to compare gpu or non-gpu performance and behavior.

Wayland performance test

3D preformance:  glmark2-es2-wayland
glmark2-es2 can get from https://github.com/glmark2/glmark2


OpenVG test: vg_api_tests
build from mali DDK, build with make bin/vg_api_tests

 


Graphics with None

If you don't want to use X11 or wayland, there are some chooses for you.

Interface:
libdrm and libmali-gbm can be used to draw UI without display systems.

Framework:
QT can work without x11 or wayland. Qt5 applications could be run on top of EGL(libmali-gbm).

MALI GPU driver

Structure

RTENOTITLE

Mali Build option

Build for X11:
VARIANT=mali450-gles20-eb-linux-sse-vg-x11-dma_buf
Build for Wayland:
VARIANT=mali450-gles20-eb-vg-sse-linux-wayland-drm-dma_buf
X11 stack only use gpu x11 backend, 
Wayland use two gpu backend, drm(gbm) and wayland

-x11-: x11 backend
-drm-: GBM backend
-wayland: wayland backend
-sse-: similar with neon, Accelerate memcpy on mali, speed up some api like 
glTexSubImage2D
-vg-: openVG support, tested with vg_api_tests on wayland backend
-dma_buf-: support dma_buf

LibDRM

Structure

RTENOTITLE

Source code

mainline source code: git clone git://anongit.freedesktop.org/mesa/drm
LIBDRM is the cross-driver middleware which allows user-space applications (such 
as Mesa and 2D drivers) to communicate with the Kernel by the means of the DRI 
protocol.

Mailing list

General developers discussions occur on the dri-devel@lists.freedesktop.org 
mailing list.
Subscribe to the list at http://lists.freedesktop.org/mailman/listinfo/dri-devel.
Archives are found at http://lists.freedesktop.org/archives/dri-devel/.

Kernel Driver porting

Others

For details of the full Linux graphics stack, please refer to online documents in FreedesktopARMArch wiki…..