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

Commit bb866c1a authored by Sally Qi's avatar Sally Qi
Browse files

OverlayProperty API implementation

- load overlay properties upon SF callbacks.

Bug: 242588489
Test: atest libsurfaceflinger_unittest, hardcode some dataspaces and
pixelformats values in HalImpl::getOverlaySupport to make sure the path
from HWC to HWUI is functionally workable on the device

Change-Id: I7e5ab7e242ca86daa991141910690f633c5de6ac
parent 25d2e5e1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -16,9 +16,11 @@

package android.gui;

import android.gui.SupportedBufferCombinations;

/** @hide */
parcelable OverlayProperties {
    parcelable SupportedBufferCombinations {
        int[] pixelFormats;
        int[] dataspaces;
    }
    SupportedBufferCombinations[] combinations;
}
+0 −23
Original line number Diff line number Diff line
/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.gui;

/** @hide */
parcelable SupportedBufferCombinations {
    int[] pixelFormats;
    int[] dataspaces;
}
+2 −2
Original line number Diff line number Diff line
@@ -139,8 +139,8 @@ public:
    MOCK_METHOD(Hwc2::AidlTransform, getPhysicalDisplayOrientation, (PhysicalDisplayId),
                (const, override));
    MOCK_METHOD(bool, getValidateSkipped, (HalDisplayId), (const, override));
    MOCK_METHOD(status_t, getOverlaySupport,
                (aidl::android::hardware::graphics::composer3::OverlayProperties*));
    MOCK_METHOD(const aidl::android::hardware::graphics::composer3::OverlayProperties&,
                getOverlaySupport, (), (const, override));
};

} // namespace mock
+6 −2
Original line number Diff line number Diff line
@@ -504,8 +504,12 @@ Error AidlComposer::getHdrCapabilities(Display display, std::vector<Hdr>* outTyp
    return Error::NONE;
}

Error AidlComposer::getOverlaySupport(AidlOverlayProperties* /*outProperties*/) {
    // TODO(b/242588489): implement details
Error AidlComposer::getOverlaySupport(AidlOverlayProperties* outProperties) {
    const auto status = mAidlComposerClient->getOverlaySupport(outProperties);
    if (!status.isOk()) {
        ALOGE("getOverlaySupport failed %s", status.getDescription().c_str());
        return static_cast<Error>(status.getServiceSpecificError());
    }
    return Error::NONE;
}

+3 −3
Original line number Diff line number Diff line
@@ -334,9 +334,9 @@ Error Display::getHdrCapabilities(HdrCapabilities* outCapabilities) const
    return Error::NONE;
}

Error Display::getOverlaySupport(OverlayProperties* /*outProperties*/) const {
    // TODO(b/242588489): implement details
    return Error::NONE;
Error Display::getOverlaySupport(OverlayProperties* outProperties) const {
    auto intError = mComposer.getOverlaySupport(outProperties);
    return static_cast<Error>(intError);
}

Error Display::getDisplayedContentSamplingAttributes(hal::PixelFormat* outFormat,
Loading