HWC2: Optimize execution by caching all HWC2 calls in setPerFrameData

To avoid redundant HWC2 calls into hwcomposer service, we cache all HWC2
calls in BufferLayer::setPerFrameData by having visible region, damage
region and layer buffers cached in HWC2::Layer.

Bug: 119414178
Test: Display function test on F2.
Test: b/129317072 Display function tests on M1/S1, M2/S2, B1/C1, B4/S4,
      and C2/F2.
Change-Id: I1679e755ac55a459c93b42b9f8225f0c270228e6
2 files changed