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

Commit 31c8de61 authored by Jiwen 'Steve' Cai's avatar Jiwen 'Steve' Cai
Browse files

Add lshal support for VrHwc

Bug: 133452166
Bug: 133272775
Test: adb shell lshal debug android.hardware.graphics.composer@2.1::IComposer/vr
Change-Id: I1b108857cd6cbabd53793095119275682b9d6b37
parent 0419884f
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -994,6 +994,26 @@ void VrHwc::UpdateVsyncCallbackEnabledLocked() {
  vsync_callback_->SetEventCallback(send_vsync ? event_callback_ : nullptr);
  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 {
void HwcLayer::dumpDebugInfo(std::string* result) const {
  if (!result) {
  if (!result) {
    return;
    return;
+3 −0
Original line number Original line Diff line number Diff line
@@ -295,6 +295,9 @@ class VrHwc : public IComposer, public ComposerHal, public ComposerView {
  void RegisterObserver(Observer* observer) override;
  void RegisterObserver(Observer* observer) override;
  void UnregisterObserver(Observer* observer) override;
  void UnregisterObserver(Observer* observer) override;


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

 private:
 private:
  class VsyncCallback : public BnVsyncCallback {
  class VsyncCallback : public BnVsyncCallback {
   public:
   public: