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

Commit 0c114599 authored by Matthew Bouyack's avatar Matthew Bouyack Committed by Android (Google) Code Review
Browse files

Merge "SurfaceFlinger: Change to support client target flip"

parents f1831a12 88a905b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ status_t DisplayDevice::prepareFrame(HWComposer& hwc) {
}

void DisplayDevice::swapBuffers(HWComposer& hwc) const {
    if (hwc.hasClientComposition(mHwcDisplayId)) {
    if (hwc.hasClientComposition(mHwcDisplayId) || hwc.hasFlipClientTargetRequest(mHwcDisplayId)) {
        mSurface.swapBuffers();
    }

+14 −0
Original line number Diff line number Diff line
@@ -564,6 +564,20 @@ bool HWComposer::hasDeviceComposition(int32_t displayId) const {
    return mDisplayData[displayId].hasDeviceComposition;
}

bool HWComposer::hasFlipClientTargetRequest(int32_t displayId) const {
    if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
        // Displays without a corresponding HWC display are never composed by
        // the device
        return false;
    }
    if (!isValidDisplay(displayId)) {
        ALOGE("hasFlipClientTargetRequest: Invalid display %d", displayId);
        return false;
    }
    return ((static_cast<uint32_t>(mDisplayData[displayId].displayRequests) &
             static_cast<uint32_t>(HWC2::DisplayRequest::FlipClientTarget)) != 0);
}

bool HWComposer::hasClientComposition(int32_t displayId) const {
    if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
        // Displays without a corresponding HWC display are always composed by
+3 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@ public:
    // does this display have layers handled by HWC
    bool hasDeviceComposition(int32_t displayId) const;

    // does this display have pending request to flip client target
    bool hasFlipClientTargetRequest(int32_t displayId) const;

    // does this display have layers handled by GLES
    bool hasClientComposition(int32_t displayId) const;