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

Commit 7021a02f authored by Hendrik Wagenaar's avatar Hendrik Wagenaar Committed by android-build-merger
Browse files

Merge "Remove framebuffer_target" into oc-dev am: c6c0c9c7

am: 276de072

Change-Id: I9a7d9407f62d66989eaa9275ca71dec45e2f959b
parents cfa1f2c0 276de072
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -49,10 +49,6 @@ constexpr int kAllowedPendingFenceCount = 0;
// Offset before vsync to submit frames to hardware composer.
constexpr int64_t kFramePostOffsetNs = 4000000;  // 4ms

constexpr size_t kDefaultDisplayConfigCount = 32;

constexpr float kMetersPerInch = 0.0254f;

const char kBacklightBrightnessSysFile[] =
    "/sys/class/leds/lcd-backlight/brightness";

@@ -65,23 +61,6 @@ const char kDvrPerformanceProperty[] = "sys.dvr.performance";

const char kRightEyeOffsetProperty[] = "dvr.right_eye_offset_ns";

// Returns our best guess for the time the compositor will spend rendering the
// next frame.
int64_t GuessFrameTime(int compositor_visible_layer_count) {
  // The cost of asynchronous EDS and lens warp is currently measured at 2.5ms
  // for one layer and 7ms for two layers, but guess a higher frame time to
  // account for CPU overhead. This guess is only used before we've measured the
  // actual time to render a frame for the current compositor configuration.
  switch (compositor_visible_layer_count) {
    case 0:
      return 500000;  // .5ms
    case 1:
      return 5000000;  // 5ms
    default:
      return 10500000;  // 10.5ms
  }
}

// Get time offset from a vsync to when the pose for that vsync should be
// predicted out to. For example, if scanout gets halfway through the frame
// at the halfway point between vsyncs, then this could be half the period.
@@ -241,14 +220,6 @@ void HardwareComposer::UpdatePostThreadState(PostThreadStateType state,
}

void HardwareComposer::OnPostThreadResumed() {
  constexpr int format = HAL_PIXEL_FORMAT_RGBA_8888;
  constexpr int usage =
      GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_RENDER;

  framebuffer_target_ = std::make_shared<IonBuffer>(
      native_display_metrics_.width, native_display_metrics_.height, format,
      usage);

  hwc2_hidl_->resetCommands();

  // Connect to pose service.
@@ -275,7 +246,6 @@ void HardwareComposer::OnPostThreadResumed() {
}

void HardwareComposer::OnPostThreadPaused() {
  framebuffer_target_.reset();
  retire_fence_fds_.clear();
  display_surfaces_.clear();

+0 −3
Original line number Diff line number Diff line
@@ -383,9 +383,6 @@ class HardwareComposer {
  // Transform required to get from native to logical display orientation.
  HWC::Transform display_transform_ = HWC::Transform::None;

  // Buffer for the background layer required by hardware composer.
  std::shared_ptr<IonBuffer> framebuffer_target_;

  // Pending surface list. Set by the display service when DirectSurfaces are
  // added, removed, or change visibility. Written by the message dispatch
  // thread and read by the post thread.