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

Commit 3822dfa3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add lshal support for VrHwc"

parents cc887a60 31c8de61
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -994,6 +994,26 @@ void VrHwc::UpdateVsyncCallbackEnabledLocked() {
  vsync_callback_->SetEventCallback(send_vsync ? event_callback_ : nullptr);
}

Return<void> VrHwc::debug(const hidl_handle& fd,
                          const hidl_vec<hidl_string>& args) {
  std::string result;

  {
    std::lock_guard<std::mutex> guard(mutex_);
    for (const auto& pair : displays_) {
      result += StringPrintf("Display id: %d\n", static_cast<int>(pair.first));
      pair.second->dumpDebugInfo(&result);
    }
    result += "\n";
  }

  FILE* out = fdopen(dup(fd->data[0]), "w");
  fprintf(out, "%s", result.c_str());
  fclose(out);

  return Void();
}

void HwcLayer::dumpDebugInfo(std::string* result) const {
  if (!result) {
    return;
+3 −0
Original line number Diff line number Diff line
@@ -295,6 +295,9 @@ class VrHwc : public IComposer, public ComposerHal, public ComposerView {
  void RegisterObserver(Observer* observer) override;
  void UnregisterObserver(Observer* observer) override;

  Return<void> debug(const hidl_handle& fd,
                     const hidl_vec<hidl_string>& args) override;

 private:
  class VsyncCallback : public BnVsyncCallback {
   public: