There are cases when primary display lookup order should be overridden. This could be achieved with adding system property hwc.drm.primary_display_order, as proposed by Roman Stratiienko in discussion of issue #14.
Example of primary_display_order property usage:
This means that first priority goes to HDMI-A-2 connector, then HDMI-A-1 connector, then everything else. Internal connectors have higher priority than any other connectors not mentioned in property.
Connected connector with highest priority would be selected as a primary display.
I did smoke test with one and two displays and haven't found any new issues.