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

Commit b9b48ae8 authored by Stephen Kiazyk's avatar Stephen Kiazyk Committed by android-build-merger
Browse files

Set the vr hwc vsync rate to match the native vsync

am: 22c1462a

Change-Id: I3b4ebea0ad9e8249d6dec76e798e67724a84761d
parents 21802dac 22c1462a
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -336,7 +336,19 @@ Error VrHwc::getDisplayAttribute(Display display, Config config,
      *outValue = display_ptr->height();
      *outValue = display_ptr->height();
      break;
      break;
    case IComposerClient::Attribute::VSYNC_PERIOD:
    case IComposerClient::Attribute::VSYNC_PERIOD:
      *outValue = 1000 * 1000 * 1000 / 30;  // 30fps
      {
        int error = 0;
        auto display_client = display::DisplayClient::Create(&error);
        if (!display_client) {
          ALOGE("Could not connect to display service : %s(%d)",
                strerror(error), error);
          // Return a default value of 30 fps
          *outValue = 1000 * 1000 * 1000 / 30;
        } else {
          auto metrics = display_client->GetDisplayMetrics();
          *outValue = metrics.get().vsync_period_ns;
        }
      }
      break;
      break;
    case IComposerClient::Attribute::DPI_X:
    case IComposerClient::Attribute::DPI_X:
    case IComposerClient::Attribute::DPI_Y:
    case IComposerClient::Attribute::DPI_Y: