On 20/03/15 02:55, Vishal Bhoj wrote:


On 11 March 2015 at 08:32, Scott Bambrough <scott.bambrough@linaro.org> wrote:
ANDROID
---------------------------------
HiSilicon has provided the following files to Linaro for Android:

android/32bit: gralloc.hi6210sft.so, libGLES_mali.so, libion.so
android/64bit: gralloc.hi6210sft.so, libGLES_mali.so, libion.so

The library "libion.so" is needed for Android L. HiSilicon has some vendor specific interfaces in "gralloc.hi6210sft.so", and the provided implementation of "libion.so" will use those interfaces.

/media/scottb/linaro/hikey/android/device/linaro/hikey/device.mk
Need to add a appropriate PRODUCT_COPY_FILES macro to this makefile.

#Copy Graphics binaries
PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\
$(LOCAL_PATH)/mali/64bit/libGLES_mali.so:system/lib64/egl/libGLES_mali.so\
$(LOCAL_PATH)/mali/64bit/gralloc.hi6210sft.so:system/lib64/gralloc.hi6210sft.so\
$(LOCAL_PATH)/mali/64bit/libion.so:system/lib64/libion.so \
$(LOCAL_PATH)/mali/32bit/libGLES_mali.so:system/lib/egl/libGLES_mali.so \
$(LOCAL_PATH)/mali/32bit/gralloc.hi6210sft.so:system/lib/gralloc.hi6210sft.so \
$(LOCAL_PATH)/mali/32bit/libion.so:system/lib/libion.so)

I suspect a set of symlinks like those described for X below are required in /system/lib64 and /system/lib.  Not entirely sure how to get these setup.
Although /system/{lib,lib64}/egl/libGLES_mali.so might work, Mali user-side drivers are usually in these places on Android:
/system/vendor/lib/egl/libGLES_mali.so
/system/vendor/lib64/egl/libGLES_mali.so

They get directly loaded when zygote starts and logcat should show something like this (taken from AOSP 5.0 on Nexus 10):

D/libEGL  ( 2511): loaded /vendor/lib/egl/libGLES_mali.so
I/OpenGLRenderer( 2632): Initialized EGL, version 1.4

So I don't think there needs to be any symlink for these drivers in Android.

To do:
  1. Obtain MALI kernel GPU driver from Guillaume Tucker.
I see a hikey-mali branch with the Mali driver. Will the same driver work with Android without any changes ?
The driver in drivers/gpu/arm/utgard works both for Linux and Android, and the mali_hikey.c file only has one function specific to Android to set up the ION shared display buffer.  It was copied as-is from the 3.10 kernel and I haven't tested it.

BTW the GPU kernel driver is now both in hikey-mali and hikey-release.
  1. Obtain kernel ION driver from HiSilicon
 What is the status with this one ?

LINUX/X11
---------------------------------

HiSilicon has provided the following files to Linaro for Linux/X11:

x11/32bit: none
x11/64bit: libMali.so (untested)

To install the 64bit library (libMali.so)
  1. Create the file /etc/ld.so.conf.d/arm64-linux-gnu_EGL.conf.  This file should contain the single line: /usr/lib/arm64-linux-gnu/mali-egl
  2. Install libMali.so to /usr/lib/arm64-linux-gnu/mali-egl, root:root, 644
  3. Create the following symlinks in /usr/lib/arm64-linux-gnu/mali-egl
    • libEGL.so -> libEGL.so.1.0.0
    • libEGL.so.1 -> libEGL.so.1.4
    • libEGL.so.1.4 -> libMali.so
    • libGLESv1_CM.so -> libGLESv1_CM.so.1
    • libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.1.0
    • libGLESv1_CM.so.1.1.0 -> libMali.so
    • libGLESv2.so -> libGLESv2.so.2.0.0
    • libGLESv2.so.2 -> libGLESv2.so.2.0.0
    • libGLESv2.so.2.0.0 -> libMali.so
  4. Install an xf86 driver for X.org that will work with the frame buffer.
We currently cannot support multiarch for ARM 32-bit code, as we will be able to in Android.  For that we need  a 32bit driver for Linux/X11 from HiSilicon.
Regarding this, what are the plans to support multilib in the Debian 8 builds?  So far it has been 64-bit only as far as I can tell.  I have a 32-bit ARMv7 binary fbdev driver that could be published if I had a system to test it on.

To install a 32bit library (libMali.so)
  1. Create the file /etc/ld.so.conf.d/arm-linux-gnu_EGL.conf.  This file should contain the single line: /usr/lib/arm-linux-gnu/mali-egl
  2. Install libMali.so to /usr/lib/arm-linux-gnu/mali-egl, root:root, 644
  3. Create the following symlinks in /usr/lib/arm64-linux-gnu/mali-egl
    • libEGL.so -> libEGL.so.1.0.0
    • libEGL.so.1 -> libEGL.so.1.4
    • libEGL.so.1.4 -> libMali.so
    • libGLESv1_CM.so -> libGLESv1_CM.so.1
    • libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.1.0
    • libGLESv1_CM.so.1.1.0 -> libMali.so
    • libGLESv2.so -> libGLESv2.so.2.0.0
    • libGLESv2.so.2 -> libGLESv2.so.2.0.0
    • libGLESv2.so.2.0.0 -> libMali.so

To do:

  1. Obtain MALI kernel GPU driver from Guillaume Tucker.
I've already provided the Mali kernel GPU driver that deals with the GPU device, it enables fbdev on Linux and as far as I know there's nothing else to be done to support X11 in this driver.  However some kernel work remains to be done in order to support DRM as described in 2.
  1. Obtain 32bit libMali.so for Linux/X11 from HiSilicon.
  2. DRM kernel display driver.
    • To implement and test X11 needed ioctl interfaces.
    • To integrate some mali private ioctl interfaces, such as dma_buf fb.
  3. DRM userspace work.  Need a DRM enabled xf86 driver for X.org. 
Any progress or issues found on this side?
  1. Fathi to package the Mali libs and create the symlinks required on installation.

If I have missed anything or got anything wrong, please feel free to provide additions/corrections.

Regards,

Scott

--
Scott Bambrough
Technical Director, Member Services
Linaro





-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782