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

Commit 3cfac284 authored by Steven Thomas's avatar Steven Thomas
Browse files

Ignore callbacks from the non-active hardware composer

Ignore callbacks from the non-active hardware composer so we don't get
e.g. duplicate vsync callbacks, one from each composer.

Bug: None

Test: Manually confirmed with logs we're now ignoring callbacks on the
      non-active composer.

Change-Id: I8b475d6283d86c64ff96b41e78528bce8c6ff1d3
parent 64f1fbf9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -318,6 +318,10 @@ int DisplayService::UpdateActiveDisplaySurfaces() {
  return hardware_composer_.SetDisplaySurfaces(std::move(visible_surfaces));
}

void DisplayService::OnHardwareComposerRefresh() {
  hardware_composer_.OnHardwareComposerRefresh();
}

void DisplayService::SetDisplayConfigurationUpdateNotifier(
    DisplayConfigurationUpdateNotifier update_notifier) {
  update_notifier_ = update_notifier;
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ class DisplayService : public pdx::ServiceBase<DisplayService> {
    }
  }

  void OnHardwareComposerRefresh();

 private:
  friend BASE;
  friend DisplaySurface;
+4 −0
Original line number Diff line number Diff line
@@ -1287,6 +1287,10 @@ void HardwareComposer::HwcHotplug(hwc2_callback_data_t /*callbackData*/,
  // TODO(eieio): implement display hotplug callbacks.
}

void HardwareComposer::OnHardwareComposerRefresh() {
  // TODO(steventhomas): Handle refresh.
}

void HardwareComposer::SetBacklightBrightness(int brightness) {
  if (backlight_brightness_fd_) {
    std::array<char, 32> text;
+2 −0
Original line number Diff line number Diff line
@@ -224,6 +224,8 @@ class HardwareComposer {

  Compositor* GetCompositor() { return &compositor_; }

  void OnHardwareComposerRefresh();

 private:
  int32_t EnableVsync(bool enabled);

+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ class VrFlinger {

  void EnterVrMode();
  void ExitVrMode();
  void OnHardwareComposerRefresh();

 private:
  std::thread displayd_thread_;
Loading