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

Commit 98a121aa authored by Mathias Agopian's avatar Mathias Agopian
Browse files

get rid of ro.sf.hwrotation, it's not used anymore

Change-Id: I2ee469ac89ecd65d7187be5cab08b5cc18f67cbe
parent 87855783
Loading
Loading
Loading
Loading
+19 −48
Original line number Diff line number Diff line
@@ -233,48 +233,19 @@ void DisplayHardware::init(EGLConfig config)
        mHwc->setFrameBuffer(mDisplay, mSurface);
    }

    // initialize the display orientation transform.
    // it's a constant that should come from the display driver.
    int displayOrientation = ISurfaceComposer::eOrientationDefault;
    char property[PROPERTY_VALUE_MAX];
    if (property_get("ro.sf.hwrotation", property, NULL) > 0) {
        //displayOrientation
        switch (atoi(property)) {
        case 90:
            displayOrientation = ISurfaceComposer::eOrientation90;
            break;
        case 270:
            displayOrientation = ISurfaceComposer::eOrientation270;
            break;
        }
    }

    w = mDisplayWidth;
    h = mDisplayHeight;
    DisplayHardware::orientationToTransfrom(displayOrientation, w, h,
            &mDisplayTransform);
    if (displayOrientation & ISurfaceComposer::eOrientationSwapMask) {
        mLogicalDisplayWidth = h;
        mLogicalDisplayHeight = w;
    } else {
        mLogicalDisplayWidth = w;
        mLogicalDisplayHeight = h;
    }
    DisplayHardware::setOrientation(ISurfaceComposer::eOrientationDefault);

    // initialize the shared control block
    surface_flinger_cblk_t* const scblk = mFlinger->getControlBlock();
    scblk->connected |= 1 << mDisplayId;
    display_cblk_t* dcblk = &scblk->displays[mDisplayId];
    memset(dcblk, 0, sizeof(display_cblk_t));
    dcblk->w = w; // XXX: plane.getWidth();
    dcblk->h = h; // XXX: plane.getHeight();
    dcblk->format = format;
    dcblk->orientation = ISurfaceComposer::eOrientationDefault;
    dcblk->xdpi = mDpiX;
    dcblk->ydpi = mDpiY;
    dcblk->fps = mRefreshRate;
    dcblk->density = mDensity;

    // initialize the display orientation transform.
    DisplayHardware::setOrientation(ISurfaceComposer::eOrientationDefault);
}

void DisplayHardware::setVSyncHandler(const sp<VSyncHandler>& handler) {
@@ -438,25 +409,25 @@ status_t DisplayHardware::orientationToTransfrom(
    return NO_ERROR;
}

status_t DisplayHardware::setOrientation(int orientation)
{
    // If the rotation can be handled in hardware, this is where
    // the magic should happen.

    const int w = mLogicalDisplayWidth;
    const int h = mLogicalDisplayHeight;
    mUserDisplayWidth = w;
    mUserDisplayHeight = h;
status_t DisplayHardware::setOrientation(int orientation) {
    int w = mDisplayWidth;
    int h = mDisplayHeight;

    Transform orientationTransform;
    DisplayHardware::orientationToTransfrom(orientation, w, h,
            &orientationTransform);
    DisplayHardware::orientationToTransfrom(
            orientation, w, h, &mGlobalTransform);
    if (orientation & ISurfaceComposer::eOrientationSwapMask) {
        mUserDisplayWidth = h;
        mUserDisplayHeight = w;
        int tmp = w;
        w = h;
        h = tmp;
    }

    mOrientation = orientation;
    mGlobalTransform = mDisplayTransform * orientationTransform;

    // update the shared control block
    surface_flinger_cblk_t* const scblk = mFlinger->getControlBlock();
    volatile display_cblk_t* dcblk = &scblk->displays[mDisplayId];
    dcblk->orientation = orientation;
    dcblk->w = w;
    dcblk->h = h;

    return NO_ERROR;
}
+3 −11
Original line number Diff line number Diff line
@@ -91,8 +91,6 @@ public:
    status_t                setOrientation(int orientation);
    int                     getOrientation() const { return mOrientation; }
    const Transform&        getTransform() const { return mGlobalTransform; }
    int                     getUserWidth() const { return mUserDisplayWidth; }
    int                     getUserHeight() const { return mUserDisplayHeight; }

    void setVSyncHandler(const sp<VSyncHandler>& handler);

@@ -167,18 +165,12 @@ private:
    static status_t orientationToTransfrom(int orientation, int w, int h,
            Transform* tr);
    Transform mGlobalTransform;
    Transform               mDisplayTransform;
    int mOrientation;
    int                     mLogicalDisplayWidth;
    int                     mLogicalDisplayHeight;
    int                     mUserDisplayWidth;
    int                     mUserDisplayHeight;

    mutable Mutex   mLock;

    /*
     *  protected by mLock
     */
    mutable Mutex mLock;
    wp<VSyncHandler>    mVSyncHandler;
};

+1 −8
Original line number Diff line number Diff line
@@ -805,14 +805,7 @@ Region SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)

            const int dpy = 0; // TODO: should be a parameter
            DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
            const int orientation = mCurrentState.orientation;
            hw.setOrientation(orientation);

            // update the shared control block
            volatile display_cblk_t* dcblk = mServerCblk->displays + dpy;
            dcblk->orientation = orientation;
            dcblk->w = hw.getUserWidth();
            dcblk->h = hw.getUserHeight();
            hw.setOrientation(mCurrentState.orientation);

            // FIXME: mVisibleRegionsDirty & mDirtyRegion should this be per DisplayHardware?
            mVisibleRegionsDirty = true;