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

Commit df65fd27 authored by Peiyong Lin's avatar Peiyong Lin
Browse files

Use global capabilities for Display without a valid HWC display ID.

A display without a valid HWC id means it will always be GPU composited and it
doesn't have display capabilities. To make sure it's backward compatible, we
fallback to query global capabilities for skip client color transform in this
case.

BUG: b/120786848, b/120916153, b/120917555
Test: Run all CTS from above bugs
Change-Id: I279b4f3ec53dc6fbf19cac724be3407cd94c676b
parent c5a98b50
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -98,6 +98,10 @@ bool HWComposer::hasCapability(HWC2::Capability capability) const
bool HWComposer::hasDisplayCapability(const std::optional<DisplayId>& displayId,
                                      HWC2::DisplayCapability capability) const {
    if (!displayId) {
        // Checkout global capabilities for displays without a corresponding HWC display.
        if (capability == HWC2::DisplayCapability::SkipClientColorTransform) {
            return hasCapability(HWC2::Capability::SkipClientColorTransform);
        }
        return false;
    }
    RETURN_IF_INVALID_DISPLAY(*displayId, false);