Skip to content

Shao-Feng/kmscube

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kmscube

This application is updated for Android based on kmscube. kmscube is a little demonstration program for how to drive bare metal graphics without a compositor like X11, wayland or similar, using DRM/KMS (kernel mode setting), GBM (graphics buffer manager) and EGL for rendering content using OpenGL or OpenGL ES.

The upstream of kmscube is available at https://gitlab.freedesktop.org/mesa/kmscube/

Build on Android

Dependency

Dependent on libminigbm, libhwcservice, and libkmscubewrapper. minigbm is not built by default in Android repo (only gralloc will be built).

Build minigbm manually

By default, only gralloc is built in Android repo tree. For building libminigbm,

apply the patch '0001-Build-libminigbm.so-for-compiling-kmscube.patch' in minigbm-intel https://github.com/intel/minigbm

cd <Minigbm_HOME>

git am <KMS_CUBE_HOME>/0001-Build-libminigbm.so-for-compiling-kmscube.patch

Once minigbm is built successfully.

Push the 'libminigbm.so' file on the device as below

adb root

adb remount

cd <ANDROID_OUT_PRODUCT_HOME>/vendor/lib64/hw/

adb push libminigbm.so /vendor/lib64/

adb push ../../lib/hw/libminigbm.so /vendor/lib/

adb reboot

Clone kmscube in HWC tests

cd <HWC_PATH>/tests git clone https://github.com/Shao-Feng/kmscube.git

Build kmscube with Dependency

libkmscubewrapper is a wrapper for invoking and connecting Android "binder" (C++) from kmscube (C).

libhwcservice provide the API for syncing DRM commit with HWC.

For building kmscube, libkmscubewrapper and libhwcservice add 2 line in the bottom of <HWC_PATH>/Android.mk as below

""" include $(HWC_PATH)/tests/kmscube/wrap/Android.mk include $(HWC_PATH)/tests/kmscube/Android.mk

endif """

After building, push the corresponding '.so' file to device

adb root

adb remount

cd <ANDROID_OUT_PRODUCT_HOME>/vendor/lib64/

adb push libkmscubewrapper.so /vendor/lib64/

adb push ../lib/libkmscubewrapper.so /vendor/lib/

adb push libhwcservice.so /vendor/lib64/

adb push ../lib/libhwcservice.so /vendor/lib/

adb push hw/hwcomposer.broxton.so /vendor/lib64/hw/

adb push ../lib/hw/hwcomposer.broxton.so /vendor/lib/hw/

adb push ../bin/kmscube /vendor/bin/

Launch kmscube

This demo must be launched as root.

(Celadon only begin)

On Celadon, need to create hwc lock.

adb root

adb remount

adb shell touch /vendor/hwc.lock

(Celadon only end)

adb root

adb shell

/vendor/bin/kmscube

Releases

No releases published

Packages

No packages published

Languages

  • C 99.9%
  • Other 0.1%