Skip to content

Freedreno over Android x86

Rob Clark edited this page Aug 28, 2015 · 10 revisions

Android-x86 on IFC6410 with drm_gralloc + freedreno Build Steps

Prep

Distro Config

The android build uses a prebuilt i686 toolchain. But it depends on some i686 base libs to be installed:

Fedora

sudo dnf install libstdc++.i686 libgcc.i686 zlib.i686 glibc.i686

Get sources

  1. Install repo.

  2. Get the source. Shallow syncing to save space (full source >30G):

    mkdir android-x86
    cd android-x86
    repo init --depth=1 -u http://git.android-x86.org/manifest -b kitkat-x86 -g default,arm,pdk,-darwin
    repo sync -j16
    
  3. git clone https://github.com/varadgautam/qualcomm-android-init.git

  4. git clone https://github.com/varadgautam/mesa.git

  5. git clone https://github.com/varadgautam/drm_gralloc.git

  6. git clone http://anongit.freedesktop.org/git/mesa/drm.git

  7. edit qualcomm-android-init/local_manifests/ms.xml to point to cloned mesa, drm_gralloc and drm, move local_manifests to android-x86/.repo

  8. repo sync again to get mesa, drm_gralloc and drm under android-x86 directory

  9. clone integration-linux-qcomlt (4.2; 5a8a0b0 tested)

Patch sources

  1. apply qualcomm-android-init/kernel-* over kernel to disable GPU auth and get logger.
  2. apply qualcomm-android-init/kitkat-x86-hacks-ifc6410.patch to android-x86 (use this)
  3. apply qualcomm-android-init/libpixelflinger* to android-x86/system/core

Build

Kernel

  1. make kernel + dtb. toolchain comes with android-x86.
    cd kernel
    make ARCH=arm CROSS_COMPILE=~/devel/android-x86/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- qcom_defconfig
    make ARCH=arm CROSS_COMPILE=~/devel/android-x86/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- -j16 zImage dtbs
    cat arch/arm/boot/zImage arch/arm/boot/dts/qcom-apq8064-ifc6410.dtb > zImage-dtb

(NOTE: replace ~/devel/android-x86 with path to your android-x86 checkout)

Android-x86.

takes time (~8h for me).

    export USE_CCACHE=1
    cd android-x86
    source build/envsetup.sh
    lunch mini_armv7a_neon-userdebug
    make -j8 TARGET_PREBUILT_KERNEL=<path-to-zImage-dtb> BOARD_GPU_DRIVERS=freedreno
    make -j8 TARGET_PREBUILT_KERNEL=<path-to-zImage-dtb> BOARD_GPU_DRIVERS=freedreno libGLES_mesa gralloc.drm

Prepare images

boot.img

mv qualcomm-android-init/init* android-x86/out/target/product/armv7-a-neon/root
mv qualcomm-android-init/fstab* android-x86/out/target/product/armv7-a-neon/root

make initrd:

TODO: android init seems picky about file permisions (with good reason).. you might need to fix things up so that *.prop and *.rc have permissions 0644.

cd android-x86/out/target/product/armv7-a-neon/root
find . | cpio -o -H newc | gzip > ../qcom-ramdisk.img

from android-x86/out/target/product/armv7-a-neon/, run

abootimg --create qcom-boot.img -k <zImage-dtb> -r qcom-ramdisk.img -f <qualcomm-android-init/bootimg.cfg>

This creates qcom-boot.img

system_ext4.img

TODO: gralloc.drm.so ends up in /system/lib but needs to be moved to /system/lib/hw

call qualcomm-android-init/mksystem.sh from android-x86/out/target/product/armv7-a-neon/

Flash images

Boot IFC6410 into fastboot mode by holding SW4 during power up.

fastboot flash boot qcom-boot.img
fastboot flash system system_ext4.img

Reboot with a UART cable attached to get serial console.