Skip to content

DrmResources::Init: Set primary display only if connected (v4)

maurossi requested to merge issor.oruam/drm-hwcomposer:drmdevice_fix into master

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

Merge request reports