drm_hwcomposer: set primary display only if connected (v4)

Android-x86 supports one display which has to be connected, so when looking for
primary disaply we add check for condition 'conn->state() == DRM_MODE_CONNECTED'
we set found_primary flag only for connected display and skip the treatment of
additional displays.

(v2) Same logic but Changes in implementation due to following commits:
     0f5abd79 ("drm_hwcomposer: Rename DrmResources to DrmDevice")
     c5463587 ("drm_hwcomposer: Add resource manager support")

(v3) Due to commit 27cd4805 ("drm_hwcomposer: Organize files into subdirs")

(v4) Due to commit d07c3705 ("drm_hwcomposer: Add property hwc.drm.primary_display_order")

This is essential to avoid following logcat errors on integrated and dedicated GPUs:

... 2245  2245 E hwc-drm-device: Could not find a suitable encoder/crtc for display 3
... 2245  2245 E hwc-drm-device: Failed CreateDisplayPipe 90 with -19

Tested with i965 on Skylake GT2, amdgpu on HD7790, RX560 and nouveau on GT610, GT1030

Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
1 job for drmdevice_fix in 27 seconds (queued for 18 seconds)
latest