Platform/GFX/hwcomposer: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
= What is Hardware Composer? =
= What is Hardware Composer? =
* HWComposer
* HWComposer
**Android Hardware composer HAL([https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/hwcomposer.h 1]) is a abstract 2D composer library and could help to offload GPU resource for screen composition. Based on HWC HAL, chipset vendor(like Qcom, nVidia) could implement their own 2D composer library to integrate with platform's 2D HW composer.
 
**Android Hardware composer HAL([https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/hwcomposer.h 1]) is an abstract 2D composer library that can help to offload GPU resource for screen composition. Based on HWC HAL, chipset vendor(like Qcom, nVidia) can implement their own 2D composer library to integrate with platform's 2D HW composer.
Think of hardware composer as a fast-path for the compositor, that is limited but provides better performance and battery consumption characteristics.
 
** Different chipset vendor could have different 2D HW componment
** Different chipset vendor could have different 2D HW componment
***Qcom supports copybit and overlay, nVidia support overlay, Mali(reuse 2D core from GPU TODO)
***Qcom supports copybit and overlay, nVidia support overlay, Mali(reuse 2D core from GPU TODO)
Line 8: Line 11:


* HWComposer Requirement
* HWComposer Requirement
** Scale
** Scaling: HWC does not support scaling (at least in its current form)
** Axis Aligned Rotate (0, 90, 180, 270)
** Axis Aligned Rotate (0, 90, 180, 270)
** Flip_V/Flip_H
** Flip_V/Flip_H
** RGB/YUV content
** RGB/YUV content
** Layer number: HWC can only composite a limited amount of layers depending on the hardware:
*** TODO: per device numbers?
Each time we composite, we first go through the layer tree, see if we can use HWComposer and fallback to the Compositor API (OpenGL based on Firefox OS) if we can't use it.


Links to relevent files: TODO
Links to relevent files: TODO
Line 22: Line 29:
**Chipset vendors could use simple HW layout to fullfill the needs of HWComposer, compared to GPU complex layout. Therefore, HWComposer could have the following benefits.
**Chipset vendors could use simple HW layout to fullfill the needs of HWComposer, compared to GPU complex layout. Therefore, HWComposer could have the following benefits.
*Offer all GPU resource for application
*Offer all GPU resource for application
** offload GPU task for screen composition
** Offload GPU task for screen composition


*Memory bandwidth for write(TODO)
*Memory bandwidth for write(TODO)
Line 28: Line 35:
** No need to write back composition result to framebuffer
** No need to write back composition result to framebuffer


== What are the limitations HWComposer? ==
== When do we expect to be using HWComposer ==


*Layer number: HWC can only composite a limited amount of layers depending on the hardware:
Full-screen video playback is the place where we really want to be using HWComposer, because of battery usage. If something makes us not use HWComposer there, it should be considered as a bug.
TODO: per device numbers?
Currently the home screen when idle is using HWComposer, but it is not a hard requirement.
*Scaling: HWC does not support scaling (at least in its current form)


== Buffer Synchronization ==
== Buffer Synchronization ==
Confirmed users
137

edits