最近手头有一块firefly_rk3288_reload的开发板,想实现在linux 下用openGL ES来做视频显示。

找到opengGL相关移植,参考论坛(http://bbs.t-firefly.com/forum.php?mod=viewthread&tid=321&extra=page%253D2)的方法,进行移植。

方法:

Test OpenGL ES Linux support on Firefly-RK3288 Development Board
════════════════════════════════════════════════════════════════

Introduction
────────────

Firefly-RK3288 development board is equipped with the powerful Mali
T764 GPU. Lately, ARM has released the binary user-space fbdev
driver. We, the Firefly team, have taken a first stab at it.

Environment:
- Firefly-RK3288 development board with latest dual boot firmware
installed.
- 64 bit Ubuntu Linux (12.04 or later) host pc.

Kernel
──────

First, we need to update the mali kernel driver.

Download Linux kernel driver TX041-SW-99002-r5p1-00rel0.tgz in
[http://malideveloper.arm.com/develop-for-mali/drivers/open-source-mali-t6xx-gpu-kernel-device-drivers/]
(note:这个是arm官方针对这款gpu驱动发布的官方驱动)

The porting process involves: replace the old driver files with new
ones, apply the kds patch, fix the compiling errors and update the
config file.

To make life easier, we've packaged all the files into
firefly-mali-driver-TX011-SW-99002-r5p1-00rel0.tar.gz .
(note:实际上我们只需要下载firefly-mali-driver-TX011-SW-99002-r5p1-00rel0.tar.gz 这个驱动文件就可以了。)

╭────
│ cd /path/to/your/firefly/sdk
│ ls kernel  # kernel directory should be here
│ tar xzf /path/to/firefly-mali-driver-TX011-SW-99002-r5p1-00rel0.tar.gz
╰────

Then compile it:
╭────
│ cd kernel
│ make firefly-rk3288-linux_defconfig
│ make -j8 firefly-rk3288.img
│ make modules
╰────

(note:上面这步的时候,需要自己重新配置一下kernel,不能使用默认的驱动配置,否则会出现两种情况:

  1)  undefined reference to `kds_waitall'

    添加CONFIG_DMA_SHARED_BUFFER关联选项就OK

  2) 在openGL sdk demo运行的时候出现:

    Error: eglGetError(): 12289 (0x3001)

    Error: Failed to initialize EGL at ../../../../samples/opengles_30/skybox/EGLRuntime.cpp:243

  同时内核会打印:

    :Platform data not specified

  查看kernel源码,找到相应配置,添加:MALI_PLATFORM_FAKE 配置。

)

The compiled mali module is located at drivers/gpu/arm/midgard/. Copy
mali_kbase.ko to your board:
╭────
│ scp drivers/gpu/arm/midgard/mali_kbase.ko root@BOARD_IP:/system/lib/modules/
╰────

(Why `/system/lib/modules/' ? Just because /etc/rc.local willl insmod
it automatically.)

Then follow the steps described in
[http://wiki.t-firefly.com/index.php/Firefly-RK3288/Build_kernel/en] ,
to pack zImage and initrd to linux-boot.img .

Flash linux-boot.img to recovery partition of the board.

User-space drivers
──────────────────

Download mali-t76x_r5p0-06rel0_linux_1+fbdev.tar.gz in:
[http://malideveloper.arm.com/develop-for-mali/features/mali-t6xx-gpu-user-space-drivers/]

Then install it to the board:
╭────
│ cat /path/to/mali-t76x_r5p0-06rel0_linux_1+fbdev.tar.gz \
│    | ssh root@BOARD_IP tar --strip-components=1 -xzf - -C /usr/lib
╰────

Compile Mali OpenGL ES SDK demos
────────────────────────────────

Download Mali_OpenGL_ES_SDK_v2.4.4.71fdbd_Linux_x64.tar.gz in
[http://malideveloper.arm.com/develop-for-mali/sdks/opengl-es-sdk-for-linux/]

Please choose Linux X64 archive.

To build the SDK demos, you need a cross compile toolchain. If you
have not installed yet, try this linaro toolchain:
[http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz]
(Extract it to /opt)

You also need to install cmake (sudo apt-get install cmake).

╭────
│ tar xzf /path/to/Mali_OpenGL_ES_SDK_v2.4.4.71fdbd_Linux_x64.tar.gz
│ cd Mali_OpenGL_ES_SDK_v2.4.4
│ mkdir build-arm
│ cd build-arm
│ export TOOLCHAIN_ROOT=/opt/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-
│ cmake -DTARGET=arm .. 
│ make install
│ cd ..
│ # bin_arm contains all the result files
│ scp -r bin_arm root@BOARD_IP:/root
╰────

Set 32bit framebuffer
─────────────────────

Before running demos, the fbdev should be in 32 bit mode.

Run following commands on the board:
╭────
│ sudo -s
│ cat << EOF >/etc/init/fbset.conf
│ # fbset - run fbset to set truecolor fbmo
│ description "run fbset before lightdm"
│ start on startup and started udev or starting lightdm
│ task
│ script
│     [ -x /bin/fbset ] && /bin/fbset -a -nonstd 1 -depth 32 -rgba "8/0,8/8,8/16,8/24"
│ end script
│ EOF
│ cat << EOF >/etc/X11/xorg.conf
│ Section "Screen"
│     Identifier "Default Screen"
│     DefaultDepth 24
│ EndSection
│ EOF
╰────

Then reboot the device.

Run demos
─────────

Before running demos, make sure you have:
1. Flashed the new Linux kernel.
2. Updated mali_kbase.ko
3. Installed Mali user drivers
4. Uploaded Mali demos
5. Configured 32bit framebuffer

Then open a terminal, run one of the demo:
╭────
│ sudo -i
│ cd bin_arm/opengles_30/skybox
│ ./skybox
╰────

Enjoy!

Video
──────

在设置32bit位深以后,输出的显示效果不好,花屏的问题,等我接下来解决了跟大家分享。

参考论坛:Mali kernel driver TX011-SW-99002-r5p1-00rel0 for firefly的更多相关文章

  1. VirtualBox,Kernel driver not installed (rc=-1908)

    http://hi.baidu.com/spt_form/item/316d6207b47b8ee03499020a VirtualBox,Kernel driver not installed (r ...

  2. CentOS VirtualBox启动虚拟及报错:VirtualBox error: Kernel driver not installed (rc=1908)

    VirtualBox error: Kernel driver not installed (rc=1908) Hi all, Let me first say that this is my fin ...

  3. Ubuntu 升级VisualBox后无法启动 Kernel driver not installed (rc=-1908)

    VisualBox之所以在Linux上比传统的VMware快得多,关键一点就是它和Linux内核的结合比较紧密,这也是开源的优点. 不过Linux内核更新很频繁,每次更新内核后启动VirtualBox ...

  4. virtualbox cannot access the kernel driver的解决办法

    一位网友windows xp sp3下安装virtualbox 4.1.20版本,安装好了重启过后,可以打开virtualbox,但是等到创建好虚拟电脑后按启动按钮,就出现了错误提示:"Ca ...

  5. Fedora安装VirtualBox时出现错误Kernel driver not installed (rc=-1908)的解决办法

    新建虚拟机后启动时出现如下错误: Kernel driver not installed (rc=-1908) The VirtualBox Linux kernel driver (vboxdrv) ...

  6. How To Upgrade ASMLib Kernel Driver as Part of Kernel Upgrade? (文档 ID 1391807.1)

    How To Upgrade ASMLib Kernel Driver as Part of Kernel Upgrade? (文档 ID 1391807.1)

  7. ubuntu中使用virtualbox遇到Kernel driver not installed (rc=-1908)错误

    百度之后得到解决,再此做个笔记 错误提示 Kernel driver not installed (rc=-1908) The VirtualBox Linux kernel driver (vbox ...

  8. Android Camera 通过V4L2与kernel driver的完整交互过程

    http://blog.chinaunix.net/uid-26215986-id-3552456.html 原文地址:Android Camera 通过V4L2与kernel driver的完整交互 ...

  9. Ubuntu 14 中 VirtualBox发生错误Kernel driver not installed (rc=-1908)

    宿主系统是Ubuntu 14,在VirtualBox中安装 CentOS 6.5 时,提示如下错误: Kernel driver not installed (rc=-1908) 网友提供的解决方案: ...

随机推荐

  1. 每日英语:Singles Day in China

    Singles Day in China is the celebration -- or mourning -- of being unattached. Started by students i ...

  2. Kafka 协议实现中的内存优化【转】

    Kafka 协议实现中的内存优化   Jusfr 原创,转载请注明来自博客园 Request 与 Response 的响应格式 Request 与 Response 都是以 长度+内容 形式描述, 见 ...

  3. ES6里新添加了两个很好用的东西,set和Array.from。

    set是一种新的数据结构,它可以接收一个数组或者是类数组对象,自动去重其中的重复项目. 在这我们可以看见,重复的项目已经被去掉了,包括NaN.正常情况下,NaN === NaN 返回的是false,但 ...

  4. audio音乐播放

    1.audio标签 <audio @play="ready" @error="error" ref="audio" :src=&quo ...

  5. 【Java】自动类型转换规则

    自动类型转换遵循下面的规则: 若参与运算的数据类型不同,则先转换成同一类型,然后进行运算. 转换按数据长度增加的方向进行,以保证精度不降低.例如int型和long型运算时,先把int量转成long型后 ...

  6. 在Jenkins上做一个定时闹钟

    [本文出自天外归云的博客园] 利用Jenkins定时任务来做一个闹钟,每天隔一段时间提醒自己一下“你该休息了!别老坐着!出去走一走!珍爱生命,远离久坐!” 首先在Jenkins上创建一个node. 创 ...

  7. 基于jQuery环形图标菜单旋转切换特效

    分享一款基于jQuery环形图标旋转切换特效.这是一款鼠标点击图标菜单圆形顺时针或者逆时针旋转切换代码.效果图如下: 在线预览   源码下载 实现的代码. js代码: /* 图片地址可以是相对路径或绝 ...

  8. ArrayList, Vector和CopyOnWriteArrayList对比学习

    ArrayList线程不安全的例子 线程安全就是多线程访问时,采用加锁机制,当一个线程访问该类的某个数据时,进行保护,其他线程不能进行访问直到该线程读取完,其他线程才可使用.不会出现数据不一致或者数据 ...

  9. shell脚本传递带有空格的参数的解决方法

    如下例子所示: #!/bin/sh dt= rdms_presql='select * from dm_general_stat where dimcode = "day" and ...

  10. vim 小技巧

    cd - 返回刚才访问的目录shift+# 在vi中查找相同的关键字vi 中o在当前游标位置后插入一行 O在当前位置前插入一行0 $到行未 行首shift+s 删除一行,并且进入insert mode ...