libhwc2.1: allocate DPP and HW based on main/minor displays

In the past, HWC must assign each DPP and HW to an explicit display, but
it is ambiguous when a DPP or HW is reserved by an inactive display. For
example, a DPP was reserved by the inactive outer display, but the external
display is active. HWC reserved the DPP to the inner display or the
external display arbitrary, and this may cause unexpected reservation.

After this change, HWC allocates DPP/HW  based on the main/minor displays.
For example, the main display can be the inner display, and the minor
display can be outer display or the external display.

Bug: 289877101
Test: try to connect external display, and check composition status
Change-Id: I052e77b714ec17ad64a9df92bed91d96b5d8b549
3 files changed