DrmResources::Init set display logic is flawed
If you follow the code @line 160: // First look for primary amongst internal connectors
// First look for primary amongst internal connectors
for (auto &conn : connectors_) {
if (conn->internal() && !found_primary) {
conn->set_display(0);
found_primary = true;
} else {
conn->set_display(display_num);
++display_num;
}
}
// Then look for primary amongst external connectors
for (auto &conn : connectors_) {
if (conn->external() && !found_primary) {
conn->set_display(0);
found_primary = true;
}
}
if any internal connector is present display 0 is set and considered as primary. With discrete GPUs, having multiple connectors, that is not correct.
Hack [1] even if a ugly hack and does not consider multiple displays, avoids the current defect in assigning display 0 and found_primary, because by changing the current logic the Android GUI can boot with nouveau,
with the current implementation Android cannot boot on any discrete GPU.
This ticket purpose is to have a placeholder to correct the defect in some way.
Mauro Rossi
[1] https://github.com/maurossi/drm_hwcomposer/commit/a3fc27612d98bba1a3f3d959d557af2d49ad5889