diff options
author | Huan Song <huans@google.com> | 2022-09-14 16:29:44 -0700 |
---|---|---|
committer | Huan Song <huans@google.com> | 2022-09-14 16:29:44 -0700 |
commit | 4b71fe0eba6a9f0cacb328c6cb92967c28c512bb (patch) | |
tree | 0e4f12ba14b7aaf0dda695e77f1bdaace536d7f1 | |
parent | 961348bfdb229ece297c5fe259e81b410039cdb3 (diff) | |
download | goldfish-opengl-4b71fe0eba6a9f0cacb328c6cb92967c28c512bb.tar.gz |
create secondary display with displayId specified.
Bug: 219606877
Test: emulator -hotplug-multi-display
Change-Id: Iccc3b378af1e0e8011beab8814187526192e3a19
-rw-r--r-- | system/hwc2/HostComposer.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/system/hwc2/HostComposer.cpp b/system/hwc2/HostComposer.cpp index 5bf324e0..fa39a950 100644 --- a/system/hwc2/HostComposer.cpp +++ b/system/hwc2/HostComposer.cpp @@ -362,26 +362,13 @@ HWC2::Error HostComposer::onDisplayCreate(Display* display) { hostCon->unlock(); } else { // Secondary display: - static constexpr const uint32_t kHostDisplayIdStart = 6; - - uint32_t expectedHostDisplayId = kHostDisplayIdStart + displayId - 1; - uint32_t actualHostDisplayId = 0; - hostCon->lock(); - rcEnc->rcDestroyDisplay(rcEnc, expectedHostDisplayId); - rcEnc->rcCreateDisplay(rcEnc, &actualHostDisplayId); - rcEnc->rcSetDisplayPose(rcEnc, actualHostDisplayId, -1, -1, displayWidth, + rcEnc->rcDestroyDisplay(rcEnc, displayId); + rcEnc->rcCreateDisplayById(rcEnc, displayId); + rcEnc->rcSetDisplayPose(rcEnc, displayId, -1, -1, displayWidth, displayHeight); hostCon->unlock(); - - if (actualHostDisplayId != expectedHostDisplayId) { - ALOGE( - "Something wrong with host displayId allocation, expected %d " - "but received %d", - expectedHostDisplayId, actualHostDisplayId); - } - - hostDisplayId = actualHostDisplayId; + hostDisplayId = displayId; } error = createHostComposerDisplayInfo(display, hostDisplayId); |