VR: Add ability to pass layer info through SurfaceFlinger
Updates SurfaceFlinger to connect to the VR HWC service and pass
additional layer information.
For now VR mode is enabled at build time.
Bug: 33297385
Test: Ran on device and verified the IVrComposerClient::setLayerInfo()
call is done successfully.
Change-Id: I9dea2451a3a2aa1919395d3785ae00446ba51f26
diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.h b/services/surfaceflinger/DisplayHardware/ComposerHal.h
index 5ce5869..329d787 100644
--- a/services/surfaceflinger/DisplayHardware/ComposerHal.h
+++ b/services/surfaceflinger/DisplayHardware/ComposerHal.h
@@ -215,8 +215,17 @@
Error setLayerVisibleRegion(Display display, Layer layer,
const std::vector<IComposerClient::Rect>& visible);
Error setLayerZOrder(Display display, Layer layer, uint32_t z);
-
+ Error setLayerInfo(Display display, Layer layer, uint32_t type,
+ uint32_t appId);
private:
+ class CommandWriter : public CommandWriterBase {
+ public:
+ CommandWriter(uint32_t initialMaxSize);
+ ~CommandWriter() override;
+
+ void setLayerInfo(uint32_t type, uint32_t appId);
+ };
+
// Many public functions above simply write a command into the command
// queue to batch the calls. validateDisplay and presentDisplay will call
// this function to execute the command queue.
@@ -228,8 +237,10 @@
// 64KiB minus a small space for metadata such as read/write pointers
static constexpr size_t kWriterInitialSize =
64 * 1024 / sizeof(uint32_t) - 16;
- CommandWriterBase mWriter;
+ CommandWriter mWriter;
CommandReader mReader;
+
+ bool mIsInVrMode = false;
};
} // namespace Hwc2