Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a268cf2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: Fix two display identification bugs"

parents 83573621 438e9e76
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -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
+6 −3
Original line number Diff line number Diff line
@@ -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());
+3 −1
Original line number Diff line number Diff line
@@ -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>();