@@ -6123,9 +6123,8 @@ void SurfaceFlinger::dumpDisplays(std::string& result) const {
61236123 display->dump (dumper);
61246124
61256125 std::lock_guard lock (mVirtualDisplaysMutex );
6126- const auto virtualSnapshotIt = mVirtualDisplays .find (virtualId);
6127- if (virtualSnapshotIt != mVirtualDisplays .end ()) {
6128- virtualSnapshotIt->second .dump (dumper);
6126+ if (const auto snapshotOpt = mVirtualDisplays .get (virtualId)) {
6127+ snapshotOpt->get ().dump (dumper);
61296128 }
61306129 }
61316130 }
@@ -6137,6 +6136,7 @@ void SurfaceFlinger::dumpDisplayIdentificationData(std::string& result) const {
61376136 if (!displayId) {
61386137 continue ;
61396138 }
6139+
61406140 const auto hwcDisplayId = getHwComposer ().fromPhysicalDisplayId (*displayId);
61416141 if (!hwcDisplayId) {
61426142 continue ;
@@ -6145,6 +6145,7 @@ void SurfaceFlinger::dumpDisplayIdentificationData(std::string& result) const {
61456145 StringAppendF (&result,
61466146 " Display %s (HWC display %" PRIu64 " ): " , to_string (*displayId).c_str (),
61476147 *hwcDisplayId);
6148+
61486149 uint8_t port;
61496150 DisplayIdentificationData data;
61506151 if (!getHwComposer ().getDisplayIdentificationData (*hwcDisplayId, &port, &data)) {
@@ -6172,6 +6173,19 @@ void SurfaceFlinger::dumpDisplayIdentificationData(std::string& result) const {
61726173 result.append (edid->displayName .data (), edid->displayName .length ());
61736174 result.append (" \"\n " );
61746175 }
6176+
6177+ for (const auto & [token, display] : mDisplays ) {
6178+ const auto virtualDisplayId = asVirtualDisplayId (display->getDisplayIdVariant ());
6179+ if (virtualDisplayId) {
6180+ StringAppendF (&result, " Display %s (Virtual display): displayName=\" %s\" " ,
6181+ to_string (*virtualDisplayId).c_str (), display->getDisplayName ().c_str ());
6182+ std::lock_guard lock (mVirtualDisplaysMutex );
6183+ if (const auto snapshotOpt = mVirtualDisplays .get (*virtualDisplayId)) {
6184+ StringAppendF (&result, " uniqueId=\" %s\" " , snapshotOpt->get ().uniqueId ().c_str ());
6185+ }
6186+ result.append (" \n " );
6187+ }
6188+ }
61756189}
61766190
61776191void SurfaceFlinger::dumpRawDisplayIdentificationData (const DumpArgs& args,
0 commit comments