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

Commit 3a8f7944 authored by Mark Urbanus's avatar Mark Urbanus
Browse files

Tie VR mode support to a property

Bug: 35854545
Test:
  - Validate VR mode is not supported when ro.boot.vr is unset
  - Validate VR mode is supported when ro.boot.vr is set

Change-Id: I26f7e851766eab0d8a5a2f9fb4d72bfcee0c42f3
parent 4baf3faa
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -156,6 +156,7 @@ SurfaceFlinger::SurfaceFlinger()
        mVisibleRegionsDirty(false),
        mVisibleRegionsDirty(false),
        mGeometryInvalid(false),
        mGeometryInvalid(false),
        mAnimCompositionPending(false),
        mAnimCompositionPending(false),
        mVrModeSupported(0),
        mDebugRegion(0),
        mDebugRegion(0),
        mDebugDDMS(0),
        mDebugDDMS(0),
        mDebugDisableHWC(0),
        mDebugDisableHWC(0),
@@ -185,6 +186,10 @@ SurfaceFlinger::SurfaceFlinger()
    // debugging stuff...
    // debugging stuff...
    char value[PROPERTY_VALUE_MAX];
    char value[PROPERTY_VALUE_MAX];


    // TODO (urbanus): remove once b/35319396 is fixed.
    property_get("ro.boot.vr", value, "0");
    mVrModeSupported = atoi(value);

    property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
    property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
    mGpuToCpuSupported = !atoi(value);
    mGpuToCpuSupported = !atoi(value);


@@ -1262,8 +1267,11 @@ void SurfaceFlinger::onMessageReceived(int32_t what) {
    ATRACE_CALL();
    ATRACE_CALL();
    switch (what) {
    switch (what) {
        case MessageQueue::INVALIDATE: {
        case MessageQueue::INVALIDATE: {
            // TODO(eieio): Disabled until SELinux issues are resolved.
            // TODO(eieio): Tied to a conditional until SELinux issues
            //updateVrMode();
            // are resolved.
            if (mVrModeSupported) {
                updateVrMode();
            }


            bool frameMissed = !mHadClientComposition &&
            bool frameMissed = !mHadClientComposition &&
                    mPreviousPresentFence != Fence::NO_FENCE &&
                    mPreviousPresentFence != Fence::NO_FENCE &&
+1 −0
Original line number Original line Diff line number Diff line
@@ -557,6 +557,7 @@ private:
    DefaultKeyedVector< wp<IBinder>, sp<DisplayDevice> > mDisplays;
    DefaultKeyedVector< wp<IBinder>, sp<DisplayDevice> > mDisplays;


    // don't use a lock for these, we don't care
    // don't use a lock for these, we don't care
    int mVrModeSupported;
    int mDebugRegion;
    int mDebugRegion;
    int mDebugDDMS;
    int mDebugDDMS;
    int mDebugDisableHWC;
    int mDebugDisableHWC;