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

Commit 27034b01 authored by Christopher N. Hesse's avatar Christopher N. Hesse Committed by Gerrit Code Review
Browse files

surfaceflinger: hwc1: Fix hwrotation

Change-Id: I1f8defb108ff944f07ac32e8b147d1d87e7089e0
parent 2a6b780a
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -656,10 +656,21 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display,
            info.orientation = 0;
        }

        char value[PROPERTY_VALUE_MAX];
        property_get("ro.sf.hwrotation", value, "0");
        int additionalRot = atoi(value) / 90;
        if ((type == DisplayDevice::DISPLAY_PRIMARY) && (additionalRot & DisplayState::eOrientationSwapMask)) {
            info.h = hwConfig.width;
            info.w = hwConfig.height;
            info.xdpi = ydpi;
            info.ydpi = xdpi;
        }
        else {
            info.w = hwConfig.width;
            info.h = hwConfig.height;
            info.xdpi = xdpi;
            info.ydpi = ydpi;
        }
        info.fps = float(1e9 / hwConfig.refresh);
        info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS;
        info.colorTransform = hwConfig.colorTransform;