HWComposer using DRM/KMS

Disclaimer: Work in progress

libdrm for Android

Since version 2.4.58 libdrm include Android makefile so you can add libdrm to AOSP by cloning it in external directory

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

Gralloc with dmabuf support

You need a gralloc adapted to your GPU but also able to use dmabuf file descriptor to exchange the buffers. This version of gralloc is aligned with MALI version r4p1-01rel0 and use DRM dumb for buffer allocation.

This should replace the default gralloc implementation in hardware/libhardware/modules/gralloc directory.

git clone git://git.linaro.org/people/benjamin.gaignard/gralloc.git

HWComposer for DRM/KMS

This version of HWComposer use DRM has backend and prototype some features:

- drm planes are used for overlay support.

- Android fence synchronization.

- multi display.

This should replace the default hwcomposer implementation in hardware/libhardware/modules/hwcomposer directory


Gralloc API

In gralloc-priv.h file private_handle_t is the structure used to provide the fields needed by Mali stack and HWComposer to work with gralloc.

When the private handle is marked with PRIV_FLAGS_USES_ION flag Mali stack use share_fd, which is a dma-buf file descriptor, field to get access to the buffer.

When HWComposer initialize the display and open DRM driver, the corresponding file descriptor is provided to gralloc in private_module_t structure drm_fd field.

When allocating a new buffer gralloc file private_handle_t->drm_hnd (https://git.linaro.org/people/benjamin.gaignard/gralloc.git/blob/HEAD:/alloc_device.cpp#l98) which will be used later by HWComposer to set the crtc (https://git.linaro.org/people/benjamin.gaignard/hwcomposer.git/blob/HEAD:/hwcomposer.cpp#l259)

BenjaminGaignard/HWComposer_DRM (last modified 2014-11-29 09:34:20)