An analysis of Android HWC "turn"

Source: Internet
Author: User

39290109

Note: This document is analyzed based on KK and focuses on the precise definition of concepts and the evolution of version history

First, about the introduction of HWC

Broadly speaking refers to the use of hardware to complete the image data combination and display the function (ability), in a narrow sense refers to Hwcomposer HAL.


1, from a broad perspective to analyze, there are several concepts need to be precisely defined (note the letter case difference)

(1) HWC: Using hardware to complete the image data combination and display the function (ability), specific to the code level it is a multi-class such as Surfaceflinger, Hwcomposer, Displaydevice and other collaborative completion of a function (ability).
(2) Hwcomposer: Hardware composition abstraction layer, between Surfaceflinger and Hal, specific to the code level is a class that encapsulates the use of Hwcomposer Hal and Gralloc HAL. According to the official introduction, Hwcomposer HAL has 1.0, 1.1, 1.2, 1.3 and many other versions, when the version is 1.1 and later, Hwcomposer no longer need to use the Gralloc HAL.
(3) Hwcomposer: Specific to the code level is Hwcomposer HAL
(4) HW Composer: specific to the platform hardware level is composer hardware, such as be.


2, from a narrow perspective to analyze,

Hwcomposer HAL is introduced from Honeycomb (3.0), replacing the 2.3 overlay implementation (but not required) to reduce code implementation and maintenance difficulties. Its implementation version experienced 1.0 to 1.3 evolution, in the Jellybean MR1 (4.2) Implementation of the 1.1 version, the introduction of the hardware Composition Abstraction Layer (Hwcomposer) concept, up to surfaceflinger completely hides the platform display hardware features, The working methods are also modified to the following official description:
(1) Surfaceflinger provides the HWC with a full list of layers, and asks, ' How does you want to handle this? '
Surfaceflinger provides all soft layer information to hwcomposer and asks how it is handled
(2) The HWC responds by marking each layer as "overlay" or "GLES composition"
Hwcomposer depending on hardware performance, whether to use hardware layer synthesizers or GPU compositing
(3) Surfaceflinger takes care of no GLES composition, passing the output buffer to HWC, and lets HWC handle the rest
Surfaceflinger handles soft layers that require GPU compositing and submits the results to Hwcomposer for display (via Hwcomposer HAL), soft layers that require a hardware layer synthesizer to be processed by the Hwcomposer itself (via Hwcomposer HAL)
Analysis: The benefit of this design is the ability to give full play to hardware performance while reducing the coupling of surfaceflinger and hardware platforms (portability)

3. The approximate evolution of Hwcomposer HAL

(1) pre-1.1
Only one display is supported
(2) 1.1 (EXAMPLE:EXYNOS5)
No need for Gralloc HAL
Support multiple Display
Support HotPlug
Increase Hwc_framebuffer_target Synthesis type
(3) 1.2 (example:msm8960, msm8x26)
Support for Alpha operations (Setplanealpha), previously done by the GPU
(4) 1.3 (example:msm8974)
Support for virtual display layer compositing, previously done by the GPU
Support Crop (cropping)


4, terminal display support

Starting from Jellybean (4.2) Support multi-screen, screen type:
Primary display: The device comes with a screen that is managed by Surfaceflinger
External Display: Via HDMI connection, monitored and managed by surfaceflinger
Virtual Display: This is new in 4.2 (such as mircast based on WiFi Direct technology), monitored and managed by displaymanagerservice. Virtual display can select all or part of the layer to synthesize, before KitKat, Hwcomposer can only manage primary display of the composition, Virtual display using gles to synthesize; from KitKat onwards, Hwcomposer can also participate in the synthesis of virtual display. Display data for Virtual display is also handled by Bufferqueue

5, HWC can complete the work

(1) Full-screen games in portrait and landscape mode
(2) Full-screen video with closed captioning and playback control
(3) The Home screen (compositing the status bar, System bar, application window, and live wallpapers)
(4) Protected Video Playback
(5) Multiple Display Support

Ii. references

http://source.anddroid.com/devices/graphics.htmlhttp://blog.csdn.net/jinzhuojun/article/details/17427491

Http://www.cnblogs.com/samchen2009/p/3364327.html

http://blog.csdn.net/brucexu1978/article/details/8976781



The Android graphics path, in Depth.pdf
Android Graphics and Android Egl.pdf

An analysis of Android HWC "turn"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.