RetroArch/README-mali_fbdev_r4p0.md
Francisco José García García 51922ea5be Squashed 'deps/vitaGL/' changes from c816fec50f..2934af8af0
2934af8af0 Added Patreon sponsor link.
c8f18b6f0f Getting current program only when required for vglDrawObjects.
4c5d136b0d Added directive to enable vitaShaRK usage from cmd.
4a10df3be5 Minor adjustments and bugfixes.
14a0124acf Added GL_TEXTURE_LOD_BIAS support.
40c8c6205e Added GL_NONE def and fixed glUniform4f impl.
868079c51e Added glUniform4f implementation.
0a682cbad2 Typo fix.
be3ce61ae7 Added GL_DEPTH_BITS and GL_STENCIL_BITS support.
21e6d1d330 Added runtime shader compiler support.
696e40bc62 Beautify error handler code.
537b37b110 Added glUniform3fv implementation.
7dd1403015 Fixed GLenum size and added missing types defines.
0c75f27ff1 Moved to NEON optimized memcpy usage.
98951895de Added gluPerspective implementation.
23e0b0b309 Fix for vglInitExtended not working on sys app mode.
4989c33ef5 Run clang-format.
429f1c1d8a Added system mode support.
9231680d02 Initializing sceGxm before free mem checking on vglInitExtended.
091e5e7882 Added vglInitWithCustomSizes.
f4c646ea78 Added vglSetParamBufferSize.
1b9a063c41 Beautify some code.
089e81efc5 Fix for duplicated symbols
789dcbf812 Typo fix in readRGBA4444.
1514a4b2cb Disabling lto due to it being broken on vitasdk with gcc 9.1.
fca18d9ab7 Added support for RGBA4444 texture format.
d449f12808 Added support for RGB565 texture format.

git-subtree-dir: deps/vitaGL
git-subtree-split: 2934af8af083a9acf598ab75233c518a251c6f0d
2020-07-05 11:43:47 +02:00

3.3 KiB

USAGE NOTES

This driver is meant for devices with Allwinner SoCs with Mali400 3D block and a good fbdev implementation. It is derived from the old Android GLES driver.

It was meant to be used on Cubieboard/Cubieboard2/Cubietruck, but it should not be used on an Odroid X2/U2/U3 where a superior solution (RetroArch exynos video driver) is available. Fbdev implementation on Odroid harware is missing WAITFORVSYNC ioctl, so use Exynos driver there.

This driver requires MALI r4p0 binary blobs for fbdev, and a kernel compatible with r4p0 binaries.

So we will use -This kernel : https://github.com/mireq/linux-sunxi -This small patch : https://gist.github.com/ssvb/8088519 -Files in this thread : http://forum.odroid.com/viewtopic.php?f=52&t=4956

First we will clone and build the kernel: git clone https://github.com/mireq/linux-sunxi.git -b sunxi-3.4 --depth 1

Now we edit drivers/video/sunxi/disp/dev_fb.c, and uncomment the line 1074: // Fb_wait_for_vsync(info);

It is assumed you have a cross-compiler installed, so we configure and build the kernel and modules:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun7i_defconfig

(This is for Cubieboard2, for other Sunxi boards look here: http://linux-sunxi.org/Linux_Kernel#Compilation)

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

(Just in case we want to customize kernel options. It is OK to build with default config)

make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=<path_to_rootfs_mountpoint> modules_install

cp arch/arm/boot/uImage /<path_to_sd_rootfs_mountpoint>/boot/

Now we should download and extract the EGL/GLES/GLES2 MALI FBDEV blobs from this thread:

http://forum.odroid.com/viewtopic.php?f=52&t=4956

This is the exact link:

http://builder.mdrjr.net/tools/r4p0-mp400-fbdev.tar

Copy these libraries to /usr/lib.

Now we need the headers. We can get them from here:

http://malideveloper.arm.com/develop-for-mali/sdks/opengl-es-sdk-for-linux/#opengl-es-sdk-for-linux-download

Download whatever version you want. We just get the headers from here, not machine-dependant compiled code.

Extract the files and copy the directories inside inc to /usr/include .

Also, copy simple_framework/inc/mali/EGL/fbdev_window.h to /usr/include/EGL .

In the end you should have this on your system:

/usr/include/EGL/ eglext.h egl.h eglplatform.h fbdev_window.h /usr/include/GLES/ glext.h gl.h glplatform.h /usr/include/GLES2 gl2ext.h gl2.h gl2platform.h /usr/include/GLES3 gl3ext.h gl3.h gl3platform.h

To enable mali_fbdev you must configure RetroArch with --enable-gles and --enable-mali_fbdev.

This is an example of what you would use on a CubieBoard2 for a lightweight RetroArch:

./configure --enable-gles --enable-mali_fbdev --disable-x11 --disable-sdl2 --enable-floathard --disable-ffmpeg --disable-netplay --enable-udev --disable-sdl --disable-pulse --disable-oss --disable-freetype --disable-7zip

NOTE: A TTY hack is used to auto-clean the console on exit, and the fbdev ioctls are used to retrieve current video mode. Both things work good, but they are not exactly ideal solutions.

If you come up with something better, feel free to improve the driver.