hwc2: validate display

Determine if a particular configuration of layers is valid. If the configuration
is invalid, decide which composition types must change.

Test: Add "TARGET_USES_HWC2 := true" to BoardConfig.mk.
      Recompile.
      Run testcases: https://android-review.googlesource.com/#/q/project:
            platform/frameworks/native+branch:master+topic:test-hwc2

Change-Id: I1b5c13bb2e195888d751640f87936e41e31544c2
7 files changed