libhwc2.1: Use getDcDisplayType instead of getDisplayTypeFromIndex

Currently HWC uses the getDisplayTypeFromIndex function in a number of places
in common/gs101 code, but that function is defined only for primary displays.
This CL introduces the getDcDisplayType function, which has the same behavior
as getDisplayTypeFromIndex, but will also handle external display properly.
Also replace getBuiltInDisplayType with getDcDisplayType too.

Bug: 299682821
Test: presubmit
Change-Id: I00f6412ac3986aaa9663e585ee76fd599286c18c
2 files changed