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

Commit 0a70c9c7 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "surfaceflinger: odd hw rotation (90/270) patch for swapping width/height" into mr1-staging

parents 49e4bcbf 5bb89174
Loading
Loading
Loading
Loading
+15 −4
Original line number Original line Diff line number Diff line
@@ -665,10 +665,21 @@ status_t SurfaceFlinger::getDisplayInfo(const sp<IBinder>& display, DisplayInfo*
        info->orientation = 0;
        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 = hwc.getWidth(type);
        info->w = hwc.getHeight(type);
        info->xdpi = ydpi;
        info->ydpi = xdpi;
    }
    else {
        info->w = hwc.getWidth(type);
        info->w = hwc.getWidth(type);
        info->h = hwc.getHeight(type);
        info->h = hwc.getHeight(type);
        info->xdpi = xdpi;
        info->xdpi = xdpi;
        info->ydpi = ydpi;
        info->ydpi = ydpi;
    }
    info->fps = float(1e9 / hwc.getRefreshPeriod(type));
    info->fps = float(1e9 / hwc.getRefreshPeriod(type));


    // All non-virtual displays are currently considered secure.
    // All non-virtual displays are currently considered secure.