(一)、DRM/KMS for Android介绍

(1)、Pre-DRM world

Issues:

(2)、DRM world

Objectives:

(3)、Future

(二)、Android drm_hwcomposer介绍

(1)、Android Hardware Composer 2.0

What is Android’s Hardware Composer?
● Determines the most efficient way to composite buffers with the available
hardware
○ Overlay planes
○ GPU composition
○ Blit/2D engine
● Often device specific and written by the display hardware OEM

Hardware Composer 1.x

Key Differences between 1.x and 2.0

Increases API functions from 12 to 43
● Adds support for HDR, color transform matrix, dataspaces, etc.
● Renames prepare() / set() to validate() / present()
● Replaces speculative fences with non-speculative fences

Hardware Composer 1.x Sync Fences

Hardware Composer 2.0 Sync Fences

(2)、Android drm_hwcomposer

HWC1

HWC2

这里使用的就是HWC2。

(三)、Android drm_hwcomposer Code Overview



分析hwcomposer之前,先来分析gralloc。

(四)、gralloc代码分析

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Stack Trace:
RELADDR FUNCTION FILE:LINE
0000000000007bcc drm_gem_rockchip_alloc+164 hardware/rockchip/libgralloc/midgard/gralloc_drm_rockchip.cpp:1768
00000000000053d0 validate_handle(native_handle const*, gralloc_drm_t*)+344 hardware/rockchip/libgralloc/midgard/gralloc_drm.cpp:203
00000000000051f0 gralloc_drm_handle_register+40 hardware/rockchip/libgralloc/midgard/gralloc_drm.cpp:229
000000000000438c android::hardware::graphics::mapper::V2_0::passthrough::detail::Gralloc0HalImpl<android::hardware::graphics::mapper::V2_1::hal::MapperHal>::importBuffer(native_handle const*, native_handle**)+52 hardware/interfaces/graphics/mapper/2.0/utils/passthrough/include/mapper-passthrough/2.0/Gralloc0Hal.h:83
0000000000004a2c android::hardware::graphics::mapper::V2_0::hal::detail::MapperImpl<android::hardware::graphics::mapper::V2_1::IMapper, android::hardware::graphics::mapper::V2_1::hal::MapperHal>::importBuffer(android::hardware::hidl_handle const&, std::__1::function<void (android::hardware::graphics::mapper::V2_0::Error, void*)>)+100 hardware/interfaces/graphics/mapper/2.0/utils/hal/include/mapper-hal/2.0/Mapper.h:65
0000000000012824 android::hardware::graphics::mapper::V2_1::BsMapper::importBuffer(android::hardware::hidl_handle const&, std::__1::function<void (android::hardware::graphics::mapper::V2_0::Error, void*)>)+164 out/soong/.intermediates/hardware/interfaces/graphics/mapper/2.1/android.hardware.graphics.mapper@2.1_genc++_headers/gen/android/hardware/graphics/mapper/2.1/BsMapper.h:85
000000000001f84c android::Gralloc2Mapper::importBuffer(android::hardware::hidl_handle const&, native_handle const**) const+220 frameworks/native/libs/ui/Gralloc2.cpp:183
v--------------> operator()<android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> > frameworks/native/libs/ui/Gralloc2.cpp:453
v--------------> _ZNSt3__18__invokeIRZNK7android17Gralloc2Allocator8allocateEjjijmjPjPPK13native_handleE3$_7JNS1_8hardware8graphics6mapper4V2_05ErrorEjRKNSA_8hidl_vecINSA_11hidl_handleEEEEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSK_DpOSL_ external/libcxx/include/type_traits:4353
v--------------> void std::__1::__invoke_void_return_wrapper<void>::__call<android::Gralloc2Allocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, unsigned int, unsigned int*, native_handle const**) const::$_7&, android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&>(android::Gralloc2Allocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, unsigned int, unsigned int*, native_handle const**) const::$_7&, android::hardware::graphics::mapper::V2_0::Error&&, unsigned int&&, android::hardware::hidl_vec<android::hardware::hidl_handle> const&) external/libcxx/include/__functional_base:349
v--------------> std::__1::__function::__alloc_func<android::Gralloc2Allocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, unsigned int, unsigned int*, native_handle const**) const::$_7, std::__1::allocator<android::Gralloc2Allocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, unsigned int, unsigned int*, native_handle const**) const::$_7>, void (android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>::operator()(android::hardware::graphics::mapper::V2_0::Error&&, unsigned int&&, android::hardware::hidl_vec<android::hardware::hidl_handle> const&) external/libcxx/include/functional:1527
0000000000020b44 std::__1::__function::__func<android::Gralloc2Allocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, unsigned int, unsigned int*, native_handle const**) const::$_7, std::__1::allocator<android::Gralloc2Allocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, unsigned int, unsigned int*, native_handle const**) const::$_7>, void (android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>::operator()(android::hardware::graphics::mapper::V2_0::Error&&, unsigned int&&, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)+116 external/libcxx/include/functional:1651
v--------------> std::__1::__function::__value_func<void (android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>::operator()(android::hardware::graphics::mapper::V2_0::Error&&, unsigned int&&, android::hardware::hidl_vec<android::hardware::hidl_handle> const&) const external/libcxx/include/functional:1799
v--------------> std::__1::function<void (android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>::operator()(android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&) const external/libcxx/include/functional:2347
000000000000b9c8 android::hardware::graphics::allocator::V2_0::BpHwAllocator::_hidl_allocate(android::hardware::IInterface*, android::hardware::details::HidlInstrumentor*, android::hardware::hidl_vec<unsigned int> const&, unsigned int, std::__1::function<void (android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>)+864 out/soong/.intermediates/hardware/interfaces/graphics/allocator/2.0/android.hardware.graphics.allocator@2.0_genc++/gen/android/hardware/graphics/allocator/2.0/AllocatorAll.cpp:295
000000000000bdac android::hardware::graphics::allocator::V2_0::BpHwAllocator::allocate(android::hardware::hidl_vec<unsigned int> const&, unsigned int, std::__1::function<void (android::hardware::graphics::mapper::V2_0::Error, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>)+156 out/soong/.intermediates/hardware/interfaces/graphics/allocator/2.0/android.hardware.graphics.allocator@2.0_genc++/gen/android/hardware/graphics/allocator/2.0/AllocatorAll.cpp:326
00000000000203d4 android::Gralloc2Allocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, unsigned int, unsigned int*, native_handle const**) const+316 frameworks/native/libs/ui/Gralloc2.cpp:443
000000000002436c android::GraphicBufferAllocator::allocate(unsigned int, unsigned int, int, unsigned int, unsigned long, native_handle const**, unsigned int*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)+284 frameworks/native/libs/ui/GraphicBufferAllocator.cpp:134
00000000000221ac android::GraphicBuffer::initWithSize(unsigned int, unsigned int, int, unsigned int, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)+212 frameworks/native/libs/ui/GraphicBuffer.cpp:207
000000000002208c android::GraphicBuffer::GraphicBuffer(unsigned int, unsigned int, int, unsigned int, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)+124 frameworks/native/libs/ui/GraphicBuffer.cpp:92
0000000000070a8c android::BufferQueueProducer::dequeueBuffer(int*, android::sp<android::Fence>*, unsigned int, unsigned int, int, unsigned long, unsigned long*, android::FrameEventHistoryDelta*)+1516 frameworks/native/libs/gui/BufferQueueProducer.cpp:515
000000000007ef34 android::BnGraphicBufferProducer::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+1300 frameworks/native/libs/gui/IGraphicBufferProducer.cpp:806
000000000004c6b8 android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+136 frameworks/native/libs/binder/Binder.cpp:134
0000000000058d08 android::IPCThreadState::executeCommand(int)+984 frameworks/native/libs/binder/IPCThreadState.cpp:1213
000000000005887c android::IPCThreadState::getAndExecuteCommand()+156 frameworks/native/libs/binder/IPCThreadState.cpp:514
0000000000058fc4 android::IPCThreadState::joinThreadPool(bool)+60 frameworks/native/libs/binder/IPCThreadState.cpp:594
000000000007f578 android::PoolThread::threadLoop()+24 frameworks/native/libs/binder/ProcessState.cpp:67
00000000000137a4 android::Thread::_threadLoop(void*)+284 system/core/libutils/Threads.cpp:746
00000000000e230c __pthread_start(void*)+36 bionic/libc/bionic/pthread_create.cpp:338
0000000000083d98 __start_thread+64 bionic/libc/bionic/clone.cpp:53


1
2
3
4
5
6
7
8
9
10
11
//kernel log
[2020/10/21 16:53:43] [ 2136.052329] zjj.rk3399.kernel pid=308, dev=0xe280, auth=0, ROCKCHIP_GEM_CREATE
[2020/10/21 16:53:43] [ 2136.052788] zjj.rk3399.kernel pid=308, dev=0xe280, auth=0, DRM_IOCTL_PRIME_HANDLE_TO_FD
[2020/10/21 16:53:43] [ 2136.052867] zjj.rk3399.kernel drivers/gpu/drm/drm_prime.c drm_gem_prime_handle_to_fd 635
[2020/10/21 16:53:43] [ 2136.053112] zjj.rk3399.kernel pid=308, dev=0xe280, auth=0,
ROCKCHIP_GEM_MAP_OFFSET
[2020/10/21 16:53:43] [ 2136.053142] zjj.rk3399.kernel drivers/gpu/drm/rockchip/rockchip_drm_gem.c rockchip_gem_dumb_map_offset 920
020/10/21 16:53:43] [ 2136.055949] zjj.rk3399.kernel pid=308, dev=0xe280, auth=0, DRM_IOCTL_GEM_CLOSE
[2020/10/21 16:53:44] [ 2136.452341] zjj.rk3399.kernel pid=1221, dev=0xe280, auth=0, DRM_IOCTL_PRIME_FD_TO_HANDLE
[2020/10/21 16:53:44] [ 2136.452400] zjj.rk3399.kernel drivers/gpu/drm/drm_prime.c drm_gem_prime_fd_to_handle 903

(五)、hwcomposer代码分析

hwc_prepare:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

Stack Trace:
RELADDR FUNCTION FILE:LINE
0000000000002440 drm_mod_perform(gralloc_module_t const*, int, ...)+120 hardware/rockchip/libgralloc/midgard/gralloc.cpp:95
v--------------> android::hwc_get_handle_attributes(gralloc_module_t const*, native_handle const*, std::__1::vector<int, std::__1::allocator<int> >*) hardware/rockchip/hwcomposer/hwc_rockchip.cpp:824
00000000000617d0 android::hwc_get_handle_attibute(gralloc_module_t const*, native_handle const*, android::attribute_flag)+80 hardware/rockchip/hwcomposer/hwc_rockchip.cpp:850
0000000000051530 android::hwc_prepare(hwc_composer_device_1*, unsigned long, hwc_display_contents_1**)+3464 hardware/rockchip/hwcomposer/hwcomposer.cpp:2733
00000000000151cc android::HWC2On1Adapter::prepareAllDisplays()+1156 hardware/interfaces/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp:2395
0000000000014cdc android::HWC2On1Adapter::Display::validate(unsigned int*, unsigned int*)+92 hardware/interfaces/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp:984
00000000000092f8 android::hardware::graphics::composer::V2_1::passthrough::detail::HwcHalImpl<android::hardware::graphics::composer::V2_1::hal::ComposerHal>::validateDisplay(unsigned long, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >*, std::__1::vector<android::hardware::graphics::composer::V2_1::IComposerClient::Composition, std::__1::allocator<android::hardware::graphics::composer::V2_1::IComposerClient::Composition> >*, unsigned int*, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >*, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >*)+112 hardware/interfaces/graphics/composer/2.1/utils/passthrough/include/composer-passthrough/2.1/HwcHal.h:334
00000000000111f8 android::hardware::graphics::composer::V2_1::hal::ComposerCommandEngine::executeValidateDisplay(unsigned short)+120 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h:259
0000000000010acc android::hardware::graphics::composer::V2_1::hal::ComposerCommandEngine::executeCommand(android::hardware::graphics::composer::V2_1::IComposerClient::Command, unsigned short)+1524 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h:103
000000000000f168 android::hardware::graphics::composer::V2_1::hal::ComposerCommandEngine::execute(unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&, bool*, unsigned int*, android::hardware::hidl_vec<android::hardware::hidl_handle>*)+128 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h:64
000000000000c604 android::hardware::graphics::composer::V2_1::hal::detail::ComposerClientImpl<android::hardware::graphics::composer::V2_1::IComposerClient, android::hardware::graphics::composer::V2_1::hal::ComposerHal>::executeCommands(unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&, std::__1::function<void (android::hardware::graphics::composer::V2_1::Error, bool, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>)+116 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerClient.h:305
00000000000388e4 android::hardware::graphics::composer::V2_1::BnHwComposerClient::_hidl_executeCommands(android::hidl::base::V1_0::BnHwBase*, android::hardware::Parcel const&, android::hardware::Parcel*, std::__1::function<void (android::hardware::Parcel&)>)+524 out/soong/.intermediates/hardware/interfaces/graphics/composer/2.1/android.hardware.graphics.composer@2.1_genc++/gen/android/hardware/graphics/composer/2.1/ComposerClientAll.cpp:3710
0000000000039590 android::hardware::graphics::composer::V2_1::BnHwComposerClient::onTransact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+2672 out/soong/.intermediates/hardware/interfaces/graphics/composer/2.1/android.hardware.graphics.composer@2.1_genc++/gen/android/hardware/graphics/composer/2.1/ComposerClientAll.cpp:4058
0000000000096604 android::hardware::BHwBinder::transact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+68 system/libhwbinder/Binder.cpp:116
v--------------> android::hardware::IPCThreadState::executeCommand(int) system/libhwbinder/IPCThreadState.cpp:1204
0000000000099fcc android::hardware::IPCThreadState::getAndExecuteCommand()+1036 system/libhwbinder/IPCThreadState.cpp:461
000000000009b1e0 android::hardware::IPCThreadState::joinThreadPool(bool)+96 system/libhwbinder/IPCThreadState.cpp:561
00000000000a9df0 android::hardware::PoolThread::threadLoop()+24 system/libhwbinder/ProcessState.cpp:61
00000000000137a4 android::Thread::_threadLoop(void*)+284 system/core/libutils/Threads.cpp:746
00000000000e230c __pthread_start(void*)+36 bionic/libc/bionic/pthread_create.cpp:338
0000000000083d98 __start_thread+64
bionic/libc/bionic/clone.cpp:53

hwc_set:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Stack Trace:
RELADDR FUNCTION FILE:LINE
0000000000002440 drm_mod_perform(gralloc_module_t const*, int, ...)+120 hardware/rockchip/libgralloc/midgard/gralloc.cpp:95
v--------------> android::hwc_get_handle_attributes(gralloc_module_t const*, native_handle const*, std::__1::vector<int, std::__1::allocator<int> >*) hardware/rockchip/hwcomposer/hwc_rockchip.cpp:824
00000000000617d0 android::hwc_get_handle_attibute(gralloc_module_t const*, native_handle const*, android::attribute_flag)+80 hardware/rockchip/hwcomposer/hwc_rockchip.cpp:850
000000000005a904 android::DrmGenericImporter::ImportBuffer(native_handle const*, hwc_drm_bo*, unsigned int)+92 hardware/rockchip/hwcomposer/platformdrmgeneric.cpp:148
v--------------> android::DrmHwcBuffer::ImportBuffer(native_handle const*, android::Importer*, unsigned int) hardware/rockchip/hwcomposer/hwcomposer.cpp:730
v--------------> android::DrmHwcLayer::ImportBuffer(android::hwc_context_t*, hwc_layer_1*, android::Importer*) hardware/rockchip/hwcomposer/hwcomposer.cpp:1426
00000000000548b0 android::hwc_set(hwc_composer_device_1*, unsigned long, hwc_display_contents_1**)+3496 hardware/rockchip/hwcomposer/hwcomposer.cpp:3571
0000000000014240 android::HWC2On1Adapter::setAllDisplays()+456 hardware/interfaces/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp:2528
0000000000013f80 android::HWC2On1Adapter::Display::present(int*)+176 hardware/interfaces/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp:792
000000000000972c android::hardware::graphics::composer::V2_1::passthrough::detail::HwcHalImpl<android::hardware::graphics::composer::V2_1::hal::ComposerHal>::presentDisplay(unsigned long, int*, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >*, std::__1::vector<int, std::__1::allocator<int> >*)+68 hardware/interfaces/graphics/composer/2.1/utils/passthrough/include/composer-passthrough/2.1/HwcHal.h:386
000000000001172c android::hardware::graphics::composer::V2_1::hal::ComposerCommandEngine::executePresentDisplay(unsigned short)+100 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h:335
00000000000105bc android::hardware::graphics::composer::V2_1::hal::ComposerCommandEngine::executeCommand(android::hardware::graphics::composer::V2_1::IComposerClient::Command, unsigned short)+228 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h:109
000000000000f168 android::hardware::graphics::composer::V2_1::hal::ComposerCommandEngine::execute(unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&, bool*, unsigned int*, android::hardware::hidl_vec<android::hardware::hidl_handle>*)+128 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h:64
000000000000c604 android::hardware::graphics::composer::V2_1::hal::detail::ComposerClientImpl<android::hardware::graphics::composer::V2_1::IComposerClient, android::hardware::graphics::composer::V2_1::hal::ComposerHal>::executeCommands(unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&, std::__1::function<void (android::hardware::graphics::composer::V2_1::Error, bool, unsigned int, android::hardware::hidl_vec<android::hardware::hidl_handle> const&)>)+116 hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerClient.h:305
00000000000388e4 android::hardware::graphics::composer::V2_1::BnHwComposerClient::_hidl_executeCommands(android::hidl::base::V1_0::BnHwBase*, android::hardware::Parcel const&, android::hardware::Parcel*, std::__1::function<void (android::hardware::Parcel&)>)+524 out/soong/.intermediates/hardware/interfaces/graphics/composer/2.1/android.hardware.graphics.composer@2.1_genc++/gen/android/hardware/graphics/composer/2.1/ComposerClientAll.cpp:3710
0000000000039590 android::hardware::graphics::composer::V2_1::BnHwComposerClient::onTransact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+2672 out/soong/.intermediates/hardware/interfaces/graphics/composer/2.1/android.hardware.graphics.composer@2.1_genc++/gen/android/hardware/graphics/composer/2.1/ComposerClientAll.cpp:4058
0000000000096604 android::hardware::BHwBinder::transact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+68 system/libhwbinder/Binder.cpp:116
v--------------> android::hardware::IPCThreadState::executeCommand(int) system/libhwbinder/IPCThreadState.cpp:1204
0000000000099fcc android::hardware::IPCThreadState::getAndExecuteCommand()+1036 system/libhwbinder/IPCThreadState.cpp:461
000000000009b1e0 android::hardware::IPCThreadState::joinThreadPool(bool)+96 system/libhwbinder/IPCThreadState.cpp:561
00000000000a9df0 android::hardware::PoolThread::threadLoop()+24 system/libhwbinder/ProcessState.cpp:61
00000000000137a4 android::Thread::_threadLoop(void*)+284 system/core/libutils/Threads.cpp:746
00000000000e230c __pthread_start(void*)+36 bionic/libc/bionic/pthread_create.cpp:338
0000000000083d98 __start_thread+64 bionic/libc/bionic/clone.cpp:53

(六)、HWC数据帧的dump

(1)、设置property

setprop vendor.dump true

抓取的帧会按数字排列,还带分辨率参数。

(2)、adb pull /data/dump/

adb pull /data/dump/

(3)、抓到的bin文件可以用软件7yuv打开查看,格式设定为RGBA8888

Launcher:

Wallpaper:

StatusBar:

NavigationBar:

最终合成效果图:

(七)、参考资料(特别感谢):

(1)【[RK3288][Android6.0] 调试笔记 — display数据帧的dump)】
(2)【Hardware Composer 2.0】