Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -160,12 +160,14 @@ std::optional<DisplayId> HWComposer::onHotplug(hwc2_display_t hwcDisplayId, int3 std::optional<DisplayId> displayId; if (connection == HWC2::Connection::Connected) { uint8_t port; DisplayIdentificationData data; if (getDisplayIdentificationData(hwcDisplayId, &port, &data)) { displayId = generateDisplayId(port, data); ALOGE_IF(!displayId, "Failed to generate stable ID for display %" PRIu64, hwcDisplayId); } } // Disconnect is handled through HWComposer::disconnectDisplay via // SurfaceFlinger's onHotplugReceived callback handling Loading services/surfaceflinger/tests/unittests/DisplayIdentificationTest.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -77,20 +77,23 @@ TEST(DisplayIdentificationTest, isEdid) { } TEST(DisplayIdentificationTest, parseEdid) { auto edid = parseEdid(asDisplayIdentificationData(kInternalEdid)); auto data = asDisplayIdentificationData(kInternalEdid); auto edid = parseEdid(data); ASSERT_TRUE(edid); EXPECT_EQ(0x4ca3u, edid->manufacturerId); EXPECT_STREQ("SEC", edid->pnpId.data()); // ASCII text should be used as fallback if display name and serial number are missing. EXPECT_EQ("121AT11-801", edid->displayName); edid = parseEdid(asDisplayIdentificationData(kExternalEdid)); data = asDisplayIdentificationData(kExternalEdid); edid = parseEdid(data); ASSERT_TRUE(edid); EXPECT_EQ(0x22f0u, edid->manufacturerId); EXPECT_STREQ("HWP", edid->pnpId.data()); EXPECT_EQ("HP ZR30w", edid->displayName); edid = parseEdid(asDisplayIdentificationData(kExternalEedid)); data = asDisplayIdentificationData(kExternalEedid); edid = parseEdid(data); ASSERT_TRUE(edid); EXPECT_EQ(0x4c2du, edid->manufacturerId); EXPECT_STREQ("SAM", edid->pnpId.data()); Loading services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,8 @@ void HandleTransactionLockedTest::processesHotplugDisconnectCommon() { // Call Expectations EXPECT_CALL(*mComposer, isUsingVrComposer()).WillRepeatedly(Return(false)); EXPECT_CALL(*mComposer, getDisplayIdentificationData(Case::Display::HWC_DISPLAY_ID, _, _)) .Times(0); setupCommonCallExpectationsForDisconnectProcessing<Case>(); Loading Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -160,12 +160,14 @@ std::optional<DisplayId> HWComposer::onHotplug(hwc2_display_t hwcDisplayId, int3 std::optional<DisplayId> displayId; if (connection == HWC2::Connection::Connected) { uint8_t port; DisplayIdentificationData data; if (getDisplayIdentificationData(hwcDisplayId, &port, &data)) { displayId = generateDisplayId(port, data); ALOGE_IF(!displayId, "Failed to generate stable ID for display %" PRIu64, hwcDisplayId); } } // Disconnect is handled through HWComposer::disconnectDisplay via // SurfaceFlinger's onHotplugReceived callback handling Loading
services/surfaceflinger/tests/unittests/DisplayIdentificationTest.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -77,20 +77,23 @@ TEST(DisplayIdentificationTest, isEdid) { } TEST(DisplayIdentificationTest, parseEdid) { auto edid = parseEdid(asDisplayIdentificationData(kInternalEdid)); auto data = asDisplayIdentificationData(kInternalEdid); auto edid = parseEdid(data); ASSERT_TRUE(edid); EXPECT_EQ(0x4ca3u, edid->manufacturerId); EXPECT_STREQ("SEC", edid->pnpId.data()); // ASCII text should be used as fallback if display name and serial number are missing. EXPECT_EQ("121AT11-801", edid->displayName); edid = parseEdid(asDisplayIdentificationData(kExternalEdid)); data = asDisplayIdentificationData(kExternalEdid); edid = parseEdid(data); ASSERT_TRUE(edid); EXPECT_EQ(0x22f0u, edid->manufacturerId); EXPECT_STREQ("HWP", edid->pnpId.data()); EXPECT_EQ("HP ZR30w", edid->displayName); edid = parseEdid(asDisplayIdentificationData(kExternalEedid)); data = asDisplayIdentificationData(kExternalEedid); edid = parseEdid(data); ASSERT_TRUE(edid); EXPECT_EQ(0x4c2du, edid->manufacturerId); EXPECT_STREQ("SAM", edid->pnpId.data()); Loading
services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,8 @@ void HandleTransactionLockedTest::processesHotplugDisconnectCommon() { // Call Expectations EXPECT_CALL(*mComposer, isUsingVrComposer()).WillRepeatedly(Return(false)); EXPECT_CALL(*mComposer, getDisplayIdentificationData(Case::Display::HWC_DISPLAY_ID, _, _)) .Times(0); setupCommonCallExpectationsForDisconnectProcessing<Case>(); Loading