libvrflinger: Add additional info to PDX dump.
- Add logging for surface and layers.
- Minor cleanup of AcquiredBuffer code.
- Add additional debug tracing.
Bug: None
Test: servicetool --dump /dev/socket/pdx/system/vr/display/client
Change-Id: Ie7cfe46978139e0eef2184b03acb4b9bab428a33
diff --git a/libs/vr/libvrflinger/hardware_composer.h b/libs/vr/libvrflinger/hardware_composer.h
index 98e8905..a0c50e1 100644
--- a/libs/vr/libvrflinger/hardware_composer.h
+++ b/libs/vr/libvrflinger/hardware_composer.h
@@ -127,11 +127,20 @@
int surface_id = -1;
pdx::rpc::IfAnyOf<SourceSurface>::Call(
&source_, [&surface_id](const SourceSurface& surface_source) {
- surface_id = surface_source.surface->surface_id();
+ surface_id = surface_source.GetSurfaceId();
});
return surface_id;
}
+ int GetBufferId() const {
+ int buffer_id = -1;
+ pdx::rpc::IfAnyOf<SourceSurface>::Call(
+ &source_, [&buffer_id](const SourceSurface& surface_source) {
+ buffer_id = surface_source.GetBufferId();
+ });
+ return buffer_id;
+ }
+
private:
void CommonLayerSetup();
@@ -192,7 +201,15 @@
}
// Returns the surface id of the surface.
- int GetSurfaceId() { return surface->surface_id(); }
+ int GetSurfaceId() const { return surface->surface_id(); }
+
+ // Returns the buffer id for the current buffer.
+ int GetBufferId() const {
+ if (acquired_buffer.IsAvailable())
+ return acquired_buffer.buffer()->id();
+ else
+ return -1;
+ }
};
// State when the layer is connected to a buffer. Provides the same interface
@@ -213,6 +230,7 @@
IonBuffer* GetBuffer() { return buffer.get(); }
int GetSurfaceId() const { return -1; }
+ int GetBufferId() const { return -1; }
};
// The underlying hardware composer layer is supplied buffers either from a