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

Commit 3fbb0c1e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "SF: Add support for inverse mounted panels"

parents 804212ed 5eb682f7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -134,6 +134,11 @@ DisplayDevice::DisplayDevice(
    property_get("persist.panel.orientation", property, "0");
    panelOrientation = atoi(property) / 90;

    mPanelInverseMounted = false;
    // Check if panel is inverse mounted (contents show up HV flipped)
    property_get("persist.panel.inversemounted", property, "0");
    mPanelInverseMounted = !!atoi(property);

    // initialize the display orientation transform.
    setProjection(panelOrientation, mViewport, mFrame);
}
@@ -408,6 +413,11 @@ status_t DisplayDevice::orientationToTransfrom(
    default:
        return BAD_VALUE;
    }

    if (DISPLAY_PRIMARY == mHwcDisplayId && isPanelInverseMounted()) {
        flags = flags ^ Transform::ROT_180;
    }

    tr->set(flags, w, h);
    return NO_ERROR;
}
+7 −1
Original line number Diff line number Diff line
@@ -126,6 +126,10 @@ public:
    int32_t                 getHwcDisplayId() const { return mHwcDisplayId; }
    const wp<IBinder>&      getDisplayToken() const { return mDisplayToken; }

    bool isPanelInverseMounted() const {
        return mPanelInverseMounted;
    }

    // We pass in mustRecompose so we can keep VirtualDisplaySurface's state
    // machine happy without actually queueing a buffer if nothing has changed
    status_t beginFrame(bool mustRecompose) const;
@@ -215,7 +219,7 @@ private:
    /*
     * Transaction state
     */
    static status_t orientationToTransfrom(int orientation,
    status_t orientationToTransfrom(int orientation,
            int w, int h, Transform* tr);

    uint32_t mLayerStack;
@@ -232,6 +236,8 @@ private:
    int mPowerMode;
    // Current active config
    int mActiveConfig;
    // Panel is inverse mounted
    int mPanelInverseMounted;
};

}; // namespace android
+6 −0
Original line number Diff line number Diff line
@@ -3530,6 +3530,12 @@ void SurfaceFlinger::renderScreenImplLocked(
    // make sure to clear all GL error flags
    engine.checkErrors();

    if (DisplayDevice::DISPLAY_PRIMARY == hw->getDisplayType() &&
                hw->isPanelInverseMounted()) {
        rotation = (Transform::orientation_flags)
                (rotation ^ Transform::ROT_180);
    }

    // set-up our viewport
    engine.setViewportAndProjection(
        reqWidth, reqHeight, sourceCrop, hw_h, yswap, rotation);