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

Commit 171155a5 authored by Karthik Ravi Shankar's avatar Karthik Ravi Shankar
Browse files

Add VrFlinger dumpsys to SurfaceFlinger



When we do dumpsys SurfaceFlinger, we get no information about the
layers/what is composed when the device is in VR mode.

Bug: 63113212
Test:
VrFlinger state:
Application Surfaces:
Surface 0: surface_id=11 process_id=5550 user_id=10104 visible=1
z_order=0 queue_ids=29,37
Surface 1: surface_id=13 process_id=5035 user_id=10130 visible=1
z_order=0 queue_ids=53,65

Direct Surfaces:
Surface 0: surface_id=8 process_id=5563 user_id=10104 visible=1
z_order=0 queue_ids=17

Display metrics:     1440x2880 537.882x537.882 dpi @ 60 Hz
Post thread resumed: 1
Active layers:       1

Layer 0: type=Device surface_id=8 buffer_id=19

Hardware Composer Debug Info:
-------------------------------
HWC2 display_id: 0
layer:   30 z: 0 compositon: Device/Device alpha: 255 format:
RGBA_8888_UBWC dataspace:0x00000000 transform: 0/0/0 buffer_id:
0x70b4877500
color modes supported: 0 7 9 current mode: 7
current transform:
  1.08  -0.02  -0.02   0.00
  -0.07   1.03  -0.07   0.00
  -0.01  -0.01   1.09   0.00
  0.00   0.00   0.00   1.00
-------------------------------

This section doesn't appear when the device is not in VR mode.

Change-Id: I2961a05fc3ea303e070be08de355fb6e56c3d0db
Signed-off-by: default avatarKarthik Ravi Shankar <karthikrs@google.com>
parent d5547979
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ class VrFlinger {
  // Called on a binder thread.
  void OnHardwareComposerRefresh();

  // dump all vr flinger state.
  std::string Dump();

 private:
  VrFlinger();
  bool Init(Hwc2::Composer* hidl,
+5 −1
Original line number Diff line number Diff line
@@ -139,6 +139,11 @@ void VrFlinger::OnHardwareComposerRefresh() {
  display_service_->OnHardwareComposerRefresh();
}

std::string VrFlinger::Dump() {
  // TODO(karthikrs): Add more state information here.
  return display_service_->DumpState(0/*unused*/);
}

void VrFlinger::PersistentVrStateCallback::onPersistentVrStateChanged(
    bool enabled) {
  ALOGV("Notified persistent vr mode is %s", enabled ? "on" : "off");
@@ -146,6 +151,5 @@ void VrFlinger::PersistentVrStateCallback::onPersistentVrStateChanged(
  // Persistent VR mode is not enough.
  // request_display_callback_(enabled);
}

}  // namespace dvr
}  // namespace android
+9 −0
Original line number Diff line number Diff line
@@ -3770,6 +3770,15 @@ void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,
     */
    const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
    alloc.dump(result);

    /*
     * Dump VrFlinger state if in use.
     */
    if (mVrFlingerRequestsDisplay && mVrFlinger) {
        result.append("VrFlinger state:\n");
        result.append(mVrFlinger->Dump().c_str());
        result.append("\n");
    }
}

const Vector< sp<Layer> >&