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

Commit 88a905b9 authored by Madhuri Athota's avatar Madhuri Athota Committed by Matthew Bouyack
Browse files

SurfaceFlinger: Change to support client target flip



- Add support to flip framebuffer target if
  HWC2 implementation requests for it.

b/38114488
b/68271386
CRs-Fixed: 2057401
Change-Id: I91422ef60a139cbaf491db219b216cd1252e7e63
Signed-off-by: default avatarMadhuri Athota <mathota@codeaurora.org>
parent 7f96780b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,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
@@ -565,6 +565,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;